memorybridge / README.md
kimandrew927's picture
pin all dependencies, update sdk_version to 6.14.0
3280336
---
title: MemoryBridge AAC
emoji: 🧠
colorFrom: blue
colorTo: purple
sdk: gradio
sdk_version: "6.14.0"
python_version: "3.10"
app_file: app.py
pinned: false
---
# MemoryBridge
Assistive AAC communication system for people with cerebral palsy and other motor/speech disabilities. Generates personalized, contextually relevant candidate responses by fusing text retrieval (knowledge graphs + semantic search) with real-time vision signals (gestures, affect, air-sign letters).
## Architecture
```
Partner Query
β”‚
β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ PARALLEL EXECUTION BLOCK β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ TEXT PATH β”‚ β”‚ VISION PATH β”‚ β”‚
β”‚ β”‚ Intent β†’ Router β”‚ β”‚ MediaPipe Loop β”‚ β”‚
β”‚ β”‚ KG + FAISS β”‚ β”‚ Signal Buffer β”‚ β”‚
β”‚ β”‚ Reranker β”‚ β”‚ β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚ β–Ό β”‚
β”‚ WEIGHTED FUSION LAYER β”‚
β”‚ (CoT reasoning, Qwen3-32B) β”‚
β”‚ β”‚ β”‚
β”‚ β–Ό β”‚
β”‚ RESPONSE GENERATION β”‚
β”‚ 3 candidates + 1 turnaround β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
```
**Latency target**: < 5 seconds to first token.
## Quickstart
```bash
# 1. Clone and install
pip install -r requirements.txt
# 2. Set up API keys
cp .env.example .env
# edit .env with your keys
# 3. Build persona data (one-time)
python scripts/build_persona.py --persona alex_rivera
python scripts/build_kg.py --persona alex_rivera
python scripts/build_faiss.py --persona alex_rivera
# 4. Launch UI
python -m memorybridge.ui.gradio_app
# 5. Run evaluation
python scripts/run_eval.py --mode S3
```
## Configuration
All models and thresholds are configurable in `config/settings.yaml`. Swap any model (including provider) with zero code changes:
```yaml
generation:
provider: "anthropic" # groq | together | openai | anthropic | ollama
model: "claude-sonnet-4-6-20250514"
```
## Project Structure
```
memorybridge/
β”œβ”€β”€ config/ # settings.yaml + persona configs
β”œβ”€β”€ core/ # pipeline orchestrator, model registry, schemas
β”œβ”€β”€ text_path/ # intent decomposition, KG + FAISS retrieval, reranking
β”œβ”€β”€ vision_path/ # gesture, affect, air-sign detection, signal buffer
β”œβ”€β”€ fusion/ # weighted fusion with CoT reasoning
β”œβ”€β”€ generation/ # response generation, prompt builder, style scorer
β”œβ”€β”€ feedback/ # learning from user selections
β”œβ”€β”€ memory/ # profile loader, KG/FAISS builders, conversation history
β”œβ”€β”€ data/ # persona content, indices, knowledge graphs
β”œβ”€β”€ evaluation/ # RAGAS eval, latency tracking, ablation study
β”œβ”€β”€ ui/ # Gradio interface with gaze selection
└── scripts/ # build and evaluation CLI scripts
```
## Personas
- **Alex Rivera** (deep persona): 34, Buffalo NY, spastic diplegia CP, Bills fan
- **Persona 2 / 3**: Shallow personas for generalizability testing
## Evaluation
Three ablation conditions:
- **S1** β€” No retrieval (baseline)
- **S2** β€” Profile-only retrieval
- **S3** β€” Full system (KG + FAISS + vision fusion)
Metrics: RAGAS groundedness/faithfulness, E2E latency, gesture-response alignment.