Datasets:
|
Download README.md from iamem/amem-memory-queries: direct link, hf CLI and curl.
- Browser
- Download file 7.31 kB
-
https://huggingface.co/datasets/iamem/amem-memory-queries/resolve/main/README.md
- Command line
-
hf download hf://datasets/iamem/amem-memory-queries/README.md
-
curl -L -o README.md https://huggingface.co/datasets/iamem/amem-memory-queries/resolve/main/README.md
7.31 kB
| license: cc-by-4.0 | |
| pretty_name: amem memory queries (reranker training data) | |
| language: | |
| - en | |
| task_categories: | |
| - text-ranking | |
| - text-retrieval | |
| tags: | |
| - coding-agents | |
| - memory | |
| - reranking | |
| - synthetic | |
| - agent-memory | |
| - mcp | |
| size_categories: | |
| - 10K<n<100K | |
| configs: | |
| - config_name: default | |
| default: true | |
| data_files: | |
| - split: train | |
| path: train.parquet | |
| - split: validation | |
| path: validation.parquet | |
| - split: test | |
| path: test.parquet | |
| - config_name: facts | |
| data_files: facts.jsonl | |
| - config_name: projects | |
| data_files: projects.jsonl | |
| # amem memory queries | |
| Training data for a **reranker over coding-agent memory**: given a developer's message and the facts a memory layer retrieved, which fact actually answers it? | |
| It was built to train a small cross-encoder that rescores the top candidates from [amem](https://github.com/sslugic/amem) (*agent memory, anchored to your code*). amem stores short facts tied to the files they describe and retrieves them with SQLite FTS5/BM25, an in-process n-gram encoder and ranking signals. That works well when a question shares words with the fact; this dataset is weighted toward the questions where it doesn't. | |
| ## What's inside | |
| | | Count | | |
| | --- | --- | | |
| | Synthetic projects | 200 (40 domains, no e-commerce) | | |
| | Facts | 6,963 (constraint, gotcha, decision, howto, structure), each anchored to 1–2 files | | |
| | Queries | 27,957: 20,130 natural, 6,227 messy, 1,600 vague | | |
| | Queries with two correct facts | 1,590 | | |
| | Candidates per query | 10.8 on average: the positives, ~6.8 hard negatives, 3 random negatives | | |
| ### Splits (by project, never by row) | |
| | Split | Projects | Rows | | |
| | --- | --- | --- | | |
| | train | 180 | 24,830 | | |
| | validation | 10 | 1,550 | | |
| | test | 10 | 1,577 | | |
| ## Schema | |
| Each row of `train` / `validation` / `test`: | |
| ```json | |
| { | |
| "project_id": "p0041", | |
| "query": "my new database column isn't showing up in my struct after I added it to the schema script", | |
| "query_type": "natural", | |
| "positives": ["p0041-f07"], | |
| "candidates": [ | |
| {"fact_id": "p0041-f07", "text": "internal/store/models.go is sqlc output, so schema changes made only i...", "anchors": ["internal/store/models.go", "github/workflows/ci.yml"], "label": 1, "source": "positive"}, | |
| {"fact_id": "p0041-f25", "text": "Runtime settings (listen address, database URL, pool size) are loaded ...", "anchors": ["internal/config/config.go"], "label": 0, "source": "hard"}, | |
| {"fact_id": "p0041-f27", "text": "Entries reference accounts via foreign key, and each account has a fix...", "anchors": ["migrations/0002_create_entries.sql", "migrations/0001_create_accounts.sql"], "label": 0, "source": "random"} | |
| ] | |
| } | |
| ``` | |
| - `query_type`: `natural` (clean English, usually paraphrased or symptom-style), `messy` (typos, half sentences, vague references), or `vague` ("ok go ahead", "lgtm do it"). Vague rows have no positives: the right answer is *nothing*. | |
| - `source`: `positive`, `hard` (a wrong fact amem itself ranked high for this query), or `random`. | |
| - `facts` config: every fact with `fact_id`, `project_id`, `kind`, `text`, `anchors`. | |
| - `projects` config: name, domain, stack, summary, file tree and split for each project. | |
| ## How it was generated | |
| 1. **Projects** (Claude Sonnet 5.5): 200 repositories across 40 domains (SaaS backends, mobile, data pipelines, CLIs, infra, ML training and serving, games, fintech, healthcare, embedded, and more), each with a stack and a 15–40 file tree. E-commerce and web shops were excluded so nothing overlaps the amem retrieval benchmark. | |
| 2. **Facts** (Claude Sonnet 5.5): 30–40 per project in amem's fact format, anchored to paths from that project's tree. Near-duplicate facts were removed. | |
| 3. **Queries** (Claude Haiku 5.5): four per fact. Two describe only the symptom or goal and were asked to avoid the fact's distinctive words (each fact came with an explicit avoid list), one may reuse at most one of them, and one is messy. Plus 6–10 queries per project that need two facts. Duplicates were removed. | |
| 4. **Vague prompts**: 8 per project from a fixed list of 40 non-requests. | |
| 5. **Hard negatives**: every project's facts were loaded into a throwaway amem store, every query ran through amem's real retrieval (`amem_context`, top 20), and the highest-ranked wrong facts became hard negatives (up to 7). Three random wrong facts were added per query. | |
| Generation used the Anthropic Batch API and cost about $4.64. The generator lives in the amem repo under `tools/reranker-data/`. | |
| ## Quality checks | |
| - **Key-word overlap**: 39.4% of natural queries share none of their correct fact's key words (generic developer words such as *test*, *data*, *error*, *run* are not counted). | |
| - **Leakage**: every fact and query was compared with [iamem/amem-retrieval-bench](https://huggingface.co/datasets/iamem/amem-retrieval-bench) (exact match, or word Jaccard ≥ 0.6). 1 fact and 5 queries were dropped. | |
| ## Baseline: amem today, on the test split | |
| | Path | Right fact first | Right fact in top 3 | Vague prompts given nothing | | |
| | --- | --- | --- | --- | | |
| | Prompt hook (automatic) | 34.5% | 47.7% | 96.3% | | |
| | `amem_context` (agent asks) | 34.1% | 53.8% | n/a | | |
| On the hand-written benchmark amem scores 88% / 97%; here it is far lower **by design**, because these queries were written to avoid the words keyword retrieval relies on. This is the gap a reranker should close, and these are the numbers it has to beat. | |
| ## A model trained on this data | |
| [iamem/amem-reranker-minilm](https://huggingface.co/iamem/amem-reranker-minilm) is MiniLM-L6 (22M parameters) fine-tuned on the train split. Rescoring amem's own top-20 on the test split: | |
| | | Right fact first | In top 3 | Vague prompts given nothing | | |
| | --- | --- | --- | --- | | |
| | amem retrieval alone | 32.6% | 52.1% | 96.3% | | |
| | Base MS MARCO MiniLM, not fine-tuned | 55.4% | 74.7% | 32.5% | | |
| | **Fine-tuned on this dataset** | **68.8%** | **82.3%** | **98.8%** | | |
| ## Leakage policy | |
| [iamem/amem-retrieval-bench](https://huggingface.co/datasets/iamem/amem-retrieval-bench) is a pure test set. It was never used to generate, filter or tune this data, except for the leakage check above, and it must not be used for training. | |
| ## Known limitations | |
| - **Synthetic.** Projects, facts and queries were written by language models. They read as realistic, but they are not logs from real agent sessions. | |
| - **English only.** | |
| - **Some hard negatives may be partly relevant.** A fact amem ranked high is sometimes related to the query without answering it, and occasionally answers part of it. Labels follow the fact the query was written for. | |
| - **Harder than everyday traffic.** Symptom-style queries are over-represented on purpose; real prompts more often share words with the fact. | |
| - **Two-fact queries** list both facts as positives; a single fact may answer them partly. | |
| ## Links | |
| - amem: https://github.com/sslugic/amem · https://getamem.com | |
| - Reranker trained on this data: https://huggingface.co/iamem/amem-reranker-minilm | |
| - Retrieval benchmark: https://huggingface.co/datasets/iamem/amem-retrieval-bench | |
| - Try amem's search in the browser: https://huggingface.co/spaces/7bunnies/amem-demo | |
| - Article: https://huggingface.co/blog/7bunnies/stop-paying-your-agent-to-relearn-your-codebase | |
| ## License | |
| CC BY 4.0. | |