xzf-thu/VoiceMem
Streaming dual-brain memory for factual and personal recall in real-time voice agents
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
VoiceMem is a Python memory layer for voice agents, not a general-purpose vector database. Its “left brain” organizes factual memory by schema and entity; its “right brain” models emotion, personality, and relationships with standalone and cross-entity nodes. Retrieval routes a query before ranking candidates, then supplies only the Top-K memories to the reply model. Writes do more work: extract facts, label them, and update the memory graph.
The base package bundles VAD, ASR, speaker identification, scene and emotion models, and local embeddings. Partial transcripts can trigger speculative retrieval while the user is still speaking. The streaming example feeds PCM chunks asynchronously and reads results when VAD closes the turn; it then calls text ingestion explicitly, so finishing a stream turn is not itself a persistence guarantee. A reply callback keeps the response model separate from memory retrieval.
Key Capabilities & Differentiators
The API supports direct text and audio-file ingestion as well as streaming PCM. leftbrain_only is available for fact-only workloads. Streaming results can include speaker ID and voiceprint, emotion, schema, entity, and text embedding alongside the transcript and recalled memories. Memory-aware model families include Qwen2.5-Omni, Qwen3-Omni, and Step-Audio2-Mini; finetune/train.py provides an adapter training path rather than making those models a runtime requirement for every integration.
Published figures include 91.2% on LoCoMo at Top-5, 69.44% on PersonaMem, 134 ms response time, and 430 memory-context tokens. A separate LoCoMo CLI example reports 139/152 (91.4%), 12 ms median retrieval latency, and 298 median retrieved tokens. These are distinct measurements: retrieval latency is not end-to-end time to audible reply. The evaluation runner withholds raw dialogue history from the answering model, so answers depend on what retrieval actually supplies.
Trade-offs & Limitations
Compared with using Mem0 or EverMemOS strictly as text-memory baselines, VoiceMem's distinguishing design is its audio perception layer and ability to start recall before turn completion. The published comparison is useful for choosing what to test, not for predicting production latency or cost. Top-K limits the prompt footprint but can omit context for multi-hop or temporal questions. Preserving dated facts is preferable to overwriting them when users' circumstances change, but the reply model still has to interpret which fact is current.
Prefetch moves retrieval off part of the post-turn critical path; it does not remove final ASR processing, generation, or TTS. Measure latency to the first audible reply, write-to-recall lag, and recall quality when partial transcripts change. Voiceprints and inferred emotional attributes also raise the cost of operating this layer: set consent, access, retention, and deletion rules. Treat the demo's session and memory-space separation as behavior to verify, not as proof of production tenant isolation.
Hardware & Deployment Guide
Use Python 3.10+ and install with pip install voicemem. Download zhifeixie/VoiceMem_Default_Models_Env into ./models with hf download, then call vm.warmup() so lazy initialization does not land on the first audio chunk. The optional voicemem[slm] extra is shown for the fine-tuned Qwen reply path. Local retrieval does not establish a fully offline pipeline: the normal ingestion and streaming examples configure an OpenAI key. Verify extraction and reply backends separately before deploying without network access.
For the browser demo, clone the repository and run python web/run.py; it listens at localhost:8787. Terminal logs are written to disk by default; use --no-file-log to disable that file output. The v0.0.2 release fixes event-date propagation, removes the unused response_experience category, and makes TTS pluggable. The supplied pyproject.toml shows 0.2.3 while the GitHub release tag is v0.0.2, so pin and test the exact package or checkout you deploy.
turn_over.VoiceMem(reply=...) accepts a custom generator, and the demo's TTS interface can return TimedAudioChunk for text alignment.evaluation/run.py withholds raw dialogue history from the answer model; --inspect parses inputs without model calls.Real-time voice assistants that need persistent facts and personal context, want recall to begin during speech, and can validate their own model backends and audio latency.
You only need a general-purpose vector store or finalized-text retrieval, or you require a turnkey, fully offline, multi-tenant service with established production guarantees.
Quick Start & Installation
git clone https://github.com/xzf-thu/VoiceMem.git cd VoiceMem # 安装记忆系统(含 ASR / 声纹 / 场景 / 情绪 / 本地 embedding 全套内置组件) pip install voicemem # 可选:用我们微调的 Qwen 回复模型 pip install "voicemem[slm]"
Comparison vs. Top RAG, Data & Memory Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| VoiceMem ★ | 2.9k | +3 | Python | Apache-2.0 | Streaming dual-brain memory for factual and personal recall in real-time voice a |
| mem0 | 70k | +498 | Python | Apache-2.0 | A vector-backed memory layer for AI agents that need to recall past conversation |
| Memori | 17.9k | +337 | Python | — | An SDK-based agent memory layer for persistent state across sessions. |
| OpenViking | 43.2k | +255 | Python | AGPL-3.0 | A directory-scoped RAG database for inspectable agent knowledge and memory |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/xzf-thu/VoiceMem.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about VoiceMem
Can I keep my existing voice model and use VoiceMem only for memory?
ingest() and search() to add and retrieve memories independently of generation. For live audio, pass PCM chunks to vm.stream(...).feed() and read the transcript and retrieval results at turn_over. If you want VoiceMem to call your generator, supply VoiceMem(reply=my_reply); the callback receives the current text and memory context.How should I size a host for live audio?
vm.warmup() before measuring steady-state performance, then measure cold-start time, RAM and GPU memory where applicable, and tail latency at your target stream concurrency. Budget separately for local reply generation if you enable it.Can I self-host VoiceMem commercially, and what still needs review?
When should I evaluate VoiceMem instead of Mem0?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy