Skip to content

45ck/thesis-repo

Repository files navigation

Thesis Agent API

thesis-repo banner

AI Agent Backend with AG-UI Protocol Support

Turborepo TypeScript Python FastAPI

Overview

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

Monorepo Structure

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

Quick Start

Prerequisites

  • Node.js 18+
  • Python 3.11+
  • pnpm 9+
  • MongoDB 6.0+

Installation

# 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

Development

# Run all services
pnpm dev

# Or run individually
pnpm storybook    # Storybook on :6006
pnpm docs         # Documentation on :4321
pnpm backend      # Backend on :8000

Build

pnpm build

Services

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

Packages

@thesis/ui

React components for agent interfaces.

import { Chat, ChatPage } from '@thesis/ui'

<ChatPage
  agentId="my-agent"
  agentName="Assistant"
  backendUrl="http://localhost:8000"
/>

@thesis/backend

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."
  }'

Documentation

Full documentation available at http://localhost:4321 when running locally, including:

Tech Stack

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)

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors