DEDUPED Hot AI repos, turned into use cases Get 5 a day

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.

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.

Share: X LinkedIn Hacker News Email Copy link

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 [email protected] and we will look at it promptly. Full disclaimer page