Skip to main content

Friday Agent SDK for Python

PyPI version Python versions License: MIT

Status: alpha — APIs may change. Pin an exact version in production.

Write AI agents in Python that run inside the Friday platform. The host manages credentials and routes LLM, HTTP, and MCP calls on the agent's behalf, so your agent code stays a pure Python function — no provider SDKs, no key plumbing in your code.

The SDK on its own is not runnable: agents need the Friday daemon to host them and an LLM provider key configured on the daemon. See Prerequisites below.

Prerequisites

  • Python 3.12+
  • The Friday daemon and atlas CLI — install via friday-platform/friday-studio. Follow that repo's quickstart to clone, install, configure an LLM provider key, and run deno task atlas daemon start --detached. Verify it's up:
    curl -sf http://localhost:8080/health && echo "  daemon ok"
    
  • An LLM provider API key (Anthropic, OpenAI, or Google) configured in the daemon's .env — see Friday Studio's .env.example for the full list.

Daemon ports. Friday exposes two HTTP services: the daemon API and Friday Studio. The defaults depend on how you ran Friday:

Mode Daemon API Friday Studio
Running from source :8080 :5200
Installer / Docker :18080 :15200

Examples in this README use the source-code ports. If you installed Friday via the installer or Docker, replace 808018080 and 520015200.

Quickstart

Install the SDK from PyPI:

pip install friday-agent-sdk
# or, with uv:
uv add friday-agent-sdk

Create an agent directory:

mkdir -p agents/my-analyzer

Write agents/my-analyzer/agent.py:

from friday_agent_sdk import agent, ok, AgentContext, run

@agent(
    id="my-analyzer",
    version="1.0.0",
    description="Analyzes text with an LLM",
)
def execute(prompt: str, ctx: AgentContext):
    result = ctx.llm.generate(
        messages=[{"role": "user", "content": f"Summarize this: {prompt}"}],
        model="anthropic:claude-haiku-4-5",
    )
    return ok({"summary": result.text})

if __name__ == "__main__":
    run()

Register your agent with the daemon:

atlas agent register ./agents/my-analyzer

Test it:

atlas agent exec my-analyzer -i "Summarize this codebase"

Or via the playground API:

curl -s -X POST http://localhost:5200/api/agents/my-analyzer/run \
  -H 'Content-Type: application/json' \
  -d '{"input": "Summarize this codebase"}'

Documentation

Installation

The SDK is published to PyPI as friday-agent-sdk:

pip install friday-agent-sdk
# or with uv
uv add friday-agent-sdk

To install from a clone of this repo (e.g. when working on the SDK itself):

cd packages/python
uv sync --all-extras --dev
# or: pip install -e .

Examples

See examples/ for complete agents ranging from minimal to production-grade. examples/README.md has the full annotated index, including required env vars.

Example Demonstrates
echo-agent The minimum viable agent — start here
context-inspector Inspect every AgentContext field as JSON — useful for E2E debugging
llm-http-agent ctx.llm.generate() and ctx.http.fetch() happy and error paths
tools-agent ctx.tools.list(), ctx.tools.call(), and ctx.stream.progress()
time-agent Declare an MCP server via the mcp= decorator and call a tool from it
bash-test-agent Bash tool capabilities — stdout/stderr/exit/cwd/env/multi-command
jira-agent parse_operation() dispatch across Jira REST API v3 operations
gh-agent GitHub PR operations — clone, view, diff, review, follow-ups
bb-agent Bitbucket equivalent of gh-agent — production HTTP patterns
claude-code-agent Full multi-phase agent: structured extraction, fallbacks, artifacts

Testing

Run unit tests for the Python SDK:

cd packages/python
pytest

Advanced usage

Custom entry points

If your agent file is not named agent.py, specify the entry point during registration:

atlas agent register ./my-agent --entry main.py

Or via the API:

curl -s -X POST http://localhost:8080/api/agents/register \
  -H 'Content-Type: application/json' \
  -d '{"entrypoint": "/path/to/my-agent/main.py"}'

Direct execution API

For CI/CD pipelines or automation, execute agents via the daemon API:

curl -s -X POST http://localhost:8080/api/agents/my-agent/run \
  -H 'Content-Type: application/json' \
  -d '{"input": "test prompt"}'

Error responses include the phase that failed (prereqs, validate, write):

{ "ok": false, "phase": "validate", "error": "description is required" }

Limitations

  • No streaming LLM responsesctx.llm.generate() blocks until the full response is ready
  • One agent per file — Each .py file registers exactly one @agent
  • 5MB HTTP response limit — Matches Friday's platform webfetch limit
  • Spawn-per-call — Each execution starts a fresh process; keep startup lightweight

Troubleshooting

Registration fails with "validate timeout" The daemon spawns your agent to collect metadata and waits up to 15s. Check that run() is called in __main__ and that the daemon is running.

Agent not appearing after registration Check that registration succeeded: atlas agent list. Agents are stored in ~/.friday/local/agents/.

Registration returns 400 Your @agent decorator metadata failed validation. Required fields: id, version, description.

Execution hangs The agent may not be signaling readiness before the daemon sends the execute request. Verify run() is called.

Import errors in IDE The friday_agent_sdk package must be installed in your active Python environment (pip install friday-agent-sdk, or pip install -e . when working from a clone) for type checking and autocomplete.

License

MIT

Release files for friday-agent-sdk 0.1.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for friday-agent-sdk 0.1.9
File Size Uploaded
friday_agent_sdk-0.1.9.tar.gz 22.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for friday-agent-sdk 0.1.9
File Interpreter ABI Platform
friday_agent_sdk-0.1.9-py3-none-any.whl Python 3 none any Details

Total release size:40.3 kB

Release files / friday_agent_sdk-0.1.9.tar.gz

Download URL friday_agent_sdk-0.1.9.tar.gz
Size 22.0 kB
Tags Source
SHA-256 checksum
How to use checksums
deac736d81b537f9248ee70f8665764639b5541db1dd852fcba8cec4d39f11eb
BLAKE2b-256 checksum
How to use checksums
65c702a25e3aa9024f937d4bc49f79e221a6d5971c5248eb1d29900eaeed957b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 15, 2026.

Transparency log

Release files / friday_agent_sdk-0.1.9-py3-none-any.whl

Download URL friday_agent_sdk-0.1.9-py3-none-any.whl
Size 18.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4f4fca2bf4257a453f9c97a0bfc8aa80584ce5cbcb403c54f22d51b158e0eba9
BLAKE2b-256 checksum
How to use checksums
712e8249fb7a9dc7ab4b521bc32de59447f140fcd637c3384aaa8152d9bb346d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 15, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.9 This release

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page