A complete, production-ready AI agent platform with FastAPI backend + React frontend. Fully integrated and ready to use!
Transform a simple AI agent into a full-featured platform:
- Model Playground - Chat interface with real agent responses
- Inspect Runs - View complete execution history with every step
- Manage Tools - 3 tools ready (calculator, web search, file I/O)
- Agent Engine - Autonomous multi-step problem solving
- Database - Automatic run tracking in SQLite
Status: Frontend ↔ Backend = CONNECTED
Frontend (React) ←→ FastAPI Backend ←→ Agent Engine ←→ Tools
│ │ │ │
│ Database Run Tracker Calculator
│ (SQLite) Web Search
│ File I/O
└─── AgentPlatform.jsx
AI-Agent/
├── agent.py # Original simple agent (reference)
├── api/
│ ├── main.py # FastAPI app entry point
│ └── routes/
│ ├── playground.py # POST /api/chat
│ ├── runs.py # GET /api/runs, /api/runs/{id}
│ └── tools.py # Tool CRUD endpoints
├── core/
│ ├── agent_engine.py # Enhanced agent with tracking
│ ├── run_tracker.py # Captures execution steps
│ └── tool_registry.py # Dynamic tool discovery
├── models/
│ ├── database.py # SQLAlchemy setup
│ ├── run.py # Run & RunStep models
│ └── tool.py # Tool model
├── tools/
│ ├── base.py # BaseTool abstract class
│ ├── calculator.py # Math operations
│ ├── web_search.py # Web search (placeholder)
│ └── file_io.py # File operations
├── Architecture.md # Complete architecture docs
├── SETUP.md # Setup instructions
└── requirements.txt # Python dependencies
./start.shThat's it! One command starts everything:
- Backend API (port 8000)
- Frontend UI (port 3000)
- Auto-opens browser
- Both running in parallel
Press Ctrl+C to stop both servers.
Create .env file:
API_KEY=your-tamu-api-key
API_BASE_URL=https://your-endpoint/v1
MODEL=protected.Claude Sonnet 4.5Then just run:
./start.sh- Open http://localhost:3000
- Go to Playground tab
- Type: "What is 10 + 5, then multiply by 3?"
- Watch agent solve it step-by-step!
- Go to Inspect Runs to see complete history
- Go to Manage Tools to see available tools
That's it! Everything is connected and working.
If you want to test backend API directly:
# Health check
curl http://localhost:8000/health
# Chat with agent
curl -X POST http://localhost:8000/api/chat \
-H "Content-Type: application/json" \
-d '{"message": "What is 5 + 10, then multiply by 3?"}'Visit: http://localhost:8000/docs
Connect your React frontend (AgentPlatform.jsx):
const API_URL = 'http://localhost:8000/api';
// Send message
const response = await fetch(`${API_URL}/chat`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ message: 'Your question here' })
});
const { response: answer, run_id } = await response.json();
// Get execution details
const run = await fetch(`${API_URL}/runs/${run_id}`);
const { steps } = await run.json();POST /api/chat- Send message, get response + run_idGET /api/chat/status- Health check
GET /api/runs- List all runs (with pagination)GET /api/runs/{id}- Get run with all stepsDELETE /api/runs/{id}- Delete a runGET /api/runs/stats/summary- Get statistics
GET /api/tools- List all toolsGET /api/tools/{id}- Get tool schemaPUT /api/tools/{id}- Update tool (enable/disable)GET /api/tools/stats/summary- Get tool stats
- Create new file in
tools/directory:
# tools/my_tool.py
from tools.base import BaseTool
class MyTool(BaseTool):
name = "my_tool"
display_name = "My Tool"
description = "What my tool does"
icon = "IconName"
def get_parameters(self):
return {
"type": "object",
"properties": {
"param": {"type": "string", "description": "Parameter description"}
},
"required": ["param"]
}
def execute(self, param: str) -> str:
# Your tool logic here
return f"Result: {param}"- Restart server - tool auto-discovered!
- User sends message via
/api/chat - API creates Run and RunTracker
- Agent Engine executes with tool registry
- Each step is tracked:
- User request
- Agent thoughts
- Tool calls (with params)
- Tool results
- Agent response
- Run saved to database
- Frontend gets response + run_id
- User can inspect via
/api/runs/{id}
User Request: "What is 5 + 10, then multiply by 3?"
↓
Agent Thought: "Need to add 5 + 10"
↓
Tool Call: calculator(add, 5, 10)
↓
Tool Result: "5 + 10 = 15"
↓
Agent Thought: "Now multiply 15 by 3"
↓
Tool Call: calculator(multiply, 15, 3)
↓
Tool Result: "15 * 3 = 45"
↓
Agent Response: "The result is 45"
SQLite database (agent_platform.db) stores:
- runs - All agent executions
- run_steps - Detailed step-by-step history
- tools - Tool configurations (enabled/disabled)
- README.md (this file) - Complete setup and usage guide
- Architecture.md - Deep technical architecture and design decisions
- API Docs - http://localhost:8000/docs (interactive, auto-generated)
- RESTful API - Clean, documented endpoints
- Tool Calling - Dynamic tool discovery and execution
- Run Tracking - Complete execution history
- Database Storage - Persistent run history
- CORS Enabled - Ready for React frontend
- Type Safe - Pydantic models for validation
- Auto Documentation - Swagger UI at
/docs - Extensible - Easy to add new tools
- WebSocket streaming for real-time updates
- Multi-model support (GPT-4, Claude, Llama)
- Custom tool creation via API
- Workflow builder (visual node editor)
- Rate limiting and authentication
- PostgreSQL for production
- Redis caching
- Docker containerization
- Monitoring and logging
- CI/CD pipeline
- Create new tool in
tools/ - Add API endpoint in
api/routes/ - Update documentation
- Test with frontend
MIT
- Check
Architecture.mdfor deep dive - Visit
/docsfor API reference - Run tests:
pytest(coming soon)
Built with: FastAPI, SQLAlchemy, OpenAI SDK, Pydantic
Powers: AgentPlatform.jsx frontend