AgentKit

January 4, 2026 Β· View on GitHub

Modern multi-agent AI assistant with LangGraph & AG-UI

🌐 TiαΊΏng Việt | English

Build powerful AI applications with real-time streaming, interactive UI components, and multi-agent orchestration.

AgentKit Chat Interface

✨ Features

  • πŸŽ›οΈ A2UI Protocol: Agents generate interactive UI components (checkboxes, forms, buttons) in chat
  • 🎨 Canvas Mode: Full-screen workspace for complex agent workflows
  • πŸ”„ Multi-Agent Orchestration: LangGraph-powered workflow management
  • ⚑ Real-time Streaming: AG-UI protocol with instant agent feedback
  • πŸ’¬ Thread Management: Persistent conversation threads with SQLite/PostgreSQL
  • 🎯 Modern Stack: NextJS + Shadcn UI + FastAPI + LangGraph
  • πŸ”Œ Multi-LLM Support: Ollama, Azure OpenAI, Gemini, and more
  • πŸ›‘οΈ Type-Safe: TypeScript frontend, Python type hints backend
  • πŸ“Š Observability: Optional LangFuse integration

πŸš€ Getting Started

Prerequisites

  1. Python 3.10+ and Node.js 18+
  2. Ollama (or configure Azure OpenAI/Gemini):
    curl -fsSL https://ollama.com/install.sh | sh
    ollama pull qwen:7b
    

Backend Setup

cd backend

# Create virtual environment
python -m venv .venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Configure environment (optional)
cp .env.example .env
# Edit .env for Azure OpenAI, Gemini, or PostgreSQL

# Run database migrations
python migrate.py

# Start server
python main.py

βœ… Backend running at http://localhost:8000

Frontend Setup

cd frontend

# Install dependencies
npm install

# Start development server
npm run dev

βœ… Frontend running at http://localhost:3000

πŸ—„οΈ Database Configuration

SQLite (default - zero config):

DATABASE_URL=sqlite+aiosqlite:///./agentkit.db

PostgreSQL (production):

DATABASE_URL=postgresql+asyncpg://user:password@localhost:5432/agentkit

Run migrations after any config change:

python migrate.py

πŸ”Œ LLM Provider Configuration

Edit .env in backend directory:

Ollama (default):

DEFAULT_PROVIDER=ollama
OLLAMA_BASE_URL=http://localhost:11434
OLLAMA_MODEL=qwen:7b

Azure OpenAI:

DEFAULT_PROVIDER=azure-openai
AZURE_OPENAI_API_KEY=your_key
AZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com
AZURE_OPENAI_DEPLOYMENT=gpt-5-mini

Gemini:

DEFAULT_PROVIDER=gemini
GEMINI_API_KEY=your_key
GEMINI_MODEL=gemini-2.5-flash

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Frontend  │◄────────│   AG-UI      │────────►│   Backend   β”‚
β”‚  (NextJS)   β”‚  SSE    β”‚   Protocol   β”‚  HTTP   β”‚  (FastAPI)  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                          β”‚
                                                          β–Ό
                                                   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                                   β”‚  LangGraph  β”‚
                                                   β”‚   Agents    β”‚
                                                   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                                          β”‚
                                                          β–Ό
                                                   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                                   β”‚  LLM Providerβ”‚
                                                   β”‚  (Ollama/   β”‚
                                                   β”‚   Azure/    β”‚
                                                   β”‚   Gemini)   β”‚
                                                   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Backend Stack:

  • FastAPI + LangGraph + AG-UI Protocol
  • SQLAlchemy (async) + SQLite/PostgreSQL
  • Ollama/Azure OpenAI/Gemini

Frontend Stack:

  • NextJS 14 + TypeScript + Shadcn UI
  • AG-UI client for event streams
  • LocalStorage for thread persistence

πŸ“š Documentation

πŸ› οΈ Development

Project Structure

agentkit/
β”œβ”€β”€ backend/              # FastAPI + LangGraph backend
β”‚   β”œβ”€β”€ agents/          # Agent implementations
β”‚   β”œβ”€β”€ graphs/          # LangGraph workflows
β”‚   β”œβ”€β”€ api/             # REST endpoints
β”‚   β”œβ”€β”€ database/        # SQLAlchemy models & migrations
β”‚   β”œβ”€β”€ llm/             # LLM provider integrations
β”‚   β”œβ”€β”€ protocols/       # AG-UI protocol implementation
β”‚   └── main.py          # Entry point
β”œβ”€β”€ frontend/            # NextJS frontend
β”‚   β”œβ”€β”€ app/            # App router pages
β”‚   β”œβ”€β”€ components/     # React components
β”‚   β”œβ”€β”€ services/       # API client
β”‚   └── types/          # TypeScript types
└── .docs/              # Documentation

API Endpoints

Chat: POST /api/chat - Stream agent responses Threads: GET/POST /api/threads - Manage conversations Messages: GET /api/threads/{id}/messages - Get thread history Health: GET /health - Server status

Adding New Agents

  1. Create agent in backend/agents/
  2. Define graph in backend/graphs/
  3. Register in backend/agents/agent_registry.py
  4. Update frontend components if needed

See agents.md for detailed guide.

πŸ§ͺ Testing

Backend:

cd backend
pytest

Frontend:

cd frontend
npm test

πŸ“ License

MIT License - see LICENSE file for details

🀝 Contributing

Contributions welcome! Please read our contributing guidelines first.

🌟 Show Your Support

If you find AgentKit useful, please consider giving it a star ⭐️