https://github.com/moleculeprotocol/mira-ai-prototype-v0
Ask anything about DeSci & Molecule! Smart chatbot with local knowledge + web search fallback
https://github.com/moleculeprotocol/mira-ai-prototype-v0
agentic-rag ai ai-assistant chatbot desci lancedb rag retrieval-augmented-generation web3
Last synced: about 1 month ago
JSON representation
Ask anything about DeSci & Molecule! Smart chatbot with local knowledge + web search fallback
- Host: GitHub
- URL: https://github.com/moleculeprotocol/mira-ai-prototype-v0
- Owner: moleculeprotocol
- Created: 2025-07-23T12:44:01.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-08-19T09:39:55.000Z (about 2 months ago)
- Last Synced: 2025-08-19T11:39:04.869Z (about 2 months ago)
- Topics: agentic-rag, ai, ai-assistant, chatbot, desci, lancedb, rag, retrieval-augmented-generation, web3
- Language: Python
- Homepage: https://mira.molecule.xyz
- Size: 19.7 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MIRA v0 Prototype π§¬
## AI-Powered Knowledge Assistant for DeSci & Molecule
MIRA (Molecule Insights Research Assistant) is an experimental prototype that demonstrates how modern AI can intelligently provide accurate information about decentralized science (DeSci) and Molecule's ecosystem.
## π― What is MIRA?
MIRA is a smart chatbot that can answer questions about **anything related to Molecule and the DeSci ecosystem**. This includes, but is not limited to:
- **DeSci (Decentralized Science)** - The movement to make scientific research more open and accessible
- **Molecule Platform** - All features, products, and services offered by Molecule
- **IP-NFTs** - Tokenizing intellectual property and research assets
- **Research Funding** - Grants, investments, and new funding mechanisms
- **DAOs & Governance** - BioDAOs, VitaDAO, and decentralized organizations
- **DeSci Tools** - Various tools and protocols in the ecosystem
- **Community & Events** - DeSci conferences, initiatives, and collaborations
- **And much more!** - Any topic connected to Molecule's mission and the broader DeSci movement### Key Features
- **π€ Smart Decision Making**: MIRA decides on its own whether it has enough information to answer your question
- **π Local Knowledge Base**: Contains curated information about Molecule and DeSci
- **π Web Search Fallback**: Automatically searches the web when local knowledge isn't enough
- **ππ Feedback System**: Help improve MIRA by rating responses
- **π Source Transparency**: Always shows where information comes from## ποΈ How It Works
MIRA uses a three-step intelligent process called "Agentic RAG" (Retrieval Augmented Generation):
### 1. **Search Local Knowledge**
When you ask a question, MIRA first searches its local knowledge base for relevant information using advanced semantic search that understands meaning, not just keywords.### 2. **Evaluate & Decide**
MIRA then evaluates the information it found:
- **Sufficient Context?** β Use local knowledge to answer
- **Insufficient but Relevant?** β Search the web for current information
- **Off-topic?** β Politely decline with an explanation### 3. **Generate Response**
Based on its decision, MIRA either:
- Provides an answer from trusted local sources
- Searches the web for up-to-date information (focusing on trusted domains)
- Explains that the question is outside its expertise## π οΈ Technology Stack
MIRA combines several technologies:
### **Chainlit** (User Interface)
- Responsive chat interface
- Real-time streaming responses
- Interactive feedback buttons### **LanceDB** (Knowledge Storage)
- **Vector Search**: Finds information by meaning and context
- **Hybrid Search**: Combines semantic understanding with keyword matching
- **Fast & Efficient**: Delivers relevant results quickly### **OpenAI GPT-4o** (AI Brain)
- Understands natural language questions
- Evaluates context quality
- Generates human-like responses
- Web search capabilities for current information### **Langfuse** (Monitoring & Analytics)
- Tracks system performance
- Collects user feedback
- Helps improve responses over time
- Ensures quality and reliability## π The Workflow
Here's how MIRA processes your questions:
```
βββββββββββββββββββββββ
β User Question β
ββββββββββββ¬βββββββββββ
β
βΌ
βββββββββββββββββββββββ
β Search Local β
β Knowledge Base β
β (LanceDB) β
ββββββββββββ¬βββββββββββ
β
βΌ
βββββββββββββββββββββββ
β Evaluate Context β
β Is it sufficient? β
ββββββββββββ¬βββββββββββ
β
ββββββββ΄βββββββ¬ββββββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββ βββββββββββ βββββββββββ
β Yes β β No, β β No & β
β β β but β β Off- β
β Local β βRelevant β β topic β
β Answer β β β β β
βββββββββββ β Web β βββββββββββ
β Search β
β (GPT-4o)β
βββββββββββ
β
βββββββββββββ΄ββββββββββββββ
β β
βΌ βΌ
βββββββββββββββββββββββ βββββββββββββββββββββββ
β Generate Answer β β "Sorry, I can't β
β with Sources β β help with that" β
ββββββββββββ¬βββββββββββ ββββββββββββ¬βββββββββββ
β β
βββββββββββββ¬ββββββββββββ
β
βΌ
βββββββββββββββββββββββ
β Display Answer β
β π π β
βββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββ
β Langfuse Monitoring β
β (Track & Improve) β
βββββββββββββββββββββββ
```### The Decision Process Explained:
1. **You ask a question** β MIRA receives your query
2. **Searches local knowledge** β Uses LanceDB's semantic search to find relevant information
3. **Makes a smart decision**:
- β **Sufficient info?** β Answers from local knowledge
- π **Not enough but relevant?** β Searches the web for current info
- β **Off-topic?** β Politely declines
4. **Generates response** β Creates a helpful answer with sources
5. **You rate the answer** β Helps MIRA improve over time## π Getting Started
### Prerequisites
- Python 3.8 or higher
- Virtual environment (recommended)### Installation
1. **Clone the repository**
```bash
git clone [repository-url]
cd molecule-chainlit
```2. **Create and activate virtual environment**
```bash
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
```3. **Install dependencies**
```bash
pip install -r requirements.txt
```4. **Set up environment variables**
Create a `.env` file with:
```
OPENAI_API_KEY=your_openai_api_key
LANGFUSE_PUBLIC_KEY=your_langfuse_public_key
LANGFUSE_SECRET_KEY=your_langfuse_secret_key
```5. **Run the application**
```bash
chainlit run app.py
```6. **Open your browser**
Navigate to `http://localhost:8000`## β οΈ Important Notes
### This is a Prototype
- MIRA v0 is an **experimental prototype**, not a production-ready application
- Used for learning about robust AI systems and gathering user feedback
- Responses should be verified for critical decisions### Data Sources
- Local knowledge base contains curated information about Molecule and DeSci
- Web search results are filtered to prioritize trusted domains like:
- molecule.to
- molecule.xyz
- bio.xyz
- vitadao.com
- ...