markdown
Continuum AI is a conversational AI assistant with persistent memory that never forgets. Unlike traditional chatbots that lose context after each session, Continuum remembers facts about you across conversations, automatically decays old memories (just like humans!), and retrieves relevant information using RAG (Retrieval-Augmented Generation).
| Feature | Traditional Chatbots | Continuum AI |
|---|---|---|
| Memory Across Sessions | ❌ No | ✅ Yes |
| Automatic Fact Extraction | ❌ No | ✅ Yes |
| Memory Decay (Forgetting) | ❌ No | ✅ Yes |
| Reinforcement Learning | ❌ No | ✅ Yes |
| Local LLM (No API Keys) | ❌ No | ✅ Yes |
| Persistent Storage | ❌ No | ✅ Yes |
🔗 Try it now: continuum-rag-chatbot.streamlit.app
Note: First load may take 3–5 minutes as the model downloads (~2.3GB). Subsequent loads are instant!
- Stores memories in ChromaDB vector database
- Remembers facts across multiple conversations
- Never forgets what you tell it
- Memories naturally fade over time (just like humans!)
- Configurable decay rate (λ = 0.01 to 0.5)
- Frequently accessed memories get reinforced
- Retrieves relevant memories before responding
- Uses cosine similarity for semantic search
- Top-K configurable (1–10 memories)
- Strengthens memories when accessed
strength = min(1.0, old_strength + 0.3)- Frequently discussed topics stay strong
- No API keys required
- Runs Microsoft Phi-3-mini locally
- All processing on your machine
- Dark theme with neon accents
- Real-time memory statistics
- Streaming responses
- Mobile responsive
| Component | Technology | Purpose |
|---|---|---|
| Frontend | Streamlit | Web UI framework |
| LLM | Microsoft Phi-3-mini (3.8B params) | Text generation |
| Embeddings | sentence-transformers (all-MiniLM-L6-v2) | Semantic search |
| Vector DB | ChromaDB | Persistent memory storage |
| Framework | PyTorch / Transformers | Model inference |
| Language | Python 3.10+ | Core logic |
- Python 3.10 or higher
- 8GB+ RAM (16GB recommended)
- 5GB free disk space
# 1. Clone the repository
git clone https://github.com/Junaid-Ahmed-Rupok/continuum-rag-chatbot.git
cd continuum-rag-chatbot
# 2. Create virtual environment
python -m venv venv
# 3. Activate virtual environment
# On Windows:
venv\Scripts\activate
# On Mac/Linux:
source venv/bin/activate
# 4. Install dependencies
pip install -r requirements.txt
# 5. Run the app
streamlit run app.py| Action | How To |
|---|---|
| Send message | Type in chat box → Press Enter |
| Reset all memory | Click "🗑️ Reset Memory" |
| Export memories | Click "💾 Export Memory" |
| Adjust Top-K | Settings panel → Slider |
| Change decay rate | Settings panel → Slider |
User: "Hi, my name is Alex"
Continuum: "Nice to meet you, Alex! How can I help you today?"
[Memory saved: "User's name is Alex"]
--- Next Session ---
User: "What's my name?"
Continuum: "Your name is Alex! You told me that in our previous conversation."
[Memory retrieved and reinforced]
- Reinforce important memories by discussing them frequently
- Use the export feature to back up your memories
- Adjust decay rate:
- Low (0.05): Very slow forgetting
- Medium (0.1): Default, natural forgetting
- High (0.5): Fast forgetting, short-term focus
┌─────────────────────────────────────────────────────────────┐
│ USER INTERFACE │
│ (Streamlit UI) │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ QUERY PROCESSING │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │
│ │ Decay All │→ │ Retrieve │→ │ Reinforce │ │
│ │ Memories │ │ Memories │ │ Retrieved Ones │ │
│ └─────────────┘ └─────────────┘ └─────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ MEMORY SYSTEM │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │
│ │ ChromaDB │←→│ Embeddings │←→│ Sentence │ │
│ │ Vector DB │ │ (384-dim) │ │ Transformer │ │
│ └─────────────┘ └─────────────┘ └─────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ LLM LAYER │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ Phi-3-mini (3.8B parameters) │ │
│ │ Context: System + Memories + History │ │
│ └─────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ POST PROCESSING │
│ ┌─────────────┐ ┌─────────────────────────────────────┐ │
│ │ Save to │ │ Extract Facts & Store to Memory │ │
│ │ Buffer │ │ │ │
│ └─────────────┘ └─────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
Continuum implements the Ebbinghaus Forgetting Curve:
new_strength = old_strength × e^(-λ × days_since_reinforcement)
Where:
- λ = decay rate (default: 0.1)
- days_since = time since last access
- min_strength = pruning threshold (default: 0.05)
| Days | λ=0.05 | λ=0.1 | λ=0.2 | λ=0.5 |
|---|---|---|---|---|
| 0 | 1.00 | 1.00 | 1.00 | 1.00 |
| 7 | 0.70 | 0.50 | 0.25 | 0.03 |
| 14 | 0.50 | 0.25 | 0.06 | 0.001 |
| 30 | 0.22 | 0.05 | 0.002 | 0.000 |
| Variable | Description | Default |
|---|---|---|
TOP_K |
Number of memories to retrieve | 5 |
TEMPERATURE |
LLM creativity (0.0–1.0) | 0.7 |
DECAY_LAMBDA |
Memory decay rate | 0.1 |
CONTINUUM_DATA_DIR |
Data storage location | ./continuum_data |
[theme]
base = "dark"
primaryColor = "#00e5ff"
backgroundColor = "#0a0e1a"
secondaryBackgroundColor = "#151c2c"
textColor = "#f0f3ff"python -m pytest tests/Test coverage includes:
- ✅ Directory structure validation
- ✅ ChromaDB read/write operations
- ✅ Embedding dimension verification
- ✅ Decay formula accuracy
- ✅ Top-K retrieval respect
- ✅ Reinforcement functionality
- ✅ Fact extraction accuracy
- ✅ JSON export validity
continuum-rag-chatbot/
│
├── app.py # Main Streamlit application
├── requirements.txt # Python dependencies
├── README.md # This file
├── .gitignore # Git ignore rules
│
├── .streamlit/
│ └── config.toml # Streamlit configuration
│
├── utils/
│ ├── __init__.py # Package exports
│ ├── config.py # Configuration management
│ ├── memory.py # RAGMemory core class
│ ├── conversation.py # Conversation buffer
│ └── helpers.py # Fact extraction utilities
│
└── continuum_data/ # Auto-created on first run
├── db/ # ChromaDB storage
├── exports/ # JSON exports
└── config/ # Session statistics
| Issue | Solution |
|---|---|
| Model won't load | Check internet connection, restart Streamlit |
| Slow responses | Streamlit Cloud has limited CPU — run locally for better speed |
| Memory not persisting | Check continuum_data/ folder permissions |
| Import errors | Run pip install -r requirements.txt |
| Port already in use | streamlit run app.py --server.port 8502 |
- 📧 Open an Issue
- ⭐ Star the repo for updates
- 🔔 Watch for new releases
- Persistent memory with ChromaDB
- Ebbinghaus decay curves
- Fact extraction
- Streamlit UI
- Local Phi-3-mini integration
- Multi-user support
- Memory categories/tags
- Export to CSV/PDF
- Voice input support
- Fine-tuning on user conversations
- Multi-modal support (images)
- Web search integration
- Mobile app
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
git clone https://github.com/YOUR_USERNAME/continuum-rag-chatbot.git
cd continuum-rag-chatbot
pip install -r requirements.txt
pip install black pytest
black .
pytestDistributed under the MIT License. See LICENSE for details.
- Microsoft for Phi-3-mini
- Hugging Face for the Transformers library
- ChromaDB for vector database
- Streamlit for the UI framework
- Sentence Transformers for embeddings
Junaid Ahmed Rupok
- GitHub: @Junaid-Ahmed-Rupok
- Project: continuum-rag-chatbot
- Live Demo: continuum-rag-chatbot.streamlit.app
Built with 🧠 by Junaid Ahmed Rupok
Never forget. Always remember.
⭐ If you found this helpful, give it a star on GitHub!