An intelligent, Gemini-powered Agentic RAG platform built with Streamlit.
Lumora AI is an AI-powered workspace that allows users to interact with documents, perform web searches, access live information, and get intelligent answers through an automated query-routing system.
The platform combines Retrieval-Augmented Generation (RAG), multi-query retrieval, corrective retrieval, web search, tool calling, source citations, and conversational context into a single Streamlit application.
Add your application screenshots inside the assets/ directory.
| Chat Interface | Router Inspector |
|---|---|
assets/chat.png |
assets/router-inspector.png |
| Knowledge Base | Diagnostics |
|---|---|
assets/knowledge-base.png |
assets/diagnostics.png |
- Intelligent Query Router — Automatically determines the best processing route for each user query.
- Document Q&A — Ask questions about uploaded documents using the RAG pipeline.
- Corrective RAG — Falls back to web search when retrieved information has low confidence.
- Multi-Query Retrieval — Generates multiple query variations to improve document retrieval.
- MMR Retrieval — Improves retrieval diversity while maintaining relevance.
- Gemini-based Reranking — Optionally reranks retrieved documents for better results.
- Conversation-Aware Queries — Uses previous conversation context to understand follow-up questions.
- Confidence Scoring — Evaluates retrieval relevance and answer grounding.
- Source Citations — Displays document sources and page references.
- Tool Calling — Supports a bounded ReAct-style tool execution flow.
- Real-time token streaming
- Markdown rendering
- Code blocks
- Tables
- Copy messages
- Regenerate responses
- Conversation-aware responses
- Router Inspector
- Response confidence information
- Developer diagnostics dashboard
Lumora AI can route queries to different capabilities, including:
- 📄 Document Q&A
- 🌐 Web Search
- 🌤️ Weather Information
- 💰 Financial Information
- 🧮 Calculator
- 🔀 Hybrid RAG + Web Search
- 🤖 General Knowledge
User Query
│
▼
┌────────────────────┐
│ Input Safety │
│ Screening │
└─────────┬──────────┘
│
▼
┌────────────────────┐
│ Query Router │
└─────────┬──────────┘
│
┌─────────────────┼──────────────────┐
│ │ │
▼ ▼ ▼
Document RAG Web Search External Tools
│ │ │
▼ ▼ ▼
Multi-Query + SerpAPI Weather / Finance
MMR Retrieval
│
▼
Reranking
│
▼
Corrective RAG
│
▼
Gemini Generation
│
▼
Streaming Response
+ Citations + Confidence
The query router determines whether a request should be processed through document retrieval, web search, weather, finance, hybrid retrieval, tool calling, or direct Gemini generation.
For more information about the complete architecture and retrieval pipeline, see:
docs/ARCHITECTURE.md
- Python 3.11 or 3.12
- Git
- Google Gemini API Key
git clone <this-repository-url>python -m venv venv
venv\Scripts\activatepython3 -m venv venv
source venv/bin/activatepip install -r requirements.txtCreate a .env file based on .env.example.
GEMINI_API_KEY=your-gemini-api-keyOptional API keys:
SERPAPI_API_KEY=your-serpapi-api-key
OPENWEATHER_API_KEY=your-openweather-api-key
ALPHA_VANTAGE_API_KEY=your-alpha-vantage-api-keystreamlit run main.pyLumora AI will start using Streamlit's local development server.
Lumora AI can be deployed using Streamlit Community Cloud.
Push your project to GitHub.
Make sure your .env file is included in .gitignore and is never committed to the repository.
Create a new application and select your GitHub repository.
Set the main application file to:
main.py
Add your API keys in the Streamlit application's Secrets section.
Example:
GEMINI_API_KEY = "your-gemini-api-key"
SERPAPI_API_KEY = "your-serpapi-api-key"
OPENWEATHER_API_KEY = "your-openweather-api-key"
ALPHA_VANTAGE_API_KEY = "your-alpha-vantage-api-key"The application automatically reads the configured secrets and uses them during runtime.
Streamlit Community Cloud uses an ephemeral filesystem.
Therefore, the local ChromaDB vector store:
data/vector_store/
may not persist across application restarts or redeployments.
If persistent document storage is required, use an external or hosted vector database.
Lumora AI can also run in any environment capable of running Streamlit and the required Python dependencies.
The environment should provide:
GEMINI_API_KEY=your-gemini-api-keyFor persistent ChromaDB storage, mount a persistent volume to:
data/vector_store
| Layer | Technology |
|---|---|
| LLM | Google Gemini |
| Framework | LangChain |
| RAG | LangChain + ChromaDB |
| Vector Database | ChromaDB |
| Embeddings | Gemini Embeddings |
| Web Search | SerpAPI |
| Weather | OpenWeatherMap |
| Finance | Alpha Vantage |
| Frontend | Streamlit |
| Language | Python 3.11+ |
| Configuration | .env / Streamlit Secrets |
Lumora-AI/
│
├── main.py # Streamlit application entry point
├── requirements.txt # Python dependencies
├── .env.example # Environment variable template
│
├── .streamlit/
│ └── config.toml # Streamlit configuration
│
├── config/
│ ├── settings.py # Application settings
│ ├── model_config.py # Model configuration
│ └── logging.py # Logging configuration
│
├── prompts/ # AI and router prompt templates
│
├── src/
│ ├── api/ # API schemas and orchestration
│ ├── llm/ # Gemini client and response handling
│ ├── rag/ # Chunking, embeddings and retrieval
│ ├── routing/ # Query routing logic
│ ├── security/ # Security and validation
│ ├── tools/ # Calculator, weather, finance, web search
│ ├── utils/ # Utility functions
│ └── examples/ # Example implementations
│
├── ui/
│ ├── theme.py # UI theme
│ └── components.py # Reusable UI components
│
├── tests/ # Automated tests
│
├── docs/
│ └── ARCHITECTURE.md # Architecture documentation
│
├── assets/ # Application screenshots
│
└── data/
└── vector_store/ # ChromaDB vector storage
Run the test suite with:
pytest tests/ -qThe tests mock external services such as:
- Gemini
- Weather API
- Finance API
- Web Search API
Therefore, API keys and external network access are not required for the mocked test suite.
Lumora AI follows several security practices:
- API keys are never stored directly in source code.
.envis excluded through.gitignore..env.examplecontains only placeholder values.- Streamlit Cloud secrets are stored through the platform's Secrets manager.
- User input is checked for potential prompt injection.
- Uploaded files are validated before ingestion.
- File size and type restrictions are applied.
- Requests are rate-limited per session.
- AI safety controls are applied to model interactions.
Planned improvements for Lumora AI include:
- Hosted vector database support
- Persistent document storage across deployments
- More advanced multi-step tool execution
- Additional external tools
- Message editing and sharing
- Conversation export
- Suggested prompts
- Keyboard shortcuts
- Advanced cross-encoder reranking
- Improved document management
- Additional AI models and providers
Lumora AI demonstrates the implementation of a production-oriented Agentic RAG architecture with:
- Intelligent query routing
- Retrieval-Augmented Generation
- Multi-query retrieval
- Maximum Marginal Relevance (MMR)
- Corrective RAG
- Conversational query understanding
- Tool calling
- Web search integration
- Source citations
- Confidence evaluation
- Real-time LLM streaming
- Streamlit-based custom UI
- Security and input validation
Lov Kumar
Built with using Python, Streamlit, LangChain, ChromaDB, and Google Gemini.