DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to give a custom voice agent long-term memory with Voice Mem

Plug Voice Mem into your own voice model so it recalls user facts and feelings across sessions.

Short answer: Clone the repo with git clone https://github.com/xzf-thu/VoiceMem.git and enter the folder with cd VoiceMem; then install the memory system with pip install voicemem; download the default local models with pip install -U huggingface_hub and then hf download zhifeixie/VoiceMem_Default_Models_Env --local-dir ./models. All steps.

Credentials. The example needs an OPENAI_API_KEY, which should be kept in an environment variable and not committed to code.

Who it is forA developer building a real-time voice agent who wants it to remember a user's preferences and past conversations.

The problemA voice model forgets everything between sessions, so users repeat themselves and the agent cannot adapt to who they are.

The outcomeYour reply model gets a short set of retrieved memories as context before it answers, and only the reply function changes.

What you need first

  • Python 3.10 or newer
  • An OpenAI API key, used for fact extraction when memories are written
  • Git and access to GitHub and Hugging Face to clone the repo and download the default models
  • Audio input (a WAV file or a microphone) if you want to ingest speech

Steps

  1. Clone the repo with git clone https://github.com/xzf-thu/VoiceMem.git and enter the folder with cd VoiceMem.
  2. Install the memory system with pip install voicemem.
  3. Download the default local models with pip install -U huggingface_hub and then hf download zhifeixie/VoiceMem_Default_Models_Env --local-dir ./models.
  4. Set your key with export OPENAI_API_KEY=sk-....
  5. Run the sample agent with python examples/03_simple_agent_with_voicemem_memory.py, then replace the generation step with your own model in a function that takes text and memory_context.

Prompt for your agent

Using the VoiceMem repo at <repo path>, wire my model <model name> into a reply function with signature my_reply(text, memory_context) and pass it to VoiceMem(reply=my_reply). Confirm the sample script runs and that memory_context is non-empty after I state a fact such as a food allergy.

Caveat. Memory writes call the OpenAI API for fact extraction, while memory retrieval runs locally according to the README.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for xzf-thu/VoiceMem and "Give a custom voice agent long-term memory"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer