How mrunalg141/eco-biodiversity-rag works
ECO provides two user-facing workflows: PDF-grounded document Q&A and evidence-based environmental recommendations, including a biodiversity clarification exchange and a structured-input endpoint. The browser calls the FastAPI routes; the application delegates retrieval, recommendation generation, and persistence to separate modules. PDF ingestion and category-scoped environmental retrieval are distinct indexing/retrieval stages. The README documents the five-category knowledge base and source-cited structured results. Source excerpts do not show the deployed index build process end to end, so the knowledge-base builder is shown separately; the documented Groq and Chroma integrations are included.
Main entry points: main.py FastAPI routes · llm.py Environmental advice · rag.py PDF retrieval · database.py Chat database
Components 15
Chat interface
- Chat browser
static/script.js - Chat page
templates/index.html
Application workflows
- FastAPI routes
app/main.py - PDF ingestion
app/main.py - Chat routing
app/main.py - Document answers
app/llm.py - Environmental advice
app/llm.py
Knowledge retrieval
- PDF retrieval
app/rag.py - Category retrieval
app/rag.py - Knowledge indexing
script/knowledgebase.py - Knowledge PDFs
knowledge_base
State and services
- Chat database
app/database.py - Chroma collections
app/rag.py
Other components
- User
- Groq LLM API
Connections 23
- User → Chat browser: uses
- Chat browser → FastAPI routes: calls routes
- FastAPI routes → Chat page: renders page
- FastAPI routes → Chat database: loads history
- FastAPI routes → PDF ingestion: handles upload
- PDF ingestion → PDF retrieval: indexes PDF
- PDF ingestion → Chat database: saves document
- Chat browser → FastAPI routes: sends chat
- FastAPI routes → Chat routing: routes message
- Chat routing → Document answers: answers general query
- Document answers → PDF retrieval: retrieves context
- Chat routing → Environmental advice: requests recommendation
- FastAPI routes → Environmental advice: submits structured input
- Environmental advice → Category retrieval: retrieves categories
- Document answers → Groq LLM API: generates answer
- Environmental advice → Groq LLM API: generates recommendation
- Chat routing → Chat database: saves exchange
- PDF retrieval → Chroma collections: queries or indexes
- Category retrieval → Chroma collections: queries categories
- Knowledge indexing → Knowledge PDFs: reads PDFs
- Knowledge indexing → Chroma collections: indexes categories
- FastAPI routes → Chat database: clears history
- FastAPI routes → PDF retrieval: clears uploaded index