Skip to main content

Python SDK for authoring Friday agents — call LLMs, HTTP, and MCP tools without managing keys.

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

friday_agent_sdk-0.1.2.tar.gz (21.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

friday_agent_sdk-0.1.2-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

Details for the file friday_agent_sdk-0.1.2.tar.gz.

File metadata

  • Download URL: friday_agent_sdk-0.1.2.tar.gz
  • Upload date:
  • Size: 21.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for friday_agent_sdk-0.1.2.tar.gz
Algorithm Hash digest
SHA256 dddfc01ef8d2140c89ab9d2fa78a00180998514fe5f5426deb59307769134c46
MD5 df2f72bd3a374d566c9e317491693c4b
BLAKE2b-256 bd212863553243b1408fc2b3e3139f80c69dcfb88b9cac2099db3112552d6af2

See more details on using hashes here.

Provenance

The following attestation bundles were made for friday_agent_sdk-0.1.2.tar.gz:

Publisher: release.yml on friday-platform/agent-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file friday_agent_sdk-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for friday_agent_sdk-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0d64db85660e0349049067d71a1c1cbf5dc4b627e4629aa478f34057da38f232
MD5 6b912b8c3bd12f65aebca4483b0799df
BLAKE2b-256 9af9f3daeeabc96018a7b694340b677345e405fe5d769aec3e7512a85f24bb5a

See more details on using hashes here.

Provenance

The following attestation bundles were made for friday_agent_sdk-0.1.2-py3-none-any.whl:

Publisher: release.yml on friday-platform/agent-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page