← Back to all products
$29
AI Agent Framework
Python framework for building AI agents with tool use, planning loops, memory, and multi-step reasoning.
JSONMarkdownPythonReactLLMOpenAILangChain
📄 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 11 files
ai-agent-framework/
├── LICENSE
├── README.md
├── examples/
│ ├── basic_usage.py
│ └── custom_tools.json
├── free-sample.zip
├── guide/
│ ├── 01_features.md
│ ├── 02_project-structure.md
│ ├── 03_usage-examples.md
│ └── 04_license.md
├── index.html
└── src/
└── ai_agent_framework.py
📖 Documentation Preview README excerpt
AI Agent Framework
Python framework for building AI agents with tool use, planning loops, memory management, multi-step reasoning, and structured output parsing. Zero dependencies.
Part of the AI Toolkit collection by [CodeVault](https://ai-toolkit.codevault.dev).
Features
- ReAct loop — Thought → Action → Observation reasoning loop (same pattern as LangChain/AutoGPT)
- Tool system — Register custom tools with parameter schemas and callable functions
- Memory manager — Sliding-window context management with intelligent trimming
- Output parser — Parses structured Thought/Action/Final Answer format from LLM responses
- Built-in tools — Search, calculator, and JSON formatter included as examples
- LLM-agnostic — Abstract
LLMInterface— wire to OpenAI, Anthropic, or any API - Safety limits — Configurable max_steps prevents infinite loops
- Full trace — Every step recorded with thought, action, observation
- Config export — Export agent configuration as JSON
Quick Start
# Run the demo with a simulated agent
python src/ai_agent_framework.py --demo
# List all registered tools
python src/ai_agent_framework.py --list-tools
# Export agent config
python src/ai_agent_framework.py --export-config my_agent.json
# Run agent on a task (uses simulated LLM)
python src/ai_agent_framework.py --task "What is the population of Helsinki?"
Project Structure
ai-agent-framework/
├── README.md
├── LICENSE
├── src/
│ └── ai_agent_framework.py # Core engine (~420 lines)
└── examples/
├── basic_usage.py # Build a custom agent
└── custom_tools.json # Tool definition examples
CLI Reference
| Flag | Description |
|---|---|
--demo | Run simulated agent demo |
--list-tools | List all registered tools |
--export-config FILE | Export agent config to JSON |
--task TEXT | Run agent on a task (simulated LLM) |
Usage Examples
Wire to a Real LLM
... continues with setup instructions, usage examples, and more.
📄 Code Sample .py preview
examples/basic_usage.py#!/usr/bin/env python3
"""
Basic usage example for the AI Agent Framework.
Demonstrates:
- Running the built-in demo agent
- Registering custom tools
- Inspecting the agent's reasoning trace
- Exporting agent configuration
- Using the MemoryManager and OutputParser directly
"""
import json
import sys
from pathlib import Path
# Allow running from the examples/ directory
sys.path.insert(0, str(Path(__file__).resolve().parent.parent / "src"))
from ai_agent_framework import (
Agent,
AgentState,
MemoryManager,
MemoryType,
OutputParser,
SimulatedLLM,
ToolDefinition,
)
def demo_basic_agent() -> None:
"""Run the default agent with the simulated LLM."""
print("=== Basic Agent Run ===\n")
agent = Agent(name="DemoAgent")
result = agent.run("What is the population of Helsinki?")
print(f" Success: {result.success}")
print(f" Steps: {result.total_steps}")
print(f" Time: {result.elapsed_seconds}s")
print(f" Answer: {result.answer[:100]}...")
print()