Cognis: Context-Aware Memory for Conversational AI Agents
Organizations: Lyzr Research
Abstract
LLM agents lack persistent memory, causing conversations to reset each session and preventing personalization over time. We present Lyzr Cognis, a unified memory architecture for conversational AI agents that addresses this limitation through a multi-stage retrieval pipeline. Cognis combines a dual-store backend pairing OpenSearch BM25 keyword matching with Matryoshka vector similarity search, fused via Reciprocal Rank Fusion. Its context-aware ingestion pipeline retrieves existing memories before extraction, enabling intelligent version tracking that preserves full memory history while keeping the store consistent. Temporal boosting enhances time-sensitive queries, and a BGE-2 cross-encoder reranker refines final result quality. We evaluate Cognis on two independent benchmarks -- LoCoMo and LongMemEval -- across eight answer generation models, demonstrating state-of-the-art performance on both. The system is open-source and deployed in production serving conversational AI applications.
Figures & tables
| Store | Data Type | Purpose |
|---|---|---|
| OpenSearch | Documents | Primary store for memories and messages, native BM25 search with configurable text analysis, version history tracking |
| VDB | Vectors (768D + 256D) | Matryoshka semantic search with dual-dimension collections |
| Collection | Dimension | Purpose |
|---|---|---|
| *_768d | 768D | Memory embeddings for accurate semantic retrieval |
| *_256d | 256D | Memory embeddings for fast shortlisting (200 candidates) |
| immediate_recall_256d | 256D | Raw message embeddings for immediate recall queries |
| Operation | When Applied |
|---|---|
| ADD | New information not present in existing memories |
| UPDATE | New information supersedes or refines an existing memory (includes replaces_id to link versions) |
| DELETE | New information explicitly contradicts or invalidates an existing memory |
| NONE | Information is a duplicate or not worth storing (e.g., small talk) |
| Single-Hop | Multi-Hop | Open-Domain | Temporal | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Method | F1 | B1 | J | F1 | B1 | J | F1 | B1 | J | F1 | B1 | J |
| LoCoMo | 25.02 | 19.75 | – | 12.04 | 11.16 | – | 40.36 | 29.05 | – | 18.41 | 14.77 | – |
| ReadAgent | 9.15 | 6.48 | – | 5.31 | 5.12 | – | 9.67 | 7.66 | – | 12.60 | 8.87 | – |
| MemoryBank | 5.00 | 4.77 | – | 5.56 | 5.94 | – | 6.61 | 5.16 | – | 9.68 | 6.99 | – |
| MemGPT | 26.65 | 17.72 | – | 9.15 | 7.44 | – | 41.04 | 34.34 | – | 25.52 | 19.44 | – |
| A-Mem | 27.02 | 20.09 | – | 12.14 | 12.00 | – | 44.65 | 37.06 | – | 45.85 | 36.67 | – |
| Single-Hop | Multi-Hop | Open-Domain | Temporal | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Embedding Model | F1 | B1 | J | F1 | B1 | J | F1 | B1 | J | F1 | B1 | J |
| Nomic Embed | 50.23 | 41.26 | 69.15 | 29.02 | 21.17 | 52.08 | 50.72 | 41.48 | 68.61 | 60.48 | 52.69 | 72.59 |
| Gemma Embed | 40.94 | 30.88 | 71.88 | 23.22 | 14.72 | 69.23 | 44.85 | 33.37 | 58.33 | 54.01 | 42.46 | 70.27 |
| Nomic V2 | 42.38 | 31.42 | 65.96 | 30.31 | 23.71 | 50.00 | 51.67 | 42.44 | 68.12 | 58.54 | 51.23 | 73.21 |
| Jina V3 | 41.42 | 30.10 | 65.25 | 30.41 | 22.81 | 52.08 | 48.66 | 40.19 | 67.18 | 59.37 | 51.85 | 74.77 |
| Single-Hop | Multi-Hop | Open-Domain | Temporal | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Configuration | F1 | B1 | J | F1 | B1 | J | F1 | B1 | J | F1 | B1 | J |
| BGE-2 Reranker (MongoDB) | 45.33 | 33.96 | 70.21 | 30.55 | 23.69 | 51.04 | 53.76 | 44.65 | 71.34 | 60.86 | 53.43 | 76.64 |
| Zero Entropy Reranker | 45.95 | 34.86 | 68.23 | 27.50 | 20.75 | 46.97 | 52.11 | 43.98 | 69.59 | 59.73 | 58.76 | 76.17 |
| LLM Query Decomposition | 44.73 | 34.86 | 69.52 | 29.50 | 21.09 | 50.79 | 46.11 | 37.73 | 68.45 | 60.75 | 57.65 | 77.15 |
| BGE-2 + OpenSearch | 48.66 | 35.76 | 71.99 | 31.51 | 23.22 | 51.04 | 54.77 | 45.12 | 85.85 | 62.68 | 58.95 | 77.26 |
| Single-Hop | Multi-Hop | Open-Domain | Temporal | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Config (Vec/BM25) | F1 | B1 | J | F1 | B1 | J | F1 | B1 | J | F1 | B1 | J |
| 70/30 | 48.66 | 35.76 | 71.99 | 31.51 | 23.22 | 51.04 | 54.77 | 45.12 | 85.85 | 62.68 | 58.95 | 77.26 |
| 75/25 | 49.94 | 36.84 | 72.53 | 30.82 | 22.43 | 50.17 | 55.21 | 46.92 | 86.11 | 62.11 | 58.84 | 77.26 |
| 80/20 | 49.82 | 36.41 | 72.08 | 29.87 | 22.04 | 49.62 | 55.34 | 46.08 | 86.74 | 61.21 | 57.33 | 74.94 |
| 60/40 | 49.11 | 35.94 | 71.88 | 28.63 | 20.71 | 48.37 | 55.02 | 45.96 | 86.28 | 60.73 | 55.82 | 74.41 |
| 50/50 | 49.44 | 36.08 | 70.11 | 27.18 | 19.44 | 45.72 | 52.18 | 40.63 | 83.02 | 60.58 | 55.91 | 74.08 |
| Question Type | Accuracy | Hit@K | MRR | NDCG |
|---|---|---|---|---|
| SS-User | 100.0% | 0.91 | 0.88 | 0.87 |
| SS-Preference | 93.3% | 0.97 | 0.64 | 0.67 |
| Knowledge Update | 92.3% | 0.94 | 0.75 | 0.79 |
| SS-Assistant | 87.5% | 0.96 | 0.88 | 0.89 |
| Multi-Session | 86.5% | 0.68 | 0.43 | 0.48 |
| Temporal Reasoning | 84.2% | 0.80 | 0.53 | 0.57 |
| Question Type | Zep/Graphiti | SuperMemory | Cognis |
|---|---|---|---|
| SS-User | 92.9 | 97.1 | 100.0 |
| SS-Assistant | 80.4 | 96.4 | 92.9 |
| SS-Preference | 56.7 | 70.0 | 93.3 |
| Knowledge Update | 83.3 | 88.5 | 96.2 |
| Temporal Reasoning | 62.4 | 76.7 | 92.5 |
| Multi-Session | 57.9 | 71.4 | 87.2 |
| Answer Model | SS-User | SS-Asst | SS-Pref | Know. Upd | Temporal | Multi-Sess | OVERALL |
|---|---|---|---|---|---|---|---|
| Gemini 3 Flash | 97.1 | 80.4 | 50.0 | 92.3 | 85.0 | 78.2 | 83.4 |
| GPT-4o | 97.1 | 71.4 | 93.3 | 93.6 | 85.0 | 78.2 | 85.2 |
| Claude Haiku 4.5 | 95.7 | 85.7 | 80.0 | 85.9 | 85.7 | 80.5 | 85.4 |
| GPT-4.1 | 100.0 | 87.5 | 93.3 | 93.6 | 82.7 | 79.7 | 87.2 |
| GPT-5-mini | 98.6 | 87.5 | 90.0 | 89.7 | 90.2 | 83.5 | 89.2 |
| Claude Sonnet 4.6 | 100.0 | 89.3 | 86.7 | 93.6 | 88.0 | 85.7 | 90.0 |
| Method | p50 | p95 | p99 | Mean |
|---|---|---|---|---|
| Cognis | 0.250s | 0.451s | 0.770s | 0.390s |
Agent Memory Management
Agent memory management studies how AI agents store, update, retrieve, compress, and forget information across long-running tasks.
See all 446 papers