# 1. Install VoiceMem (ASR / voiceprint / scene / emotion / embedding built in)pip install voicememfrom voicemem import VoiceMemvm = VoiceMem(mode="normal", openai_key="api_xxx", top_k=5)vm.warmup() # local models are lazy-loaded# 2. Ingest audio — ASR, voiceprint, scene, emotion and embedding run insidevm.ingest(audio="assets/input.wav") # "I'm vegetarian, allergic to nuts."# 3. Search — pure vector retrieval, decoupled from ingestionresult = vm.search("What are my dietary restrictions?")print(result.result_leftbrain, result.result_rightbrain)
# 1. The streaming interface behaves like a VAD that keeps eating audiostream = vm.stream(src_rate=sr, vad_threshold=0.5, on_partial=on_partial)step = int(sr * .032)for i inrange(0, len(pcm), step): st = await stream.feed(pcm[i:i + step].tobytes())if st.state != "turn_over":continue# 2. Memory was already retrieved while the user was still speaking print(st.transcript, st.result_leftbrain, st.result_rightbrain) print(st.speaker_id, st.emotion, st.entity, st.schema)# 3. Every turn goes through one ingestion decision res = vm.ingest(st.transcript)
# 1. Clone the repo — the demo lives here, pip ships the library onlygit clone https://github.com/xzf-thu/VoiceMem.gitcd VoiceMem# 2. Pull the default modelspip install -U huggingface_hubhf download zhifeixie/VoiceMem_Default_Models_Env --local-dir ./models# 3. Start the interactive web demoexport OPENAI_API_KEY=sk-...python web/run.py# 4. Then open the local UIhttp://localhost:8787
Introduction
Two brains. One voice. Nothing to wait for.
Streaming dual-brain architecture
The left brain organizes factual memory through schemas and entities, while the right brain models personality and emotion with independent and cross-entity nodes. The entire pipeline is streaming: while the user is still speaking, audio is segmented, transcribed, extracted, and written into the graph. At query time, VoiceMem routes first, ranks second, and injects only the Top-K memories into context.
Datasets and voice-model family built with OPD
ChatMem-400K is produced by a three-stage pipeline of memory-world construction, SLM-validated online on-policy distillation, and human refinement; the same pipeline also produces the ChatMem-Bench evaluation set. After OPD distillation, Qwen2.5-Omni, Qwen3-Omni, and Step-Audio2-Mini learn to proactively invoke memory without sacrificing their original speech capabilities.