{"id":48719533,"url":"https://github.com/codysnider/tagmem","last_synced_at":"2026-04-11T19:01:41.293Z","repository":{"id":350498549,"uuid":"1205615761","full_name":"codysnider/tagmem","owner":"codysnider","description":"Structured local memory storage and retrieval for LLM agents","archived":false,"fork":false,"pushed_at":"2026-04-10T16:33:30.000Z","size":1118,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-10T17:27:29.942Z","etag":null,"topics":["agent-memory","embeddings","golang","llm-agents","local-first","mcp","model-context-protocol","offline","retrieval","semantic-search"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codysnider.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-09T05:58:56.000Z","updated_at":"2026-04-10T16:33:34.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/codysnider/tagmem","commit_stats":null,"previous_names":["codysnider/tagmem"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/codysnider/tagmem","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codysnider%2Ftagmem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codysnider%2Ftagmem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codysnider%2Ftagmem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codysnider%2Ftagmem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codysnider","download_url":"https://codeload.github.com/codysnider/tagmem/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codysnider%2Ftagmem/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31691503,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T13:07:20.380Z","status":"ssl_error","status_checked_at":"2026-04-11T13:06:47.903Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent-memory","embeddings","golang","llm-agents","local-first","mcp","model-context-protocol","offline","retrieval","semantic-search"],"created_at":"2026-04-11T19:01:38.153Z","updated_at":"2026-04-11T19:01:41.283Z","avatar_url":"https://github.com/codysnider.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/logo.png\" alt=\"tagmem logo\" width=\"220\"\u003e\n\u003c/p\u003e\n\n# tagmem\n\nTagged, depth-aware memory storage and retrieval for LLM agents.\n\n[Install](#install) · [OpenCode](#opencode) · [MCP](#mcp) · [Benchmarks](#benchmarks) · [Full install guide](INSTALL.md)\n\n## Quick Start\n\nInstall with one command:\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/codysnider/tagmem/main/scripts/install.sh | bash\n```\n\nThis installer is:\n\n- interactive by default\n- Docker-first\n- release-binary fallback when Docker is unavailable\n- able to patch OpenCode config safely with backups\n\nFor full installation details, see [`INSTALL.md`](INSTALL.md).\n\nIt is built around a simple model:\n\n- `entries` store verbatim text\n- `tags` are the primary way to organize and filter memory\n- `depth` indicates how close a memory should stay to the surface\n- `facts` store structured knowledge\n- `diary` stores agent-specific notes\n\nThe system is local-first, retrieval-oriented, and designed to be usable through:\n\n- CLI\n- MCP\n\n## Install\n\nPublished image:\n\n```bash\nghcr.io/codysnider/tagmem:latest\n```\n\nAfter install, initialize storage:\n\n```bash\ntagmem init\n```\n\nAdd an entry:\n\n```bash\ntagmem add --depth 0 --title \"Working identity\" --body \"You are helping ship a local-first memory system.\"\n```\n\nSearch:\n\n```bash\ntagmem search \"identity\"\ntagmem search --depth 2 \"auth migration\"\ntagmem search --tag auth \"token refresh\"\n```\n\n## OpenCode\n\nThe installer can detect and patch OpenCode automatically.\n\nIf you want to patch OpenCode during install:\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/codysnider/tagmem/main/scripts/install.sh | bash -s -- --patch-opencode\n```\n\nIf you want to skip patching and handle config yourself:\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/codysnider/tagmem/main/scripts/install.sh | bash -s -- --no-patch-opencode\n```\n\n## Runtime Notes\n\nThe Docker path keeps model files, cache, and runtime state outside the repo in mounted directories.\n\nDefault Docker data root:\n\n```bash\n$HOME/.local/share/tagmem\n```\n\nOverride it if you want Docker state elsewhere:\n\n```bash\nexport TAGMEM_DATA_ROOT=/path/to/tagmem-data\n```\n\nThe helper `just` commands are for development and release work. Most users only need the installer.\n\n## Commands\n\nCore commands:\n\n- `tagmem init`\n- `tagmem ingest`\n- `tagmem split`\n- `tagmem add`\n- `tagmem list`\n- `tagmem search`\n- `tagmem show`\n- `tagmem status`\n- `tagmem context`\n- `tagmem depths`\n- `tagmem paths`\n- `tagmem doctor`\n- `tagmem repair`\n- `tagmem mcp`\n- `tagmem bench`\n\nExamples:\n\n```bash\ntagmem ingest --mode files --depth 1 ~/projects/my_app\ntagmem ingest --mode conversations --depth 2 ~/chats\ntagmem ingest --mode conversations --extract general ~/chats\ntagmem split ~/chats\ntagmem status\ntagmem context --depth 0\ntagmem context --tag auth\ntagmem show 1\n```\n\n## MCP\n\nRun the MCP server over stdio:\n\n```bash\ntagmem mcp\n```\n\nCurrent MCP tools:\n\n- `tagmem_status`\n- `tagmem_paths`\n- `tagmem_list_depths`\n- `tagmem_list_tags`\n- `tagmem_get_tag_map`\n- `tagmem_list_entries`\n- `tagmem_search`\n- `tagmem_show_entry`\n- `tagmem_check_duplicate`\n- `tagmem_add_entry`\n- `tagmem_delete_entry`\n- `tagmem_kg_query`\n- `tagmem_kg_add`\n- `tagmem_kg_invalidate`\n- `tagmem_kg_timeline`\n- `tagmem_kg_stats`\n- `tagmem_graph_traverse`\n- `tagmem_find_bridges`\n- `tagmem_graph_stats`\n- `tagmem_diary_write`\n- `tagmem_diary_read`\n- `tagmem_doctor`\n\n## Embedding Backends\n\n### Embedded\n\nThe embedded backend runs locally.\n\nDefault embedded configuration:\n\n```bash\nexport TAGMEM_EMBED_PROVIDER=embedded\nexport TAGMEM_EMBED_MODEL=bge-small-en-v1.5\nexport TAGMEM_EMBED_ACCEL=auto\n```\n\n### OpenAI-compatible\n\n```bash\nexport TAGMEM_EMBED_PROVIDER=openai\nexport TAGMEM_OPENAI_MODEL=nomic-embed-text\nexport TAGMEM_OPENAI_BASE_URL=http://localhost:11434/v1\nexport TAGMEM_OPENAI_API_KEY=\n```\n\n## Environment Variables\n\n| Variable | Default | Purpose |\n|---|---|---|\n| `TAGMEM_EMBED_PROVIDER` | `embedded` | Selects the embedding backend: `embedded`, `openai`, or `embedded-hash`. |\n| `TAGMEM_EMBED_MODEL` | `bge-small-en-v1.5` | Selects the embedded local model. Supported values currently include `all-MiniLM-L6-v2`, `bge-small-en-v1.5`, and `bge-base-en-v1.5`. |\n| `TAGMEM_EMBED_ACCEL` | `auto` | Embedded acceleration mode: `auto`, `cuda`, or `cpu`. |\n| `TAGMEM_OPENAI_MODEL` | `nomic-embed-text` | Model name for OpenAI-compatible embeddings. |\n| `OPENAI_MODEL` | unset | Fallback model name for OpenAI-compatible mode. |\n| `TAGMEM_OPENAI_BASE_URL` | unset | Base URL for an OpenAI-compatible embeddings endpoint. If no path is provided, `/v1` is assumed. |\n| `OPENAI_BASE_URL` | unset | Fallback base URL for OpenAI-compatible mode. |\n| `OLLAMA_HOST` | unset | Convenience fallback base URL, normalized to `/v1` if used. |\n| `TAGMEM_OPENAI_API_KEY` | unset | API key for an OpenAI-compatible endpoint. |\n| `OPENAI_API_KEY` | unset | Fallback API key for OpenAI-compatible mode. |\n| `TAGMEM_DATA_ROOT` | `$HOME/.local/share/tagmem` | Host-side root directory for Docker state, including XDG data, model caches, datasets, and benchmark results. |\n| `TAGMEM_BENCH_ROOT` | Docker-only | Root path for benchmark outputs in the Docker workflow. |\n| `TAGMEM_DATASET_ROOT` | Docker-only | Root path for benchmark datasets in the Docker workflow. |\n| `XDG_CONFIG_HOME` | platform default | XDG config root used for config and identity files. |\n| `XDG_DATA_HOME` | platform default | XDG data root used for storage, vectors, knowledge graph, diaries, and models. |\n| `XDG_CACHE_HOME` | platform default | XDG cache root. |\n\n## Storage Layout\n\n- data: `~/.local/share/tagmem/store.json`\n- vector index: `~/.local/share/tagmem/vector/`\n- knowledge graph: `~/.local/share/tagmem/knowledge.json`\n- diaries: `~/.local/share/tagmem/diaries/`\n- models: `~/.local/share/tagmem/models/`\n- config: `~/.config/tagmem/`\n- cache: `~/.cache/tagmem/`\n\n`tagmem` is local-first, keeps original text intact, avoids lossy memory dialects, and uses simple user-facing concepts: entries, tags, depth, facts, and diary.\n\n## Benchmarks\n\nCurrent benchmark snapshot:\n\n### LongMemEval Comparison\n\n```mermaid\nxychart-beta\n    title \"LongMemEval Recall@5\"\n    x-axis [\"bge-base\", \"bge-small\", \"MemPalace\", \"Mastra\", \"Hindsight\", \"Stella\", \"Contriever\", \"BM25\"]\n    y-axis \"Recall@5\" 0.65 --\u003e 1.00\n    bar [0.992, 0.990, 0.966, 0.9487, 0.914, 0.85, 0.78, 0.70]\n```\n\n- `tagmem` (`bge-small-en-v1.5`): `Recall@1 0.924`, `Recall@5 0.990`, `MRR 0.955`\n- `tagmem` (`bge-base-en-v1.5`): `Recall@1 0.922`, `Recall@5 0.992`, `MRR 0.953`\n- MemPalace raw baseline: `Recall@5 0.966`\n- Source-reported comparisons from MemPalace docs: `Mastra 0.9487`, `Hindsight 0.914`, `Stella ~0.85`, `Contriever ~0.78`, `BM25 ~0.70`\n\n### Adversarial Retrieval Snapshot\n\n`FalseMemBench` is a standalone adversarial distractor benchmark focused on conflicting, stale, and near-miss memories.\n\n```mermaid\nxychart-beta\n    title \"FalseMemBench Recall@1\"\n    x-axis [\"tagmem\", \"BM25\", \"MemPalace\", \"Contriever\", \"Stella\"]\n    y-axis \"Recall@1\" 0.40 --\u003e 0.90\n    bar [0.8674, 0.6946, 0.6632, 0.6527, 0.4258]\n```\n\n```mermaid\nxychart-beta\n    title \"FalseMemBench MRR\"\n    x-axis [\"tagmem\", \"BM25\", \"MemPalace\", \"Contriever\", \"Stella\"]\n    y-axis \"MRR\" 0.60 --\u003e 0.95\n    bar [0.9288, 0.8278, 0.8154, 0.8049, 0.6465]\n```\n\n- `tagmem`: `Recall@1 0.8674`, `Recall@5 0.9983`, `MRR 0.9288`\n- `BM25`: `Recall@1 0.6946`, `Recall@5 0.9930`, `MRR 0.8278`\n- MemPalace raw-style: `Recall@1 0.6632`, `Recall@5 0.9948`, `MRR 0.8154`\n- `Contriever`: `Recall@1 0.6527`, `Recall@5 0.9843`, `MRR 0.8049`\n- `Stella`: `Recall@1 0.4258`, `Recall@5 0.9791`, `MRR 0.6465`\n\n### Current GPU Model Snapshot\n\n| Model | LongMemEval R@5 | LongMemEval Time | LoCoMo Avg Recall | MemBench R@5 | ConvoMem Avg Recall |\n|---|---:|---:|---:|---:|---:|\n| `all-MiniLM-L6-v2` | 0.982 | 14.4s | 0.915 | 0.778 | 0.931 |\n| `bge-small-en-v1.5` | 0.990 | 23.0s | 0.941 | 0.804 | 0.898 |\n| `bge-base-en-v1.5` | 0.992 | 44.1s | 0.949 | 0.802 | 0.920 |\n\nFor methodology, machine specs, charts, and raw JSON outputs, see:\n\n- [`benchmarks/README.md`](benchmarks/README.md)\n- [`benchmarks/REPORT.md`](benchmarks/REPORT.md)\n- [`benchmarks/METHODOLOGY.md`](benchmarks/METHODOLOGY.md)\n- [`benchmarks/MEMPALACE-COMPARISON.md`](benchmarks/MEMPALACE-COMPARISON.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodysnider%2Ftagmem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodysnider%2Ftagmem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodysnider%2Ftagmem/lists"}