low level agent sdk
Project description
Tokki
Tokki is a protocol and library I designed to make it easier to create and design agents. Most other frameworks express agents as configuration, but I often find myself wanting to express agents as code where I can control every part of the loop.
Features
- Async gRPC service for Tokki agents
- Protobuf types exported from
tokki_sdk - LLM vendor adapters for Kimi, Mistral, Anthropic, and Ollama
- Tool runtime with file, shell, grep, glob, memory, database, PDF, MCP, and agent-to-agent helper tools
- SQLite-backed conversation archive
- Optional workspace boundary enforcement for file tools
Installation
pip install tokki-sdk
For local development:
uv sync --group dev
uv run pytest
./typecheck
Optional extras:
pip install "tokki-sdk[pdf]"
pip install "tokki-sdk[langchain]"
Minimal Agent
from tokki_sdk import Agent, Context, Role, Status
from tokki_sdk.tokki_pb2 import ContentNode
class EchoAgent(Agent):
async def init(self, context: Context) -> bool:
context.upsert_message_from_input(
role=Role.SYSTEM,
content=[ContentNode(text="You are a concise assistant.")],
)
return True
async def run(self, context: Context) -> None:
context.update_status(Status.STREAMING)
context.upsert_message_from_input(
role=Role.ASSISTANT,
content=[ContentNode(text="Hello from Tokki.")],
)
context.update_status(Status.COMPLETED)
Tool-Calling Agent
tokki_sdk.agents.toolcall.Toolcall implements a ReACT-style agent loop with LLM
tool calls:
import os
from tokki_sdk.agents.toolcall import Toolcall
from tokki_sdk.vendor import Kimi
agent = Toolcall(
model="moonshot-v1-auto",
summarisation_model="moonshot-v1-8k",
vendor=Kimi(api_key=os.environ["MOONSHOT_API_KEY"]),
)
The built-in tool-calling agent uses workspace/ as its working directory and
enforces file path boundaries for file tools.
Security Model
Tokki SDK agents are meant to run in a sandboxed environment, unless you avoid bash tool and internet usage.
Workspace Pattern
Agents can use a workspace/ directory for command execution, temporary files,
generated outputs, and conversation archives. See
docs/WORKSPACE.md for details.
Development
Run tests:
uv run pytest
Run type checks:
./typecheck
Integration tests that call real LLM or MCP services are skipped unless the required environment variables are set.
License
MIT. See LICENSE.
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 tokki_sdk-0.1.0.tar.gz.
File metadata
- Download URL: tokki_sdk-0.1.0.tar.gz
- Upload date:
- Size: 45.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.22 {"installer":{"name":"uv","version":"0.11.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e71a79c80b695bebabc2e0d1c1aa5e8a0cc9caf172d02ffe95e55f10e2691fdb
|
|
| MD5 |
95167eed7efa65caf8e106645953a7fe
|
|
| BLAKE2b-256 |
d015691fa5b6c31fac38a3171f0b144c45daed9df1d9a0b11a8f006d7ef208c7
|
File details
Details for the file tokki_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: tokki_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 62.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.22 {"installer":{"name":"uv","version":"0.11.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b60f17b7067e7ee1775dd7e163d26f86052aef498f104fc5536386d8d2af37a
|
|
| MD5 |
a6a9bbedbaf4380a355746077da5b719
|
|
| BLAKE2b-256 |
fcfce6bb8bebc35c82ec3f6b98312dc43d04dcb041ce9bbbab18daa43f14403d
|