A transparent agent runtime: tools, guardrails, budgets, memory and full traces. Zero dependencies.
Inspired by autonomous-agent projects like AutoGPT, OpenClaw, Rea and Hermes. This is an original implementation focused on the part those projects often hide: predictable control flow, hard budgets and auditable decisions.
goal
|
+------v-------+
| provider | <- any object with complete(prompt) -> str
+------+-------+
| ACT: tool(arg=value) / FINISH: answer
+------v-------+
| guardrails | deny list, destructive flag, call budget
+------+-------+
|
+------v-------+
| tool registry| -> typed args, per-call failure isolation
+------+-------+
|
+------v-------+
| memory+trace | -> episodic buffer, learned facts, JSON export
+--------------+
Unlike a chat loop, every step is recorded and every action passes through policy. A failing tool returns a result; it never crashes the run.
python -m agentkit "Calculate 6 times 7"Goal: Calculate 6 times 7
1. calculate(expression=6*7) -> ok=True 42
2. FINISH -> The answer is 42.
Answer: The answer is 42.
Success: True (2 steps, 1 tool calls)
from agentkit import Agent, OfflineProvider, Tool, ToolRegistry
tools = ToolRegistry()
tools.register(Tool("double", "Double a number", lambda value: int(value) * 2, {"value": "integer"}))
provider = OfflineProvider([
"ACT: double(value=21)",
"FINISH: The answer is 42.",
])
result = Agent("Double 21", provider, tools, max_steps=5).run()
print(result.to_dict())OfflineProvider runs a scripted plan so demos and tests need no API key. For a real model, supply any object implementing complete(prompt) -> str.
- Destructive tools are blocked unless
allow_destructive=True. - Individual tools can be denied by name.
- Step and tool-call budgets are hard limits.
- The demo calculator uses AST allow-listing, not
eval.
python -m unittest discover -s tests # 22 tests, no dependenciesMIT licensed.