๐ง Memoria โ AI Memory Intelligence System
An intelligent memory orchestration layer for AI assistants โ without retraining the model.
๐ธ Screenshots
### ๐ฅ๏ธ Main Dashboard โ 3-Panel Layout
### ๐ฌ Chat with Memory Retrieval & Explainable AI
### ๐ก Backend API Documentation (FastAPI + Swagger)
๐ฏ What is Memoria?
Memoria is a full-stack AI Memory Intelligence System that gives any LLM a persistent, intelligent memory. Instead of retraining models, it:
- ๐ง Stores memories with semantic embeddings across 5 memory types
- ๐ Retrieves relevant memories using hybrid search (vector + keyword + metadata)
- ๐ Ranks memories with a multi-factor scoring system
- ๐ Injects only the best memories into LLM prompts
- ๐ก Explains exactly why each memory was selected
Think of it as "ChatGPT with a brain-like adaptive memory system."
โจ Key Features
| ### ๐ฎ Memory Engine - **5 memory types**: `preference` ยท `long_term` ยท `session` ยท `episodic` ยท `semantic` - **Conflict resolution**: auto-detects contradictions, prioritizes recent truth - **Feedback loop**: ๐/๐ voting updates future ranking scores | ### ๐ฏ Hybrid Retrieval - Semantic vector search via **Qdrant** - Keyword overlap matching - Metadata filtering by type - Configurable top-K selection |
| ### ๐ Intelligent Ranking ``` final_score = 0.45 ร semantic_similarity + 0.20 ร recency + 0.15 ร importance + 0.10 ร feedback_score + 0.10 ร contextual_match ``` | ### ๐งช Explainable AI Every retrieved memory comes with: - โ Similarity percentage - ๐ Score breakdown (5 factors) - ๐ฌ Human-readable reasons - ๐ Rank position |
| ### ๐ Premium UI Futuristic 3-panel dark theme ยท Glassmorphism & glow effects ยท Smooth Framer Motion animations ยท Real-time streaming responses ยท Live latency sparklines & system metrics |
๐๏ธ Architecture
โโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ
โ โ โ FastAPI Backend โ โ โ
โ React + Vite โโโโถโ Memory Engine โ Ranking โ Compression โโโโถโ Qdrant DB โ
โ + TailwindCSS โ โ Conflict Resolver โ Explanation Engine โ โ (Vectors) โ
โ + Framer โโโโโ LLM Service (OpenAI-compatible + Mock) โ โ โ
โ โ โ โ โ โ
โโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโ
โ sentence- โ
โ transformers โ
โ BAAI/bge-small โ
โโโโโโโโโโโโโโโโโโโโ
๐ Quick Start
Prerequisites
- Python 3.10+
- Node.js 18+
- (Optional) Docker for Qdrant server
Backend Setup
cd backend
# Create virtual environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Copy environment file
cp .env.example .env
# Edit .env to add your OpenAI API key (optional โ mock mode works without it)
# Start the server
uvicorn app.main:app --reload --port 8000
โก First startup downloads the embedding model (~130MB) โ takes ~30 seconds. After that, startup is fast.
Frontend Setup
cd frontend
# Install dependencies
npm install
# Start dev server
npm run dev
Open http://localhost:5173 โ you're ready! ๐
๐ Live Demo
| Service | URL | Status |
|---|---|---|
| ๐ Frontend | memoria-ai-memory-intelligence.vercel.app | |
| ๐ก Backend API | memoria-ai-backend.hf.space |
๐ Environment Variables
| Variable | Default | Description |
|---|---|---|
OPENAI_API_KEY |
sk-mock-key |
OpenAI API key (mock mode if not set) |
OPENAI_MODEL |
gpt-4o-mini |
LLM model name |
QDRANT_MODE |
memory |
memory (in-process) or server (Docker) |
EMBEDDING_MODEL |
BAAI/bge-small-en-v1.5 |
Sentence transformer model |
๐ก API Endpoints
| Method | Endpoint | Description |
|---|---|---|
POST |
/chat |
Send message, get memory-augmented response |
POST |
/chat/stream |
Same as above, but streaming (SSE) |
POST |
/memory/store |
Store a new memory |
GET |
/memory/search?query=... |
Search memories by query |
GET |
/memory/all |
List all stored memories |
POST |
/memory/feedback |
Submit ๐/๐ feedback |
GET |
/metrics |
System metrics for dashboard |
GET |
/health |
Health check endpoint |
๐ก Full interactive API docs available at
/docs
๐ ๏ธ Tech Stack
| Layer | Technology |
|---|---|
| Frontend | React, TypeScript, Vite, TailwindCSS v4, Framer Motion, shadcn/ui, Lucide Icons |
| Backend | FastAPI, Python, Pydantic v2, SSE Streaming |
| Vector DB | Qdrant (in-memory or server mode) |
| Embeddings | sentence-transformers (BAAI/bge-small-en-v1.5, 384-dim) |
| LLM | OpenAI-compatible API (with mock fallback) |
| Deployment | Vercel (Frontend) ยท HuggingFace Spaces (Backend) ยท Docker |
๐ Project Structure
memoria/
โโโ frontend/ # React + Vite + TailwindCSS
โ โโโ src/
โ โ โโโ components/
โ โ โ โโโ chat/ # Neural Chat panel
โ โ โ โโโ memory/ # Memory Bank timeline
โ โ โ โโโ dashboard/ # Intelligence metrics panel
โ โ โ โโโ ui/ # Reusable UI components (shadcn)
โ โ โโโ hooks/ # Custom React hooks
โ โ โโโ lib/ # Utility functions
โ โ โโโ App.tsx # Main 3-panel layout
โ โโโ package.json
โโโ backend/ # FastAPI + Python
โ โโโ app/
โ โ โโโ main.py # App entry point + CORS
โ โ โโโ config.py # Environment configuration
โ โ โโโ routes/ # API route handlers
โ โ โโโ services/ # Business logic (memory, LLM, ranking)
โ โ โโโ models/ # Pydantic schemas
โ โ โโโ database/ # Qdrant vector store
โ โโโ requirements.txt
โโโ Dockerfile # Backend container
โโโ docker-compose.yml # Full stack orchestration
โโโ README.md
๐ Built for Hackathon
This project is designed to be demo-friendly:
- โก Zero config โ Works out of the box with in-memory Qdrant and mock LLM
- ๐ฆ Pre-seeded โ Comes with 15 sample memories across all categories
- ๐๏ธ Visual โ Every feature is visible in the UI โ no hidden functionality
- ๐ง Explainable โ Shows exactly how the AI makes memory decisions
- ๐ Deployed โ Live on Vercel + HuggingFace Spaces
๐ค Contributing
Contributions are welcome! Feel free to open issues or submit pull requests.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
๐ License
Distributed under the MIT License. See LICENSE for more information.
**Built with โค๏ธ for the Hackathon** โญ Star this repo if you found it useful!
Built With
- css
- dockerfile
- html
- javascript
- python
- typescript
Log in or sign up for Devpost to join the conversation.