Skip to main content

Multi-provider AI agents built on pykka.

Project description

actor-ai

Multi-provider AI agents built on pykka.

actor-ai extends pykka's actor framework so each actor can process natural-language instructions, call tools, maintain conversation sessions, remember facts, track token spend, and monitor traffic — all with a clean, provider-agnostic API.

Installation

pip install actor-ai          # or: uv add actor-ai

Requires Python ≥ 3.14 and one (or more) provider API keys.

Quick start

from actor_ai import AIActor, Claude

class Assistant(AIActor):
    system_prompt = "You are a helpful assistant."
    provider = Claude()          # requires ANTHROPIC_API_KEY

ref = Assistant.start()
reply = ref.proxy().instruct("What is the capital of France?").get()
print(reply)   # → "The capital of France is Paris."
ref.stop()

Providers

Class Backend Environment variable
Claude Anthropic ANTHROPIC_API_KEY
GPT OpenAI OPENAI_API_KEY
Gemini Google AI (OpenAI-compat) GOOGLE_API_KEY
Mistral Mistral AI MISTRAL_API_KEY
DeepSeek DeepSeek DEEPSEEK_API_KEY
LiteLLM Any (100+ models) depends on model

Key features

  • Multi-turn sessions — rolling conversation history, configurable window (max_history)
  • Long-term memoryremember(key, value) / forget(key) facts injected into every system prompt
  • Tool calling — decorate methods with @tool to expose them to the LLM
  • Chorus — orchestrate groups of agents (broadcast, pipeline)
  • Accounting — track token usage and cost per actor, model, and session (Ledger, Rates)
  • Monitoring — forward per-call metadata to LiteLLM callbacks (Langfuse, Helicone, custom)

Examples

The examples/ directory contains ten self-contained, runnable scripts.
Each example uses a fake scripted provider so no API key is required to run them.

examples/
  01_hello_world.py    — One-turn interaction
  02_session.py        — Session history, max_history, clear_session
  03_memory.py         — remember() / forget()
  04_tools.py          — @tool decorator and tool calling
  05_providers.py      — All six provider configurations
  06_chorus.py         — Chorus: instruct, broadcast, pipeline
  07_accounting.py     — Ledger and Rates
  08_monitoring.py     — LiteLLM monitoring
  09_messages.py       — Instruct / Remember / Forget message objects
  10_advanced.py       — Full pipeline combining all features

Run any example:

uv run python examples/01_hello_world.py

User Manual

See MANUAL.md for the complete reference.

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

actor_ai-0.1.1.tar.gz (15.1 kB view details)

Uploaded Source

Built Distribution

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

actor_ai-0.1.1-py3-none-any.whl (21.1 kB view details)

Uploaded Python 3

File details

Details for the file actor_ai-0.1.1.tar.gz.

File metadata

  • Download URL: actor_ai-0.1.1.tar.gz
  • Upload date:
  • Size: 15.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Pop!_OS","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for actor_ai-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0bb9c8bff78994ccea6ef9c68d5d1b32fefe9a85ea600ed77b7d798b19a3d79e
MD5 70728ef111b1395f395a6251c89c1c8f
BLAKE2b-256 2ff362a2acea53e16365167f96e1cb0080859b8eeaf3fe1075124cbcb884148b

See more details on using hashes here.

File details

Details for the file actor_ai-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: actor_ai-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 21.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Pop!_OS","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for actor_ai-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9a408bef8ada59df3b496c58a4032a20c57e337ab338e3f62174960543ea7064
MD5 a93d0aa3e8cfcfb5bf8e3e8a1c263686
BLAKE2b-256 32fbbdb012aa61d12ad8441f1e05b787d841c15b71494335ec7905201fedaa6f

See more details on using hashes here.

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