Skip to content
SakibpediaPublic

About

Guardrailed agent runtime with tools, memory, budgets and full traces. Zero dependencies.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

AgentKit

A transparent agent runtime: tools, guardrails, budgets, memory and full traces. Zero dependencies.

Tests Python Dependencies License

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.

Design

        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.

Quick start

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)

Library

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.

Safety

  • 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.

Tests

python -m unittest discover -s tests     # 22 tests, no dependencies

MIT licensed.

About

Guardrailed agent runtime with tools, memory, budgets and full traces. Zero dependencies.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages