{"id":50153954,"url":"https://github.com/genegulanesjr/lapis","last_synced_at":"2026-05-24T10:00:42.300Z","repository":{"id":355360567,"uuid":"1226586920","full_name":"GeneGulanesJr/LaPis","owner":"GeneGulanesJr","description":"💎 LaPis - Persistent memory for the Pi coding agent. One SQLite DB, zero cloud, zero API keys.","archived":false,"fork":false,"pushed_at":"2026-05-18T03:32:11.000Z","size":3756,"stargazers_count":16,"open_issues_count":0,"forks_count":4,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-18T03:47:19.586Z","etag":null,"topics":["coding-agent","lapis","memory","memory-management","pi","sqlite"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GeneGulanesJr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"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":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-05-01T15:34:44.000Z","updated_at":"2026-05-18T03:31:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"eb856213-fd4a-4f63-9f22-dd61ceaae162","html_url":"https://github.com/GeneGulanesJr/LaPis","commit_stats":null,"previous_names":["genegulanesjr/pimemoryextension","genegulanesjr/lapis"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/GeneGulanesJr/LaPis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeneGulanesJr%2FLaPis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeneGulanesJr%2FLaPis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeneGulanesJr%2FLaPis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeneGulanesJr%2FLaPis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GeneGulanesJr","download_url":"https://codeload.github.com/GeneGulanesJr/LaPis/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GeneGulanesJr%2FLaPis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33429192,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-23T22:14:44.296Z","status":"online","status_checked_at":"2026-05-24T02:00:06.296Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["coding-agent","lapis","memory","memory-management","pi","sqlite"],"created_at":"2026-05-24T10:00:23.994Z","updated_at":"2026-05-24T10:00:42.266Z","avatar_url":"https://github.com/GeneGulanesJr.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LaPis\n\nPersistent memory for the [Pi coding agent](https://github.com/earendil-works/pi-coding-agent). LaPis gives Pi a local memory layer for decisions, bugfixes, patterns, indexed code, indexed docs, and session context.\n\nIt runs as one Pi extension plus one local Node.js backend. Storage is SQLite by default at `~/.pi/memory/memory.db`; there are no cloud dependencies and no API keys.\n\n## Architecture\n\nLaPis is a modular monolith: one installable extension with clear internal ownership between Pi adapters, CLI routing, feature services, and shared platform/storage code. The extension calls the backend through in-process `dispatch()` when possible, with child-process fallback for streaming operations such as indexing.\n\n![LaPis Modular Memory Architecture](memory-layer-architecture.png)\n\n### Module boundaries\n\n![LaPis module boundaries](docs/diagrams/lapis-module-boundaries.png)\n\n### Memory lifecycle\n\n![LaPis memory lifecycle](docs/diagrams/lapis-memory-lifecycle.png)\n\nFor dependency rules and module ownership details, see [`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md) and [`docs/MODULE_MAP.md`](docs/MODULE_MAP.md).\n\n## Install\n\n```bash\npi install git:github.com/GeneGulanesJr/LaPis\n```\n\nRestart Pi and memory auto-wires on session start. Use `pi update --extensions` to keep it up to date.\n\nLaPis does not install npm dependencies at runtime. If you are running from a local clone or developing the extension, install dependencies explicitly:\n\n```bash\nnpm install\n```\n\n## What It Does\n\n- **Remembers across sessions** - decisions, bugfixes, patterns, discoveries, and constraints persist.\n- **Auto-injects context** - new sessions start with relevant memories loaded.\n- **Indexes code** - web-tree-sitter parses JS/TS/TSX/Go/Python/Rust/SQL for semantic code lookup and analysis.\n- **Indexes docs** - Markdown sections, links, glossary terms, and code examples become searchable.\n- **Tracks trust** - memories linked to changed code lose confidence; stable linked code recovers trust.\n- **Deduplicates memory** - similar saves are merged or flagged before they clutter recall.\n- **Manages workspaces** - project isolation is explicit through create/list/archive workflows.\n- **Cleans stale memory** - the Dream Cycle removes superseded, never-useful, and replaced memories based on quality signals.\n\n## Benchmarks\n\n### Token Efficiency\n\nThe wire format (`wire-format.js`) uses compact encoding to reduce the token footprint of analysis responses inside Pi's context window. The benchmark runs real CLI commands against indexed repos, passes output through `compactResponse()`, and compares byte sizes.\n\nRun it with:\n\n```bash\nnode bench/bench-tokens.js\n```\n\nLatest local run: May 24, 2026, with fresh reindexes for both repos. `call-hierarchy` and `blast-radius` were skipped because the benchmark could not select a representative symbol with callers.\n\n#### Percentage Saved per Tool\n\n| Tool         | LaPis / PiMemoryExtension | PCBuilder |\n| :----------- | :-----------------------: | :-------: |\n| importance   |            21%            |    24%    |\n| hotspots     |            0%             |    0%     |\n| dead-code    |            44%            |    50%    |\n| coupling     |            37%            |    40%    |\n| extraction   |            23%            |    22%    |\n| import-graph |            18%            |    20%    |\n| cycles       |            0%             |    0%     |\n| **overall**  |          **40%**          |  **49%**  |\n\n#### Total Savings\n\n|                | LaPis / PiMemoryExtension |       PCBuilder        |\n| :------------- | :-----------------------: | :--------------------: |\n| Repo size      |  292 files / 6,913 symbols | 171 files / 207,599 symbols |\n| Raw JSON       |         692.6 KB          |        36.7 MB         |\n| Compact format |         417.5 KB          |        18.5 MB         |\n| Bytes saved    |         275.1 KB          |        18.1 MB         |\n| Tokens saved   |       ~80,500 tokens      |    ~5,436,007 tokens   |\n\nSee [`bench/README.md`](bench/README.md) for benchmark usage and interpretation notes.\n\n### Paired Memory\n\nThe paired benchmark measures whether memory helps by running the same task twice: once with LaPis disabled and once with LaPis active. It is an internal regression and directional benchmark, not a comprehensive external evaluation.\n\nRun it with:\n\n```bash\nnpm run bench:pi-paired\n```\n\nLatest run: `bench/results/pi-paired-2026-05-24T06-53-22-629Z/report.json`\n\n| Metric        | Memory Off | Memory On | Delta     |\n| ------------- | ---------- | --------- | --------- |\n| Facts correct | 17/18      | 18/18     | +1 fact   |\n| Active tokens | 33,842     | 7,019     | -79.3%    |\n| Wall time     | ~212s      | ~137s     | -35.4%    |\n\n#### Per-category Breakdown\n\n| Category         | Facts (off -\u003e on) | Tokens (off -\u003e on) | Savings |\n| ---------------- | ----------------- | ------------------ | ------- |\n| prior-decision   | 2/3 -\u003e 3/3        | 10,730 -\u003e 996      | 90.7%   |\n| bug-history      | 3/3 -\u003e 3/3        | 3,485 -\u003e 595       | 82.9%   |\n| staleness        | 3/3 -\u003e 3/3        | 10,377 -\u003e 508      | 95.1%   |\n| navigation       | 3/3 -\u003e 3/3        | 2,327 -\u003e 89        | 96.2%   |\n| negative-control | 6/6 -\u003e 6/6        | 6,923 -\u003e 4,831     | 30.2%   |\n\nMemory-on achieved perfect accuracy with 79.3% fewer active tokens overall. Memory-dependent tasks saved 82.9-96.2% active tokens in this run.\n\n## Requirements\n\n- Node.js\n- `@libsql/client` for async local SQLite/libSQL access\n- No Python dependency\n- No API keys or cloud services\n\n## Documentation\n\n- [`CONTRIBUTING.md`](CONTRIBUTING.md) - contributor workflow and checks.\n- [`docs/ARCHITECTURE.md`](docs/ARCHITECTURE.md) - architecture overview and dependency rules.\n- [`docs/MODULE_MAP.md`](docs/MODULE_MAP.md) - module ownership and entry points.\n- [`docs/COMMANDS.md`](docs/COMMANDS.md) - command reference.\n- [`docs/CONFIGURATION.md`](docs/CONFIGURATION.md) - config file and stored data.\n- [`docs/DREAM_CYCLE.md`](docs/DREAM_CYCLE.md) - stale-memory cleanup behavior.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgenegulanesjr%2Flapis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgenegulanesjr%2Flapis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgenegulanesjr%2Flapis/lists"}