← Back to all products

AI Agent Framework

$59

Multi-agent orchestration system with tool calling, memory management, planning loops, and human-in-the-loop patterns.

📁 64 files
MarkdownYAMLPythonReactCI/CDLLMOpenAI

📄 Product Preview

Try the interactive reader and demo tools below, or get the full product with all content unlocked.

📖 Interactive Reader (Free Preview) ⚙ Try Demo Tools 📦 Download Free Sample

📁 File Structure 64 files

ai-agent-framework/ ├── LICENSE ├── README.md ├── configs/ │ ├── agent_config.yaml │ └── team_config.yaml ├── examples/ │ ├── __pycache__/ │ │ ├── basic_agent.cpython-312.pyc │ │ ├── research_agent.cpython-312.pyc │ │ └── team_example.cpython-312.pyc │ ├── basic_agent.py │ ├── research_agent.py │ └── team_example.py ├── free-sample.zip ├── guide/ │ ├── 01-building-an-agent.md │ └── 02-tool-design.md ├── guides/ │ ├── building-an-agent.md │ └── tool-design.md ├── index.html ├── requirements.txt ├── src/ │ ├── __init__.py │ ├── __pycache__/ │ │ ├── __init__.cpython-312.pyc │ │ ├── agent.cpython-312.pyc │ │ ├── approval.cpython-312.pyc │ │ ├── guardrails.cpython-312.pyc │ │ ├── llm_client.cpython-312.pyc │ │ └── tool_registry.cpython-312.pyc │ ├── agent.py │ ├── approval.py │ ├── coordination/ │ │ ├── __init__.py │ │ ├── __pycache__/ │ │ │ ├── __init__.cpython-312.pyc │ │ │ ├── message_bus.cpython-312.pyc │ │ │ └── supervisor.cpython-312.pyc │ │ ├── message_bus.py │ │ └── supervisor.py │ ├── guardrails.py │ ├── llm_client.py │ ├── memory/ │ │ ├── __init__.py │ │ ├── __pycache__/ │ │ │ ├── __init__.cpython-312.pyc │ │ │ ├── buffer.cpython-312.pyc │ │ │ ├── long_term.cpython-312.pyc │ │ │ └── summarizer.cpython-312.pyc │ │ ├── buffer.py │ │ ├── long_term.py │ │ └── summarizer.py │ ├── planning/ │ │ ├── __init__.py │ │ ├── __pycache__/ │ │ │ ├── __init__.cpython-312.pyc │ │ │ ├── plan_execute.cpython-312.pyc │ │ │ └── react.cpython-312.pyc │ │ ├── plan_execute.py │ │ └── react.py │ ├── tool_registry.py │ └── tools/ │ ├── __init__.py │ ├── __pycache__/ │ │ ├── __init__.cpython-312.pyc │ │ ├── calculator.cpython-312.pyc │ │ ├── file_io.cpython-312.pyc │ │ └── web_search.cpython-312.pyc │ ├── calculator.py │ ├── file_io.py │ └── web_search.py └── tests/ ├── __init__.py ├── __pycache__/ │ ├── __init__.cpython-312.pyc │ ├── test_memory.cpython-312.pyc │ └── test_tools.cpython-312.pyc ├── test_memory.py └── test_tools.py

📖 Documentation Preview README excerpt

AI Agent Framework

A modular, extensible framework for building LLM-powered AI agents in Python. Provides everything you need to go from a simple chatbot to a multi-agent orchestration system: tool calling, memory management, planning loops, coordination patterns, guardrails, and human-in-the-loop approval gates.

Features

  • Agent base class with lifecycle hooks, event streaming, and configurable behavior
  • Tool registry with automatic JSON Schema generation from Python type hints
  • Memory management: short-term conversation buffer with summarization, long-term vector-backed semantic recall
  • Planning loops: ReAct (interleaved reasoning and acting) and Plan-and-Execute (decompose then solve)
  • Multi-agent coordination: supervisor/worker delegation and peer-to-peer message bus
  • Guardrail hooks: content filtering, rate limiting, length guards -- composable in chains
  • Human-in-the-loop: approval gates for high-risk tool calls (interactive, policy-based, auto-approve)
  • Built-in tools: safe calculator (AST-based), web search stub, sandboxed file I/O
  • Mock LLM client: test your entire agent pipeline without API calls or costs
  • OpenAI client adapter: drop-in integration with GPT-4o and other OpenAI models

Quick Start


pip install -r requirements.txt
python examples/basic_agent.py

Minimal Agent (5 Lines)


from src.agent import Agent, AgentConfig
from src.tool_registry import ToolRegistry, tool
from src.llm_client import MockLLMClient

registry = ToolRegistry()

@registry.register
@tool(description="Add two numbers")
def add(a: float, b: float) -> float:
    return a + b

agent = Agent(
    config=AgentConfig(name="calc-bot", system_prompt="You do math."),
    llm=MockLLMClient(),
    tools=registry,
)
result = agent.run("What is 2 + 3?")

With Real LLM


from src.llm_client import OpenAIClient

agent = Agent(
    config=AgentConfig(name="assistant"),
    llm=OpenAIClient(api_key="YOUR_API_KEY_HERE"),
    tools=registry,
)

Architecture

... continues with setup instructions, usage examples, and more.

📄 Code Sample .py preview

examples/basic_agent.py""" Basic agent example - a simple calculator bot. This demonstrates the minimal setup: one agent, two tools, using the mock LLM client so it runs without an API key. Replace MockLLMClient with OpenAIClient to use a real LLM. Run: python examples/basic_agent.py """ import sys import os import logging # Add the parent directory to the path so we can import src/ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from src.agent import Agent, AgentConfig, AgentEvent from src.tool_registry import ToolRegistry, tool from src.llm_client import MockLLMClient from src.guardrails import GuardrailChain, ContentFilter, RateLimiter logging.basicConfig(level=logging.INFO, format="%(name)s | %(message)s") def build_calculator_agent() -> Agent: """Create a calculator agent with basic math tools.""" registry = ToolRegistry() @registry.register @tool(description="Add two numbers together") def add(a: float, b: float) -> float: return a + b @registry.register @tool(description="Multiply two numbers") def multiply(a: float, b: float) -> float: return a * b
Buy Now — $59 Back to Products