Summary
memu-py 0.1.8 on PyPI still ships the old memu.server + RecallAgent architecture that was removed in the v1.5.0 refactor (#81, commit 4a2e86c). Users who pip install memu-py and run python -m memu.server.cli start get a server that cannot retrieve any memories.
Related: #60, #8
Root Cause
The old RecallAgent.retrieve_relevant_memories() reads from a file-system memory_dir ({memory_dir}/{agent_id}/{user_id}/*_embeddings.json), but MemoryAgent.run() writes to PostgreSQL (memory_items table with pgvector embeddings). The read and write paths are completely disconnected.
Additionally, cli.py hard-exits if OPENAI_API_KEY is not set, even though the embedding data is already stored in PG and does not require OpenAI for retrieval.
Diagnosis
# PG has data:
SELECT count(*) FROM memory_items; -- 326 rows, all with embedding vectors
# But API returns nothing:
POST /api/v1/memory/retrieve/related-memory-items
{"query": "test", "user_id": "boris", "top_k": 5}
→ {"related_memories": [], "total_found": 0}
Why: RecallAgent initializes MemoryFileManager pointing at a file directory that is empty. It never touches PG.
Our Workaround
We patched memory_service.py to bypass RecallAgent entirely and query PG pgvector directly:
# In retrieve_related_memory_items():
# 1. Embed query with local bge-m3 (1024-dim, matching stored vectors)
# 2. Query PG directly:
SELECT id, summary, memory_type, created_at,
1 - (embedding <=> $query_vec::vector) AS similarity
FROM memory_items
WHERE user_id = $user_id
AND 1 - (embedding <=> $query_vec::vector) >= $min_similarity
ORDER BY embedding <=> $query_vec::vector
LIMIT $top_k
This returns correct results immediately.
Suggestion
- Short term: Publish a new PyPI release that either (a) removes the deprecated
memu.server package, or (b) updates it to use the new src/memu/app/retrieve.py workflow
- Long term: The v1.5.x architecture looks correct — just needs a PyPI release. Note: v1.5.x requires Python ≥3.13, which blocks users on 3.11/3.12
Environment
memu-py==0.1.8 from PyPI
- Python 3.11.9, Windows 11
- PostgreSQL 18.3 + pgvector + TimescaleDB
- Embedding: local bge-m3 (1024-dim) via sentence-transformers
Summary
memu-py 0.1.8on PyPI still ships the oldmemu.server+RecallAgentarchitecture that was removed in the v1.5.0 refactor (#81, commit4a2e86c). Users whopip install memu-pyand runpython -m memu.server.cli startget a server that cannot retrieve any memories.Related: #60, #8
Root Cause
The old
RecallAgent.retrieve_relevant_memories()reads from a file-systemmemory_dir({memory_dir}/{agent_id}/{user_id}/*_embeddings.json), butMemoryAgent.run()writes to PostgreSQL (memory_itemstable withpgvectorembeddings). The read and write paths are completely disconnected.Additionally,
cli.pyhard-exits ifOPENAI_API_KEYis not set, even though the embedding data is already stored in PG and does not require OpenAI for retrieval.Diagnosis
Why:
RecallAgentinitializesMemoryFileManagerpointing at a file directory that is empty. It never touches PG.Our Workaround
We patched
memory_service.pyto bypassRecallAgententirely and query PG pgvector directly:This returns correct results immediately.
Suggestion
memu.serverpackage, or (b) updates it to use the newsrc/memu/app/retrieve.pyworkflowEnvironment
memu-py==0.1.8from PyPI