AI Agent Backend with AG-UI Protocol Support
A production-ready AI agent backend featuring:
- AG-UI Protocol - Real-time streaming compatible with CopilotKit
- Agent Management - Create, configure, and manage AI agents
- Tool Integration - Extensible tool system (web search, API calls)
- React Components - Pre-built UI for agent interactions
thesis-repo/
├── apps/
│ ├── docs/ # Astro documentation site
│ ├── storybook/ # Component documentation
│ └── web/ # Demo web application
├── packages/
│ ├── ui/ # React UI components (@thesis/ui)
│ ├── backend/ # Python FastAPI backend
│ └── types/ # Shared TypeScript types (@thesis/types)
├── turbo.json # Turborepo configuration
└── pnpm-workspace.yaml
- Node.js 18+
- Python 3.11+
- pnpm 9+
- MongoDB 6.0+
# Clone the repository
git clone https://github.com/thesis-repo/thesis-repo.git
cd thesis-repo
# Install Node.js dependencies
pnpm install
# Set up Python backend
cd packages/backend
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
cp .env.example .env
# Edit .env with your OPENAI_API_KEY# Run all services
pnpm dev
# Or run individually
pnpm storybook # Storybook on :6006
pnpm docs # Documentation on :4321
pnpm backend # Backend on :8000pnpm build| Service | URL | Description |
|---|---|---|
| Backend API | http://localhost:8000 | FastAPI REST API |
| Swagger UI | http://localhost:8000/docs | Interactive API docs |
| Storybook | http://localhost:6006 | Component documentation |
| Documentation | http://localhost:4321 | Astro docs site |
React components for agent interfaces.
import { Chat, ChatPage } from '@thesis/ui'
<ChatPage
agentId="my-agent"
agentName="Assistant"
backendUrl="http://localhost:8000"
/>FastAPI backend with AG-UI protocol support.
# Create an agent
curl -X POST http://localhost:8000/agents \
-H "Content-Type: application/json" \
-d '{
"name": "My Agent",
"llm_type": "gpt-4o-2024-08-06",
"allowed_tools": ["web_search"],
"initial_prompt": "You are a helpful assistant."
}'Full documentation available at http://localhost:4321 when running locally, including:
| Layer | Technology |
|---|---|
| Monorepo | Turborepo + pnpm |
| Documentation | Astro + Starlight |
| UI Components | React + TypeScript |
| Component Docs | Storybook 8 |
| Backend | FastAPI (Python) |
| Database | MongoDB |
| LLM | OpenAI GPT-4 |
| Protocol | AG-UI (SSE) |
MIT