{
 "schema_version": 1,
 "generated": "2026-10-20",
 "id": "xzf-thu-voicemem--add-long-term-memory-to-voice-agent",
 "repo": "xzf-thu/VoiceMem",
 "repo_url": "https://github.com/xzf-thu/VoiceMem",
 "repo_slug": "xzf-thu-voicemem",
 "title": "Give a custom voice agent long-term memory",
 "page_title": "How to give a custom voice agent long-term memory with Voice Mem",
 "summary": "Plug Voice Mem into your own voice model so it recalls user facts and feelings across sessions.",
 "who": "A developer building a real-time voice agent who wants it to remember a user's preferences and past conversations.",
 "problem": "A voice model forgets everything between sessions, so users repeat themselves and the agent cannot adapt to who they are.",
 "outcome": "Your reply model gets a short set of retrieved memories as context before it answers, and only the reply function changes.",
 "steps": [
  "Clone the repo with `git clone https://github.com/xzf-thu/VoiceMem.git` and enter the folder with `cd VoiceMem`.",
  "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`.",
  "Set your key with `export OPENAI_API_KEY=sk-...`.",
  "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."
 ],
 "agent_prompt": "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.",
 "agents": [
  "any"
 ],
 "difficulty": "Intermediate",
 "time": "1 hour",
 "basis": "readme",
 "caveat": "Memory writes call the OpenAI API for fact extraction, while memory retrieval runs locally according to the README.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "python",
 "requirements": [
  "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"
 ],
 "risk": "sensitive",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [
  {
   "tag": "credentials",
   "notice": "The example needs an OPENAI_API_KEY, which should be kept in an environment variable and not committed to code."
  }
 ],
 "best": true,
 "score": 1.0,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/xzf-thu-voicemem/add-long-term-memory-to-voice-agent/",
 "md": "https://dedupedai.com/use-cases/xzf-thu-voicemem/add-long-term-memory-to-voice-agent/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/xzf-thu-voicemem--add-long-term-memory-to-voice-agent.json",
 "api_version": "v1"
}
