2.9 KiB
2.9 KiB
Interactive Research Assistant
Research assistant powered by haiku.rag, Pydantic AI, and AG-UI. Ask complex questions and watch the research process unfold in real-time.
Features
- Multi-step research workflow: Question decomposition, search, analysis, and synthesis
- Human-in-the-loop: Approve or revise research plans before execution
- Live state synchronization: Real-time updates of research progress between backend and frontend
- Context expansion: Automatically expands top search results for better context
- Rich reporting: Generates structured reports with findings, conclusions, and citations
Quick Start
Prerequisites
- Docker and Docker Compose
- A haiku.rag database with indexed documents
- Ollama (or configure another LLM provider)
Setup
-
Prepare your knowledge base
mkdir -p data haiku-rag add "Your documents here" --db data/haiku_rag.lancedb # Or add from files haiku-rag add-src document.pdf --db data/haiku_rag.lancedb -
Configure environment (optional)
cp .env.example .env # Edit .env to customize provider/modelSee haiku.rag configuration for details.
-
Start the application
docker compose up --build -
Access the interface
- Frontend: http://localhost:3000
- Backend health: http://localhost:8000/health
How It Works
- Ask a question: Type your research question in the chat
- Review the plan: The agent decomposes your question into 3 sub-questions
- Approve or revise: Choose to approve the plan or request changes
- Watch it work: The agent automatically:
- Searches the knowledge base for each sub-question
- Extracts key insights from search results
- Evaluates overall confidence in findings
- Get your report: Receive a structured research report with citations
Architecture
-
Backend (Python): Pydantic AI agent with haiku.rag integration
agent.py: Research agent with tool definitionsmain.py: Starlette app serving AG-UI protocol
-
Frontend (Next.js): CopilotKit/AG-UI interface
- Real-time state synchronization with backend
- Interactive approval workflow
- Collapsible research plan and insights display
Configuration
Environment variables (see .env.example):
DB_PATH: Path to haiku.rag database (default:haiku_rag.lancedb)QA_PROVIDER: LLM provider (default:ollama)QA_MODEL: Model name (default:gpt-oss:latest)OLLAMA_BASE_URL: Ollama endpoint (default:http://host.docker.internal:11434)
For other providers (OpenAI, Anthropic, etc.), see haiku.rag configuration docs.