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 memory —
remember(key, value)/forget(key)facts injected into every system prompt - Tool calling — decorate methods with
@toolto 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file actor_ai-0.1.0.tar.gz.
File metadata
- Download URL: actor_ai-0.1.0.tar.gz
- Upload date:
- Size: 14.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30c35d9321084efa953110f23750f9ccf16e8b9544cb4ce17d89c80d28f0fb21
|
|
| MD5 |
7168972ddd26088070a9b8a0af453c11
|
|
| BLAKE2b-256 |
f6e60b09f94860f6eecffd3c213f4186057d15cbd869594fe1660892262428cf
|
File details
Details for the file actor_ai-0.1.0-py3-none-any.whl.
File metadata
- Download URL: actor_ai-0.1.0-py3-none-any.whl
- Upload date:
- Size: 20.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b5a757a83823f4701c89e34e35465da0ba9c2b2dfb91d96efc189b6015b64e23
|
|
| MD5 |
5ca9f25384e59abb13ddddd4dc711f03
|
|
| BLAKE2b-256 |
7f4f18a145ec3b4a66b0e97256e09fdf10ae11b6f571611cd2813bfb59917d3b
|