OkooAI is a Retrieval-Augmented Generation (RAG) system built with LangChain, FastAPI, and ChromaDB. It answers tourism-related questions about Ethiopia using real documents, strict fallback logic, and adaptive routing.
# π§ OkooAI β Tourism Assistant Powered by RAG
OkooAI is a Retrieval-Augmented Generation (RAG) system built with LangChain, FastAPI, and ChromaDB. It answers tourism-related questions about Ethiopia using real documents, strict fallback logic, and adaptive routing.
## π Features
- β
Naive + Adaptive RAG pipeline
- β
LangGraph-based intent routing
- β
Strict fallback: no hallucinations
- β
Modular nodes for planning, comparison, exploration
- β
PDF ingestion and chunking
- β
Ollama-powered local LLM (Qwen 0.5b)
- β
FastAPI backend with clean endpoints
## π§± Architecture
```bash
User Query
β
βΌ
Intent Classifier βββΊ LangGraph Router
β β
βΌ βΌ
Retriever βββββββββββββββ
β β Nodes: β
βΌ β - ask_fact β
LLM + Prompt β - plan_trip β
β β - compare β
βΌ β - explore β
Reflection Node βββββ
β
βΌ
Final Answer + Source Chunks
```bash
## π Project Structure
```bash
advanced_rag_ai/
βββ api/
β βββ main.py # FastAPI entry point
β βββ tourism_graph.py # LangGraph workflow
β βββ planner_node.py # Trip planner logic
β βββ hotel_comparison_node.py
β βββ explore_place_node.py
β βββ intent_classifier.py
β βββ adaptive_retriever.py
β βββ self_reflective_rag.py
βββ data/ # Indexed tourism PDFs
βββ requirements.txt
βββ Dockerfile
βββ README.md
```
## π§ͺ Demo Instructions
### 1. Start Ollama
```bash
ollama run qwen:0.5b
```
### 2. Run the API
```bash
uvicorn api.main:app --reload
```
### 3. Test the Chat Endpoint
```bash
curl -X POST
localhost \
-H "Content-Type: application/json" \
-d '{"session_id": "demo", "question": "Plan a trip to Gondar", "model": "qwen:0.5b"}'
```
### 4. Upload a PDF
``` bash
curl -X POST
localhost \
-F "file=@data/03_Gondar_Bahir_Dar_Lake_Tana_Blue_Nile.pdf"
```
## π¦ Deployment
Use Docker for production:
```bash
docker build -t oko β¦