An AI-powered research assistant that answers questions by searching the web, gathering information, and synthesizing coherent answers with proper citations.
- Query Decomposition: Breaks complex questions into focused search queries
- Web Search Integration: Uses DuckDuckGo for real-time web search
- Source Tracking: Deduplicates and tracks all sources with unique IDs
- LLM Synthesis: Uses Google Gemini to synthesize coherent answers
- Citation System: Inline citations
[1],[2]with full source list - Confidence Scoring: Reports confidence level (0.0-1.0) in the answer
- Insufficient Info Handling: Gracefully handles cases with limited information
- Modern React UI: Clean, responsive dark-themed frontend
WEB-RAG/
├── backend/ # FastAPI Backend
│ ├── main.py # FastAPI application
│ ├── requirements.txt # Python dependencies
│ ├── .env # Environment variables (GOOGLE_API_KEY)
│ ├── core/ # Configuration and LLM setup
│ ├── agents/ # LangChain agent setup
│ ├── services/ # Query decomposition, synthesis, research service
│ ├── schemas/ # Request/Response models
│ ├── tools/ # Web search integration
│ └── utils/ # Error handling utilities
│
└── frontend/ # React Frontend (Vite)
├── package.json
├── src/
│ ├── App.jsx # Main application component
│ ├── index.css # Design system & base styles
│ ├── services/ # API service layer
│ └── components/ # UI Components
│ ├── SearchInput/ # Question input field
│ ├── LoadingSpinner/ # Loading animation
│ ├── AnswerDisplay/ # Answer with citations
│ ├── SourceCard/ # Source citation cards
│ ├── ConfidenceMeter/ # Confidence score display
│ └── QueryTags/ # Search queries used
└── ...
cd backend
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtCreate .env file:
GOOGLE_API_KEY=your_google_api_key_here
cd frontend
npm installTerminal 1 - Backend:
cd backend
source .venv/bin/activate
uvicorn main:app --reloadBackend runs at: http://localhost:8000
Terminal 2 - Frontend:
cd frontend
npm run devFrontend runs at: http://localhost:5173
| Endpoint | Method | Description |
|---|---|---|
/ |
GET | API info |
/health |
GET | Health check |
/ask |
POST | Submit research question |
/ask/simple |
POST | Simplified response |
curl -X POST http://localhost:8000/ask \
-H "Content-Type: application/json" \
-d '{"question": "What are the benefits of renewable energy?"}'| Layer | Technologies |
|---|---|
| Backend | FastAPI, Python 3.13, LangChain, Google Gemini |
| Search | DuckDuckGo (free, no API key) |
| Frontend | React, Vite, CSS Variables |
| Validation | Pydantic |
MIT