# AI use cases for Speaker Mem R1 (2022hpsk/SpeakerMemR1)

Repo: [2022hpsk/SpeakerMemR1](https://github.com/2022hpsk/SpeakerMemR1) | Use cases: 4 | Page: https://dedupedai.com/use-cases/2022hpsk-speakermemr1/

SpeakerMem-R1 is a Python research repo with a speaker-centered memory package, benchmark runners, writer-training recipes, and evaluation outputs for multi-party dialogue.

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

- Retrieve speaker-labeled evidence from a group chat locally: https://dedupedai.com/use-cases/2022hpsk-speakermemr1/speaker-attributed-evidence-quickstart/
- Benchmark BM25 baseline retrieval on GroupMemBench: https://dedupedai.com/use-cases/2022hpsk-speakermemr1/compare-memory-baselines-on-groupmembench/
- Evaluate SpeakerMem on SocialMemBench with a local Writer: https://dedupedai.com/use-cases/2022hpsk-speakermemr1/run-speakermem-socialmembench-with-local-writer/
- Verify writer-training rewards and trajectories offline: https://dedupedai.com/use-cases/2022hpsk-speakermemr1/check-writer-training-rewards-offline/

## How to retrieve speaker-labeled evidence from a group chat locally with Speaker Mem R1

Repo: [2022hpsk/SpeakerMemR1](https://github.com/2022hpsk/SpeakerMemR1) | Difficulty: Intermediate | Time: 30 minutes | Basis: From the README

Store a multi-person conversation and pull back who said what for a question, with no API key.

**Who it is for:** A developer building a group chat or meeting assistant who needs to check that retrieved evidence keeps speaker attribution before wiring in a model.

**The problem:** General memory tools can lose track of which person made a statement, so answers about a specific person or group decision can be wrong.

**The outcome:** A local run prints memory statistics and retrieved entries, each tagged with its speaker.

### Steps

1. Run `python3 -m venv .venv` and then `source .venv/bin/activate` at the repository root.
2. Run `python -m pip install --upgrade pip`.
3. Run `python -m pip install -r code/requirements.txt`.
4. Run `python -m pip install -e code/speakermem_pkg`.
5. Run `python code/speakermem_pkg/examples/quickstart.py` and read the stats and the speaker-tagged entries printed for the two sample questions.

### Prompt to paste into your agent

```text
Clone the SpeakerMem-R1 repo (2022hpsk/SpeakerMemR1), set up the virtual environment and install the package as its README describes, then run code/speakermem_pkg/examples/quickstart.py. Report the memory stats and the retrieved entries for the questions 'Who handles evaluation?' and 'What does Bob handle?'. Verify that each retrieved entry shows the speaker name.
```

### Caveat

The quickstart only returns stored evidence; it does not generate answers, and the first run may download the all-MiniLM-L6-v2 embedding model.

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/2022hpsk-speakermemr1/speaker-attributed-evidence-quickstart/

## How to benchmark BM25 baseline retrieval on GroupMemBench with Speaker Mem R1

Repo: [2022hpsk/SpeakerMemR1](https://github.com/2022hpsk/SpeakerMemR1) | Difficulty: Advanced | Time: 2 hours | Basis: From the README

Run the baseline runner on a benchmark split to get accuracy numbers to compare against SpeakerMem.

**Who it is for:** A memory-systems researcher who wants to check how a simple BM25 retriever performs on multi-party benchmarks before judging a new memory method.

**The problem:** Reported gains are only meaningful against a controlled baseline, and the paper notes that simple BM25 retrieval can be a strong comparison point.

**The outcome:** A results folder with question-level outputs and metrics for the BM25 baseline on GroupMemBench.

### Steps

1. Place the benchmark payloads as described in DATA_SOURCES.md under code/.
2. Create the environment and install with `python -m pip install -r code/requirements.txt` and `python -m pip install -e code/speakermem_pkg`.
3. Set the model credentials in a local `.env` file based on code/.env.example, and keep it out of version control.
4. Change into the code directory with `cd code`.
5. Run `python run_baseline.py --baseline bm25 --benchmark groupmem --domain all --top-k 10 --agent-model deepseek-v4-flash --judge-model deepseek-v4-flash --results-dir ../results/local_baseline`. (inferred, check the README)

### Prompt to paste into your agent

```text
Use the SpeakerMem-R1 repo (2022hpsk/SpeakerMemR1) from the code directory to run run_baseline.py with --baseline bm25 on the groupmem benchmark, writing to <results-dir>. Expected output is question-level results and a metrics summary in that folder. Verify that the run finished without missing-data errors and that the metrics include accuracy.
```

### Caveat

The benchmark payloads are not in the repo, so you must obtain them yourself and check each upstream license before using or redistributing the outputs.

Risk, credentials: The run needs model service credentials that must be stored in a local .env file and never committed to the repo.

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/2022hpsk-speakermemr1/compare-memory-baselines-on-groupmembench/

## How to evaluate SpeakerMem on SocialMemBench with a local Writer with Speaker Mem R1

Repo: [2022hpsk/SpeakerMemR1](https://github.com/2022hpsk/SpeakerMemR1) | Difficulty: Advanced | Time: 2 hours | Basis: From the README

Run the main SpeakerMem evaluation with a locally served Writer model instead of an external LLM.

**Who it is for:** A researcher reproducing the paper's main SocialMemBench result who wants the memory-writing step to run on their own hardware.

**The problem:** The full dual-track pipeline needs a writer and answerer, and the paper's main numbers depend on configuration choices like top-k and no-ASK settings.

**The outcome:** A local results folder with SpeakerMem question-level outputs for SocialMemBench using the default main configuration.

### Steps

1. Place the SocialMemBench payload as described in DATA_SOURCES.md under code/ and set credentials from code/.env.example.
2. Change into the code directory with `cd code`.
3. Run `PYTHONPATH=.:speakermem_pkg/src python speakermem_pkg/examples/socialmembench.py --benchmark socialmem --domain all --top-k 10 --s2-k 2 --s2-source-k 1 --results-dir ../results/local_run`. (inferred, check the README)
4. Add `--writer-vllm-url` and `--writer-vllm-model` to point the run at your locally served Writer, and use `--ingest-only` first if you want to build the memory store before QA.
5. Run `python speakermem_pkg/examples/socialmembench.py --help` to check any other options you need.

### Prompt to paste into your agent

```text
In the SpeakerMem-R1 repo (2022hpsk/SpeakerMemR1), run speakermem_pkg/examples/socialmembench.py on SocialMemBench with --top-k 10 --s2-k 2 --s2-source-k 1 and a local Writer URL given as <writer-url>. Expected output is results written to the results directory you choose. Verify that the summary reports accuracy for the socialmem domains and that no ASK route was enabled, since the README says the principal comparison uses the no-ASK configuration.
```

### Caveat

The README gives no full reproduction time or hardware needs, and the full-LLM sensitivity study also needs an external held-out memory store that the repo does not include.

Risk, credentials: The answerer and judge calls need API credentials, which must stay in a local .env file outside version control.

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/2022hpsk-speakermemr1/run-speakermem-socialmembench-with-local-writer/

## How to verify writer-training rewards and trajectories offline with Speaker Mem R1

Repo: [2022hpsk/SpeakerMemR1](https://github.com/2022hpsk/SpeakerMemR1) | Difficulty: Intermediate | Time: 30 minutes | Basis: From the README

Run the offline test suite for writer training to confirm rewards and action handling before any RL run.

**Who it is for:** An ML engineer who wants to adapt the SpeakerLevenshtein-based writer training and first confirm the reward and trajectory code behaves as documented.

**The problem:** Writer training involves rewards and action validation, and a silent bug there would waste a full RL run.

**The outcome:** Passing test results for the training module, with no remote model calls needed.

### Steps

1. Create the environment with `python -m pip install -r code/requirements.txt` and `python -m pip install -e code/speakermem_pkg`.
2. Run `PYTHONPATH=code/writer_training:code/speakermem_pkg/src python -m pytest -q code/speakermem_pkg/tests/test_training.py`. (inferred, check the README)
3. Run `python -m py_compile code/writer_training/*.py` to check the training scripts compile. (inferred, check the README)
4. Read the reward code in code/writer_training before changing reward weights, since the README only says the tests cover reward behavior. (inferred, check the README)

### Prompt to paste into your agent

```text
In the SpeakerMem-R1 repo (2022hpsk/SpeakerMemR1), run the training test file code/speakermem_pkg/tests/test_training.py with the PYTHONPATH the README gives. Expected output is a pytest summary for the training tests. Verify that the test run passes before any change to the writer reward code is accepted.
```

### Caveat

The offline tests do not validate remote model availability or benchmark licensing, and the README reports the RL gain (57.38% to 68.20%) only for a controlled evaluation with retrieval and answering frozen.

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/2022hpsk-speakermemr1/check-writer-training-rewards-offline/
