# AI use cases for Voice Mem (xzf-thu/VoiceMem)

Repo: [xzf-thu/VoiceMem](https://github.com/xzf-thu/VoiceMem) | Use cases: 5 | Page: https://dedupedai.com/use-cases/xzf-thu-voicemem/

VoiceMem is an open source memory system for real-time voice agents that stores facts and emotional context from speech and feeds relevant memories to a reply model.

This file holds every use case of this repo. Each one starts with a "## " heading and ends with its URL.

- Give a custom voice agent long-term memory: https://dedupedai.com/use-cases/xzf-thu-voicemem/add-long-term-memory-to-voice-agent/
- Store and search text facts with Voice Mem: https://dedupedai.com/use-cases/xzf-thu-voicemem/store-and-search-text-facts/
- Run the LoCoMo benchmark on a memory system: https://dedupedai.com/use-cases/xzf-thu-voicemem/benchmark-memory-on-locomo/
- Run the Voice Mem voice demo in a browser: https://dedupedai.com/use-cases/xzf-thu-voicemem/try-voicemem-voice-demo-locally/
- Fine-tune a Voice Mem model family adapter: https://dedupedai.com/use-cases/xzf-thu-voicemem/fine-tune-voicemem-adapter/

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

Repo: [xzf-thu/VoiceMem](https://github.com/xzf-thu/VoiceMem) | Difficulty: Intermediate | Time: 1 hour | Basis: From the README

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

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

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

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

### 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 to paste into your agent

```text
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.

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

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/xzf-thu-voicemem/add-long-term-memory-to-voice-agent/

## How to store and search text facts with Voice Mem with Voice Mem

Repo: [xzf-thu/VoiceMem](https://github.com/xzf-thu/VoiceMem) | Difficulty: Intermediate | Time: 30 minutes | Basis: From the README

Save plain text facts in a fact-only mode and retrieve them with a search query.

**Who it is for:** A developer who wants a simple memory store for user facts, without audio processing or emotion tracking.

**The problem:** Building a per-user fact store with retrieval from scratch takes time, and the team wants a tested memory engine to start from.

**The outcome:** A short Python script saves a fact such as a dietary restriction and returns it when asked a matching question.

### Steps

1. Clone the repo with `git clone https://github.com/xzf-thu/VoiceMem.git` and install with `pip install voicemem`.
2. Download the default models with `hf download zhifeixie/VoiceMem_Default_Models_Env --local-dir ./models` after running `pip install -U huggingface_hub`.
3. In a Python file, create Voice Mem(mode="leftbrain_only", openai_key=...) and call vm.ingest with a text fact.
4. Call vm.search with a question about that fact and print the result.result_leftbrain field.

### Prompt to paste into your agent

```text
In the VoiceMem repo at <repo path>, write a script that creates VoiceMem with mode leftbrain_only, ingests the text <fact text>, and searches with the question <question>. Expected output is the stored fact in result_leftbrain. Verify the search returns the fact after ingest.
```

### Caveat

The README describes this mode as storing factual text without emotion, so it does not replace the full dual-brain setup.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/xzf-thu-voicemem/store-and-search-text-facts/

## How to run the LoCoMo benchmark on a memory system with Voice Mem

Repo: [xzf-thu/VoiceMem](https://github.com/xzf-thu/VoiceMem) | Difficulty: Advanced | Time: 1 hour | Basis: From the README

Score Voice Mem on the LoCoMo dataset and check that the parser reads the data correctly first.

**Who it is for:** A researcher or engineer who needs a reproducible score for a memory system and wants to compare it with published numbers.

**The problem:** Memory benchmarks are easy to run wrong, for example by giving the reply model the full conversation instead of only retrieved memory.

**The outcome:** A score report with accuracy by question type and median retrieval latency, produced by a documented command.

### Steps

1. Clone the repo and run `python evaluation/run.py --dataset locomo --data evaluation/examples/locomo_sample.json` as a small check. (inferred, check the README)
2. Run `python evaluation/run.py --dataset locomo --data data/locomo.json --inspect` to confirm the dataset parses without calling any model. (inferred, check the README)
3. Set `export OPENAI_API_KEY=sk-...` and run `python evaluation/run.py --dataset locomo --data data/locomo.json` for the full benchmark. (inferred, check the README)
4. Read evaluation/README.md for how to add another benchmark with one file and two functions.

### Prompt to paste into your agent

```text
In the VoiceMem repo at <repo path>, run the LoCoMo sample with evaluation/run.py, then run the full dataset only after the sample passes. Report the overall score, the per-category scores, and median retrieval latency. Verify that the answer model received retrieved memory and not raw conversation history.
```

### Caveat

The full run calls the OpenAI API, so the README's inspect mode should be used first to avoid unexpected charges.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/xzf-thu-voicemem/benchmark-memory-on-locomo/

## How to run the Voice Mem voice demo in a browser with Voice Mem

Repo: [xzf-thu/VoiceMem](https://github.com/xzf-thu/VoiceMem) | Difficulty: Intermediate | Time: 45 minutes | Basis: From the README

Start the local web demo and talk to a voice agent that remembers what you said.

**Who it is for:** A developer or product person who wants to see the streaming voice memory working before building on it.

**The problem:** Reading about a streaming memory architecture does not show how memory is retrieved before the speaker finishes a sentence.

**The outcome:** A local web page at localhost:8787 where you speak, see transcripts, and check that a stated fact is recalled in a later turn.

### Steps

1. Clone the repo, install with `pip install voicemem`, and download models with `hf download zhifeixie/VoiceMem_Default_Models_Env --local-dir ./models`.
2. Run `python web/run.py` from the repo folder.
3. Open http://localhost:8787 in a browser and unmute the audio before playback.
4. Say a fact about yourself, then ask a question about it in a later turn and check the reply.

### Prompt to paste into your agent

```text
In the VoiceMem repo at <repo path>, start python web/run.py and open http://localhost:8787. Ask the user to state a fact, then to ask about it. Expected output is a reply that uses the stated fact. Verify the log file in results/logs was written.
```

### Caveat

The demo needs a microphone and browser audio permissions, and the README warns that playback needs audio unmuted.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/xzf-thu-voicemem/try-voicemem-voice-demo-locally/

## How to fine-tune a Voice Mem model family adapter with Voice Mem

Repo: [xzf-thu/VoiceMem](https://github.com/xzf-thu/VoiceMem) | Difficulty: Advanced | Time: 3 hours | Basis: From the README

Train your own adapter on the provided training script and reproduce the default configuration.

**Who it is for:** A machine learning engineer who wants a custom Voice Mem memory-reading adapter for a different dataset or base model.

**The problem:** Off-the-shelf models may not read Voice Mem memory well for a specific domain, so the team needs its own adapter.

**The outcome:** A trained adapter checkpoint produced with the default settings, matching the configuration of the released checkpoint-3318.

### Steps

1. Clone the repo and install the training tools with `pip install ms-swift==4.5.2 bitsandbytes`.
2. Prepare training data in the format described in finetune/README.md.
3. Run `python finetune/train.py --data data/train.jsonl` with default parameters.
4. Check GPU memory requirements and base model options in finetune/README.md before changing the base model.

### Prompt to paste into your agent

```text
In the VoiceMem repo at <repo path>, install ms-swift==4.5.2 and bitsandbytes, then run finetune/train.py with my dataset <dataset path>. Expected output is a trained adapter. Verify the run uses the default parameters described in the README.
```

### Caveat

The README mentions GPU memory requirements without giving numbers here, so check finetune/README.md before starting a run.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/xzf-thu-voicemem/fine-tune-voicemem-adapter/
