memory-agent
LangGraph · LightRAG · FastAPI · React 19

A RAG assistant that
remembers you and plans your learning

Most RAG demos stop at retrieve-then-answer. memory-agent routes each question to a specialised agent, keeps a three-layer memory of who you are, and turns a topic into a tracked learning roadmap — degrading gracefully when a dependency goes down.

View on GitHub Quickstart

What makes it different

Multi-agent routing

Six agents — knowledge, coding, vision, roadmap, diagnosis, general — with keyword fallbacks so intent-critical requests are never misrouted.

Graph RAG

LightRAG builds an entity/relation graph behind a REST boundary. Local, global and hybrid retrieval, with automatic fallback to plain LLM answers.

Memory that decays

Semantic similarity + character-bigram keyword coverage + importance + time decay. Re-phrased preferences collapse into one record; contradictions supersede the old one.

Roadmaps & diagnosis

Turn a topic into a validated 5–10 step plan you can tick off, then ask how you are actually doing and get strengths, weak spots and next steps.

Reflection with a way back

A quality gate retries weakly grounded answers — and returns to the originating agent instead of silently rerouting to knowledge search.

Degrade, don't crash

No vector store? Keyword retrieval. No embedding API? Redistributed weights. Every external dependency has a documented fallback path.

Architecture

Architecture: React client, FastAPI + LangGraph backend with memory_retrieval, router, six agents, reflection and memory_update; LightRAG server; SQLite memory; OpenAI-compatible LLM and embedding API

Quickstart

# 1. install
git clone https://github.com/007350/memory-agent.git
cd memory-agent && python -m venv .venv
source .venv/bin/activate          # Windows: .venv\Scripts\activate
pip install -r backend/requirements.txt
pip install "lightrag-hku[api]==1.5.6"
(cd frontend && npm install)

# 2. configure — any OpenAI-compatible LLM + embedding endpoint
cp backend/.env.example  backend/.env
cp lightrag/.env.example lightrag/.env

# 3. run
./start.sh      # Windows: start.bat
# → http://localhost:5173

Docker users: docker compose up. Full options in the README.

Evaluation

CategoryScoreWhat it checks
Simple QA10/10single-document recall
Cross-document10/10combining two sources
Multi-hop5/5chained reasoning over the graph
Unanswerable5/5refusing when the corpus has no answer

30 questions · 7 documents · retrieval hit rate 96% · average latency 27.4 s. Numbers are a regression guard, not a benchmark.