NOV.mov
An Agentic RAG Chatbot specialized in Space Exploration & Astronomy.
Built with Flask · OpenAI · ChromaDB · LangChain · Pure HTML/CSS/JS
cd backend
pip install -r requirements.txt
cp .env.example .env # Add your OPENAI_API_KEY
python main.py
# Open http://localhost:5000chatbot/
├── backend/
│ ├── data/
│ │ └── space_knowledge.txt # Knowledge base document
│ ├── chroma_db/ # Auto-generated vector store
│ ├── main.py # Flask server (entry point)
│ ├── rag.py # RAG pipeline (embed + retrieve)
│ ├── nova.py # NOVA agent logic + 3 scenarios
│ ├── requirements.txt
│ └── .env.example
└── frontend/
└── index.html # Full chatbot UI (HTML/CSS/JS)
cd chatbot/backendpython -m venv venv
source venv/bin/activate # Mac/Linux
venv\Scripts\activate # Windowspip install -r requirements.txtcp .env.example .env
# Edit .env and add your key:
# OPENAI_API_KEY=sk-...python main.pyhttp://localhost:5000
When a user sends a message, NOVA runs a 3-step pipeline:
User Input
│
▼
┌─────────────────────────────────┐
│ STEP 1: Topic Classification │ ← GPT-4o-mini decides domain
│ "Is this about space/astro?" │
└────────────┬────────────────────┘
│
┌──────┴──────┐
│ │
OUT OF IN DOMAIN
DOMAIN │
│ ▼
Scenario 1 ┌─────────────────┐
(introduce │ STEP 2: RAG │ ← ChromaDB similarity search
NOVA) │ Retrieve chunks │ (relevance score ≥ 0.3)
└──────┬──────────┘
│
┌────────┴────────┐
│ │
FOUND NOT FOUND
│ │
▼ ▼
Scenario 2 Scenario 3
(answer from ("I don't know")
context)
| Badge | Meaning |
|---|---|
| 🟡 OUT OF DOMAIN | Topic not related to space/astronomy |
| 🟢 RAG HIT | Found in knowledge base, answered |
| 🔴 RAG MISS | Space topic but not in our data |
- Change the topic: Replace
space_knowledge.txtindata/with your own document, update the agent identity innova.py - Tune retrieval: Adjust
kand the score threshold0.3inrag.py - Rebuild vector store: Delete the
chroma_db/folder and restart the server
| Layer | Technology |
|---|---|
| Frontend | HTML5 + CSS3 + Vanilla JS |
| Backend | Python |
| LLM | OpenAI GPT-4o-mini |
| Embeddings | text-embedding-3-small |
| Vector Store | ChromaDB (local) |
| RAG Framework | LangChain |