This project demonstrates a comprehensive research assistant implementation using AG-UI protocol, LangGraph, and CopilotKit. The system allows users to ask research questions and receive detailed reports with sources.
The project consists of two main components:
Python-based backend that:
- Processes research queries
- Performs web searches using Serper API
- Generates detailed research reports using OpenAI
- Implements AG-UI protocol with FastAPI
- Uses LangGraph for the research workflow
Next.js/React frontend that:
- Provides a user-friendly research interface
- Connects to the backend using CopilotKit
- Visualizes research progress with real-time updates
- Displays formatted research reports with sources
- Implements responsive UI for research workflow
This project demonstrates AG-UI protocol implementation:
- Event-driven architecture for real-time updates
- State management using snapshots and deltas
- Standardized message events for communication
- Progress tracking through state updates
-
Navigate to the backend directory:
cd ag-ui-research-agent
-
Install dependencies:
poetry install
-
Create a
.env
file with API keys:OPENAI_API_KEY=your-openai-key SERPER_API_KEY=your-serper-key
-
Run the backend:
poetry run python -m src.my_endpoint.main
-
Navigate to the frontend directory:
cd ag-ui-research-frontend
-
Install dependencies:
npm install
-
Start the development server:
npm run dev
-
Open http://localhost:3000 to access the application
┌─────────────────┐ AG-UI ┌─────────────────┐
│ │ Protocol │ │
│ React Frontend │<----------------->│ Python Backend │
│ (CopilotKit) │ (HTTP/SSE) │ (LangGraph) │
└─────────────────┘ └─────────────────┘
│ │
│ │
┌─────────────────┐ ┌─────────────────┐
│ │ │ │
│ User │ │ Web Search │
│ Interface │ │ (Serper API) │
└─────────────────┘ └─────────────────┘
│
┌─────────────────┐
│ │
│ Report │
│ Generation │
│ (OpenAI) │
└─────────────────┘
- Natural language research query processing
- Real-time research progress tracking
- Structured research reports with sections
- Source management and citation
- Modern, responsive UI
- Streaming updates using AG-UI protocol
- Backend: Python, FastAPI, LangGraph, OpenAI, Serper API
- Frontend: Next.js, React, CopilotKit
- Protocol: AG-UI (Agent User Interaction Protocol)
[Specify license or state that it's private/internal]