How eniline/agent_memory works
This is a long-term-memory conversational agent: it extracts dated facts from conversation sessions, embeds and indexes them, retrieves relevant memories for each question, and generates a concise answer. The evaluation workflow runs agents over QA sets, then uses an LLM judge and metrics; documented experiment branches compare baselines, model-effect features, and memory-writing granularities. The graph follows documented and indexed references; several experiment and evaluation implementations were not excerpted, so their internal links are limited to documented relationships.
Main entry points: agent/controller.py Memory agent · llm_client.py LLM client · retriever.py Memory retrieval · model_effect/controller.py Model-effect agent
Components 21
Agent workflow
- Memory agent
agent/controller.py - LLM client
eval/llm_client.py - Generated answer
agent/controller.py
Memory subsystem
- Fact extraction
memory/writer.py - FAISS memory store
memory/store.py - Memory retrieval
memory/retriever.py - Memory deduplication
memory/updater.py
Evaluation
- Generation runner
eval/run_generation.py - LLM-as-Judge
eval/run_judge.py - F1 and EM
eval/metrics.py
Experiments
- Agent baselines
experiments/baseline/baselines.py - Model-effect agent
experiments/model_effect/controller.py - Memory reflection
experiments/model_effect/reflector.py - Write-granularity agents
experiments/write_granularity/per_session.py - Topic segmentation
experiments/write_granularity/segmenter.py
Other components
- Conversation sessions
- QA questions
- Embedding model
- Ollama generation
- Sentence embeddings
- DeepSeek Judge API
Connections 32
- Generation runner → Memory agent: loads agent
README.md - Generation runner → Conversation sessions: loads sessions
README.md - Generation runner → QA questions: runs questions
README.md - Memory agent → Fact extraction: extracts facts
agent/controller.py - Fact extraction → LLM client: requests extraction
memory/writer.py - LLM client → Ollama generation: calls generation
eval/llm_client.py - Memory agent → Embedding model: encodes facts
agent/controller.py - Embedding model → Sentence embeddings: uses model
README.md - Memory agent → FAISS memory store: stores vectors
agent/controller.py - Memory agent → Memory retrieval: initializes retriever
agent/controller.py - Memory retrieval → Embedding model: encodes query
memory/retriever.py - Memory retrieval → FAISS memory store: searches memories
memory/retriever.py - Memory agent → Memory retrieval: retrieves memories
agent/controller.py - Memory agent → LLM client: generates answer
agent/controller.py - LLM client → Generated answer: returns response
agent/controller.py - Memory agent → Generated answer: returns answer
agent/controller.py - Generation runner → LLM-as-Judge: evaluates results
README.md - LLM-as-Judge → LLM client: requests judgments
eval/run_judge.py - LLM client → DeepSeek Judge API: calls judge API
eval/llm_client.py - LLM-as-Judge → F1 and EM: computes metrics
eval/run_judge.py - Agent baselines → LLM client: uses client
experiments/baseline/baselines.py - Model-effect agent → Memory reflection: optionally reflects
experiments/model_effect/controller.py - Model-effect agent → Fact extraction: extracts facts
experiments/model_effect/controller.py - Model-effect agent → FAISS memory store: stores memories
experiments/model_effect/controller.py - Model-effect agent → Memory retrieval: retrieves memories
experiments/model_effect/controller.py - Model-effect agent → Memory deduplication: deduplicates memories
experiments/model_effect/controller.py - Memory reflection → LLM client: requests reflection
experiments/model_effect/reflector.py - Write-granularity agents → Fact extraction: extracts by segment
experiments/write_granularity/per_session.py - Write-granularity agents → FAISS memory store: stores facts
experiments/write_granularity/per_session.py - Write-granularity agents → Memory retrieval: retrieves memories
experiments/write_granularity/per_session.py - Write-granularity agents → Memory deduplication: deduplicates memories
experiments/write_granularity/per_session.py - Write-granularity agents → Topic segmentation: optionally segments topics
README.md