agemem 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. agemem-0.1.0/.gitignore +30 -0
  2. agemem-0.1.0/CHANGELOG.md +19 -0
  3. agemem-0.1.0/LICENSE +21 -0
  4. agemem-0.1.0/PKG-INFO +127 -0
  5. agemem-0.1.0/README.md +101 -0
  6. agemem-0.1.0/THIRD_PARTY.md +70 -0
  7. agemem-0.1.0/agemem/LICENSE.raw-rag +21 -0
  8. agemem-0.1.0/agemem/RAW_RAG_ATTRIBUTION.md +22 -0
  9. agemem-0.1.0/agemem/__init__.py +2 -0
  10. agemem-0.1.0/agemem/cli.py +129 -0
  11. agemem-0.1.0/agemem/config.py +133 -0
  12. agemem-0.1.0/agemem/data/qsiv-linux-py312.lock +90 -0
  13. agemem-0.1.0/agemem/deciders.py +317 -0
  14. agemem-0.1.0/agemem/engine.py +311 -0
  15. agemem-0.1.0/agemem/evidence.py +116 -0
  16. agemem-0.1.0/agemem/hooks.py +157 -0
  17. agemem-0.1.0/agemem/mcp.py +83 -0
  18. agemem-0.1.0/agemem/mcp_install.py +101 -0
  19. agemem-0.1.0/agemem/notes/LICENSE.jevmem +21 -0
  20. agemem-0.1.0/agemem/notes/UPSTREAM.json +24 -0
  21. agemem-0.1.0/agemem/notes/__init__.py +1 -0
  22. agemem-0.1.0/agemem/notes/config.py +81 -0
  23. agemem-0.1.0/agemem/notes/consolidate.py +213 -0
  24. agemem-0.1.0/agemem/notes/decide.py +4 -0
  25. agemem-0.1.0/agemem/notes/decider.py +64 -0
  26. agemem-0.1.0/agemem/notes/questions.py +229 -0
  27. agemem-0.1.0/agemem/notes/retrieve.py +334 -0
  28. agemem-0.1.0/agemem/notes/screen.py +63 -0
  29. agemem-0.1.0/agemem/notes/store.py +490 -0
  30. agemem-0.1.0/agemem/notes/vectorindex.py +78 -0
  31. agemem-0.1.0/agemem/notes/write.py +164 -0
  32. agemem-0.1.0/agemem/project.py +87 -0
  33. agemem-0.1.0/agemem/providers.py +165 -0
  34. agemem-0.1.0/agemem/qsiv_shared.py +240 -0
  35. agemem-0.1.0/agemem/qsiv_worker.py +33 -0
  36. agemem-0.1.0/agemem/raw_rag.py +134 -0
  37. agemem-0.1.0/agemem/setup.py +118 -0
  38. agemem-0.1.0/docs/AGENT_INTEGRATION.md +61 -0
  39. agemem-0.1.0/docs/ARCHITECTURE.md +66 -0
  40. agemem-0.1.0/docs/CONFIGURATION.md +117 -0
  41. agemem-0.1.0/docs/HOOKS.md +84 -0
  42. agemem-0.1.0/docs/INSTALLATION.md +344 -0
  43. agemem-0.1.0/docs/LOCAL_BACKENDS.md +70 -0
  44. agemem-0.1.0/docs/MANUAL_TESTING.md +83 -0
  45. agemem-0.1.0/docs/PUBLISHING.md +61 -0
  46. agemem-0.1.0/docs/QSIV_INSTALLATION.md +43 -0
  47. agemem-0.1.0/docs/RAW_RAG.md +81 -0
  48. agemem-0.1.0/docs/RELEASE_0.1.0.md +74 -0
  49. agemem-0.1.0/docs/diagrams/README.md +17 -0
  50. agemem-0.1.0/docs/diagrams/architecture.puml +46 -0
  51. agemem-0.1.0/docs/diagrams/architecture.svg +1 -0
  52. agemem-0.1.0/docs/diagrams/project-init.puml +50 -0
  53. agemem-0.1.0/docs/diagrams/project-init.svg +1 -0
  54. agemem-0.1.0/docs/diagrams/recall.puml +38 -0
  55. agemem-0.1.0/docs/diagrams/recall.svg +1 -0
  56. agemem-0.1.0/pyproject.toml +34 -0
  57. agemem-0.1.0/scripts/check_release.py +38 -0
  58. agemem-0.1.0/scripts/release_notes.py +33 -0
  59. agemem-0.1.0/scripts/smoke_install.py +69 -0
  60. agemem-0.1.0/tests_live/test_coding_memory.py +26 -0
  61. agemem-0.1.0/tests_live/test_config.py +141 -0
  62. agemem-0.1.0/tests_live/test_evidence.py +17 -0
  63. agemem-0.1.0/tests_live/test_hooks.py +141 -0
  64. agemem-0.1.0/tests_live/test_internal_raw_rag.py +86 -0
  65. agemem-0.1.0/tests_live/test_live.py +262 -0
  66. agemem-0.1.0/tests_live/test_mcp_install.py +94 -0
  67. agemem-0.1.0/tests_live/test_mcp_recall.py +41 -0
  68. agemem-0.1.0/tests_live/test_note_compatibility.py +39 -0
  69. agemem-0.1.0/tests_live/test_project_setup.py +189 -0
  70. agemem-0.1.0/tests_live/test_provider_setup.py +149 -0
  71. agemem-0.1.0/tests_live/test_qsiv_gpu_gate.py +41 -0
  72. agemem-0.1.0/tests_live/test_qsiv_shared.py +85 -0
  73. agemem-0.1.0/tests_live/test_qsiv_worker.py +71 -0
  74. agemem-0.1.0/tests_live/test_raw_rag.py +31 -0
  75. agemem-0.1.0/tests_live/test_release_notes.py +19 -0
@@ -0,0 +1,30 @@
1
+ .venv/
2
+ __pycache__/
3
+ *.pyc
4
+ .env
5
+ .env.*
6
+ .cache/
7
+ vendor/
8
+ runs/
9
+ *.db
10
+
11
+ .venv-*/
12
+ .agemem/local/
13
+
14
+ # Maintainer workspace (keep local copies, exclude from public source)
15
+ /HANDOFF.md
16
+ /memory/
17
+ /experiments/
18
+
19
+ # Local benchmark/probe output and findings
20
+ /reports/
21
+
22
+ # Python build and tool output
23
+ /dist/
24
+ /build/
25
+ *.egg-info/
26
+ .pytest_cache/
27
+ .ruff_cache/
28
+ .mypy_cache/
29
+ .coverage
30
+ htmlcov/
@@ -0,0 +1,19 @@
1
+ # Changelog
2
+
3
+ ## [0.1.0] - 2026-10-26
4
+
5
+ ### Added
6
+
7
+ - Initial 0.1.0 candidate: project-memory CLI and stdio MCP for recall, capture,
8
+ screened notes, indexing and maintenance.
9
+ - Guided and unattended project setup, versioned private YAML configuration,
10
+ and MCP registration for Codex, Cursor and Claude Code.
11
+ - Local read-only Claude Code/Codex hooks installed by default during project setup and explicit executable
12
+ launchers for testing unpublished source builds.
13
+ - Local BM25/dense retrieval, optional adapted RAW-RAG retrieval, hosted Jev
14
+ decisions and optional GPU QSIV, ollaya and cascade providers.
15
+ - Installation, agent guidance and PlantUML architecture/setup/recall diagrams.
16
+
17
+ Experimental first release. Python 3.12–3.14; QSIV installation requires Linux x86_64
18
+ and a compatible NVIDIA GPU. YAML schema version 1 accepts existing unversioned
19
+ configuration. Database and configuration migrations remain explicit.
agemem-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Daniel Illescas Romero
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
agemem-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,127 @@
1
+ Metadata-Version: 2.5
2
+ Name: agemem
3
+ Version: 0.1.0
4
+ Summary: Project memory: git-tracked working state, jev-mem decisions, and original evidence
5
+ Project-URL: Repository, https://github.com/illescasDaniel/agemem
6
+ Project-URL: Documentation, https://github.com/illescasDaniel/agemem/blob/main/docs/INSTALLATION.md
7
+ Project-URL: Issues, https://github.com/illescasDaniel/agemem/issues
8
+ Author-email: Daniel Illescas Romero <illescas.daniel@protonmail.com>
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ License-File: THIRD_PARTY.md
12
+ License-File: agemem/LICENSE.raw-rag
13
+ License-File: agemem/notes/LICENSE.jevmem
14
+ Requires-Python: <3.15,>=3.12
15
+ Requires-Dist: fastembed<1,>=0.8.1
16
+ Requires-Dist: mcp<3,>=2
17
+ Requires-Dist: numpy<3,>=2.4
18
+ Requires-Dist: pyyaml<7,>=6
19
+ Requires-Dist: tomlkit<1,>=0.13
20
+ Requires-Dist: typesafe-sdk<1,>=0.7.2
21
+ Provides-Extra: compatibility
22
+ Requires-Dist: jevmem==0.4.0; extra == 'compatibility'
23
+ Provides-Extra: raw
24
+ Requires-Dist: tiktoken<1,>=0.8; extra == 'raw'
25
+ Description-Content-Type: text/markdown
26
+
27
+ # agemem
28
+
29
+ [![PyPI](https://img.shields.io/pypi/v/agemem?logo=pypi&label=PyPI)](https://pypi.org/project/agemem/)
30
+
31
+ Experimental coding-project memory: a readable Markdown memory bank, screened SQLite notes, and cited original evidence. Jev is the default decision model. GPU-only QSIV, local ollaya `jevk5:4b`, and a QSIV → Jev confidence cascade are optional.
32
+
33
+ The answering agent receives current context, selected durable notes and source excerpts. Decision models screen, classify and select memories; your coding agent writes the final answer. No automatic conversation capture or automatic bank rewriting is installed.
34
+
35
+ ![Agemem architecture](https://raw.githubusercontent.com/illescasDaniel/agemem/main/docs/diagrams/architecture.svg)
36
+
37
+ ## Install and use
38
+
39
+ Requires Git and [uv](https://docs.astral.sh/uv/). From your project directory:
40
+
41
+ ```bash
42
+ uvx --python 3.12 agemem@0.1.0 project init
43
+ ```
44
+
45
+ Or paste this prompt into your coding agent:
46
+
47
+ > Integrate Agemem 0.1.0 into this project using the linked installation and
48
+ > agent-integration guides. Inspect the environment and existing setup first.
49
+ > Ask which clients to configure (Claude Code only, or also Cursor/Codex if
50
+ > detected), whether to use hosted Jev, local GPU QSIV, or the experimental
51
+ > QSIV → Jev cascade, and any installation constraints. Recommend considering
52
+ > the cascade if I have a compatible NVIDIA GPU. Explain QSIV's hardware and
53
+ > download requirements and that cascade fallback uses hosted Jev. Have me supply
54
+ > a Jev key privately through configuration or the environment, never in chat.
55
+ > Run `uvx --python 3.12 agemem@0.1.0 project init --model <jev|qsiv> --mcp <selected clients> --no-input`
56
+ > with the agreed choices; `claude` means Claude Code. For cascade, initialize
57
+ > with QSIV and then configure the cascade as described in the local backends
58
+ > guide; it is not a `--model` option. Preserve existing settings
59
+ > and guidance, resolve conflicts with me, and add the suggested memory workflow
60
+ > to the appropriate agent instructions. Agree on validation, run provider
61
+ > diagnostics and an MCP handshake/tool-list/recall smoke test, and ask before
62
+ > tests that incur hosted API charges. Report what passed, any skipped checks,
63
+ > and required client restart or approval steps.
64
+
65
+ Setup connects Codex, Cursor or Claude Code and configures hosted Jev or local
66
+ GPU QSIV. Restart your client and enable the server.
67
+
68
+ If you have a compatible NVIDIA GPU, consider the experimental [confidence
69
+ cascade](https://github.com/illescasDaniel/agemem/blob/main/docs/LOCAL_BACKENDS.md#confidence-cascade):
70
+ QSIV handles decisions locally and sends low-confidence decisions to hosted Jev.
71
+ It requires both QSIV setup and a Jev key; fallback can incur API charges. The
72
+ default cutoff is not a guarantee of correctness, and cascade may be slower.
73
+
74
+ ### Give your agent memory instructions
75
+
76
+ Add the [suggested memory workflow](https://github.com/illescasDaniel/agemem/blob/main/docs/AGENT_INTEGRATION.md)
77
+ to your project’s agent instructions (for example, `AGENTS.md` for Codex or
78
+ `CLAUDE.md` for Claude Code). This tells the agent when to recall, verify,
79
+ capture and maintain memory; installation does not edit these files.
80
+
81
+ [Claude/Codex lifecycle hooks](https://github.com/illescasDaniel/agemem/blob/main/docs/HOOKS.md)
82
+ load local context automatically and are installed by default for those clients.
83
+ Use `--no-hooks` to skip installation. Hooks complement
84
+ the instructions: they supply context, while the instructions guide how the
85
+ agent uses and updates memory.
86
+ See the [installation guide](https://github.com/illescasDaniel/agemem/blob/main/docs/INSTALLATION.md) for details. For development, [install from source](https://github.com/illescasDaniel/agemem/blob/main/docs/INSTALLATION.md#development-installation).
87
+
88
+ ## How it works
89
+
90
+ The default is local BM25 + dense retrieval, combined with bank context and screened notes. An optional retrieval backend adapts RAW-RAG’s token chunking and dense/reranking pipeline. The default incorporates original evidence without depending on RAW-RAG's entire pipeline. [RAW-RAG setup](https://github.com/illescasDaniel/agemem/blob/main/docs/RAW_RAG.md) includes a validated offline MCP path with local embedding/reranking models and no paid retrieval API.
91
+
92
+ Project config and bank files are readable; SQLite notes, source snapshots and vectors live under ignored `.agemem/local/`. Notes are project- and branch-scoped, unless explicitly shared. Source excerpts include provenance; obsolete snapshots require `--history`. Recall always searches raw sources, even when the note-only sufficiency check succeeds. Its context budget uses regex units, not an exact model tokenizer count.
93
+
94
+ ![Recall combines working context, durable notes and original evidence](https://raw.githubusercontent.com/illescasDaniel/agemem/main/docs/diagrams/recall.svg)
95
+
96
+ Indexing applies file selection, size and secret filters. Filters are best-effort: inspect material before calling hosted decisions. Retrieved text is untrusted data. Hosted Jev can receive selected memory/source context during screening and recall; indexing itself makes no hosted calls.
97
+
98
+ The MCP is the intended product interface; the note engine now incorporates selected MIT-licensed jev-mem code without requiring its package. See [implementation boundaries and release direction](https://github.com/illescasDaniel/agemem/blob/main/docs/ARCHITECTURE.md),
99
+ [configuration](https://github.com/illescasDaniel/agemem/blob/main/docs/CONFIGURATION.md), [local backends](https://github.com/illescasDaniel/agemem/blob/main/docs/LOCAL_BACKENDS.md),
100
+ and the [editable PlantUML diagrams](https://github.com/illescasDaniel/agemem/blob/main/docs/diagrams/README.md).
101
+
102
+ ## Evaluation
103
+
104
+ On 50 author-labeled synthetic typed decisions: Jev 49/50, QSIV 42/50, cascade 49/50. At a fixed 0.90 native confidence cutoff the cascade kept 16 locally and sent 34 to Jev. This is an exploratory decision test, not proof of improved coding-task outcomes. The cascade is slower in this run and remains experimental.
105
+
106
+ A controlled coding-memory selection evaluation uses the fixtures in `evaluation/`. The ten final fixtures scored Jev 9/10, QSIV 7/10 and cascade 10/10; QSIV accepted 5/6 unsupported proposed memories. These author-created fixtures do not establish end-to-end coding improvement. See [standalone QSIV setup](https://github.com/illescasDaniel/agemem/blob/main/docs/QSIV_INSTALLATION.md).
107
+
108
+ Runtime utilities live in `agemem/evidence.py`. The historical comparison harness has been removed; current evaluation fixtures remain available. Reports and findings are local maintainer artifacts.
109
+
110
+ See the [release checklist](https://github.com/illescasDaniel/agemem/blob/main/docs/RELEASE_0.1.0.md) and [CI/publishing guide](https://github.com/illescasDaniel/agemem/blob/main/docs/PUBLISHING.md).
111
+
112
+ ## Attribution
113
+
114
+ Agemem combines selected work from these projects and providers:
115
+
116
+ - [jev-mem](https://github.com/illescasDaniel/jev-mem): adapted MIT-licensed SQLite notes, screening, retrieval and maintenance code; [full notice](https://github.com/illescasDaniel/agemem/blob/main/agemem/notes/LICENSE.jevmem).
117
+ - [RAW-RAG](https://github.com/Litmeb/RAW-RAG): adapted MIT-licensed token-window and dense/reranking retrieval; [full notice](https://github.com/illescasDaniel/agemem/blob/main/agemem/LICENSE.raw-rag) and [adaptation details](https://github.com/illescasDaniel/agemem/blob/main/agemem/RAW_RAG_ATTRIBUTION.md).
118
+ - [QSIV](https://huggingface.co/djinn-san/QSIV): optional local decision model and runtime, downloaded separately under Apache-2.0 with its original LICENSE and NOTICE.
119
+ - [Jev / TypeSafe AI](https://typesafe.ai): default hosted decision provider through its separately installed [Python SDK](https://github.com/typesafe-ai/typesafe-sdk-python); Jev weights and service implementation are not bundled.
120
+
121
+ See [third-party attribution](https://github.com/illescasDaniel/agemem/blob/main/THIRD_PARTY.md) for versions, source hashes, license boundaries and additional credits.
122
+
123
+ ## Checks
124
+
125
+ ```bash
126
+ .venv/bin/python -m unittest discover -s tests_live -q
127
+ ```
agemem-0.1.0/README.md ADDED
@@ -0,0 +1,101 @@
1
+ # agemem
2
+
3
+ [![PyPI](https://img.shields.io/pypi/v/agemem?logo=pypi&label=PyPI)](https://pypi.org/project/agemem/)
4
+
5
+ Experimental coding-project memory: a readable Markdown memory bank, screened SQLite notes, and cited original evidence. Jev is the default decision model. GPU-only QSIV, local ollaya `jevk5:4b`, and a QSIV → Jev confidence cascade are optional.
6
+
7
+ The answering agent receives current context, selected durable notes and source excerpts. Decision models screen, classify and select memories; your coding agent writes the final answer. No automatic conversation capture or automatic bank rewriting is installed.
8
+
9
+ ![Agemem architecture](https://raw.githubusercontent.com/illescasDaniel/agemem/main/docs/diagrams/architecture.svg)
10
+
11
+ ## Install and use
12
+
13
+ Requires Git and [uv](https://docs.astral.sh/uv/). From your project directory:
14
+
15
+ ```bash
16
+ uvx --python 3.12 agemem@0.1.0 project init
17
+ ```
18
+
19
+ Or paste this prompt into your coding agent:
20
+
21
+ > Integrate Agemem 0.1.0 into this project using the linked installation and
22
+ > agent-integration guides. Inspect the environment and existing setup first.
23
+ > Ask which clients to configure (Claude Code only, or also Cursor/Codex if
24
+ > detected), whether to use hosted Jev, local GPU QSIV, or the experimental
25
+ > QSIV → Jev cascade, and any installation constraints. Recommend considering
26
+ > the cascade if I have a compatible NVIDIA GPU. Explain QSIV's hardware and
27
+ > download requirements and that cascade fallback uses hosted Jev. Have me supply
28
+ > a Jev key privately through configuration or the environment, never in chat.
29
+ > Run `uvx --python 3.12 agemem@0.1.0 project init --model <jev|qsiv> --mcp <selected clients> --no-input`
30
+ > with the agreed choices; `claude` means Claude Code. For cascade, initialize
31
+ > with QSIV and then configure the cascade as described in the local backends
32
+ > guide; it is not a `--model` option. Preserve existing settings
33
+ > and guidance, resolve conflicts with me, and add the suggested memory workflow
34
+ > to the appropriate agent instructions. Agree on validation, run provider
35
+ > diagnostics and an MCP handshake/tool-list/recall smoke test, and ask before
36
+ > tests that incur hosted API charges. Report what passed, any skipped checks,
37
+ > and required client restart or approval steps.
38
+
39
+ Setup connects Codex, Cursor or Claude Code and configures hosted Jev or local
40
+ GPU QSIV. Restart your client and enable the server.
41
+
42
+ If you have a compatible NVIDIA GPU, consider the experimental [confidence
43
+ cascade](https://github.com/illescasDaniel/agemem/blob/main/docs/LOCAL_BACKENDS.md#confidence-cascade):
44
+ QSIV handles decisions locally and sends low-confidence decisions to hosted Jev.
45
+ It requires both QSIV setup and a Jev key; fallback can incur API charges. The
46
+ default cutoff is not a guarantee of correctness, and cascade may be slower.
47
+
48
+ ### Give your agent memory instructions
49
+
50
+ Add the [suggested memory workflow](https://github.com/illescasDaniel/agemem/blob/main/docs/AGENT_INTEGRATION.md)
51
+ to your project’s agent instructions (for example, `AGENTS.md` for Codex or
52
+ `CLAUDE.md` for Claude Code). This tells the agent when to recall, verify,
53
+ capture and maintain memory; installation does not edit these files.
54
+
55
+ [Claude/Codex lifecycle hooks](https://github.com/illescasDaniel/agemem/blob/main/docs/HOOKS.md)
56
+ load local context automatically and are installed by default for those clients.
57
+ Use `--no-hooks` to skip installation. Hooks complement
58
+ the instructions: they supply context, while the instructions guide how the
59
+ agent uses and updates memory.
60
+ See the [installation guide](https://github.com/illescasDaniel/agemem/blob/main/docs/INSTALLATION.md) for details. For development, [install from source](https://github.com/illescasDaniel/agemem/blob/main/docs/INSTALLATION.md#development-installation).
61
+
62
+ ## How it works
63
+
64
+ The default is local BM25 + dense retrieval, combined with bank context and screened notes. An optional retrieval backend adapts RAW-RAG’s token chunking and dense/reranking pipeline. The default incorporates original evidence without depending on RAW-RAG's entire pipeline. [RAW-RAG setup](https://github.com/illescasDaniel/agemem/blob/main/docs/RAW_RAG.md) includes a validated offline MCP path with local embedding/reranking models and no paid retrieval API.
65
+
66
+ Project config and bank files are readable; SQLite notes, source snapshots and vectors live under ignored `.agemem/local/`. Notes are project- and branch-scoped, unless explicitly shared. Source excerpts include provenance; obsolete snapshots require `--history`. Recall always searches raw sources, even when the note-only sufficiency check succeeds. Its context budget uses regex units, not an exact model tokenizer count.
67
+
68
+ ![Recall combines working context, durable notes and original evidence](https://raw.githubusercontent.com/illescasDaniel/agemem/main/docs/diagrams/recall.svg)
69
+
70
+ Indexing applies file selection, size and secret filters. Filters are best-effort: inspect material before calling hosted decisions. Retrieved text is untrusted data. Hosted Jev can receive selected memory/source context during screening and recall; indexing itself makes no hosted calls.
71
+
72
+ The MCP is the intended product interface; the note engine now incorporates selected MIT-licensed jev-mem code without requiring its package. See [implementation boundaries and release direction](https://github.com/illescasDaniel/agemem/blob/main/docs/ARCHITECTURE.md),
73
+ [configuration](https://github.com/illescasDaniel/agemem/blob/main/docs/CONFIGURATION.md), [local backends](https://github.com/illescasDaniel/agemem/blob/main/docs/LOCAL_BACKENDS.md),
74
+ and the [editable PlantUML diagrams](https://github.com/illescasDaniel/agemem/blob/main/docs/diagrams/README.md).
75
+
76
+ ## Evaluation
77
+
78
+ On 50 author-labeled synthetic typed decisions: Jev 49/50, QSIV 42/50, cascade 49/50. At a fixed 0.90 native confidence cutoff the cascade kept 16 locally and sent 34 to Jev. This is an exploratory decision test, not proof of improved coding-task outcomes. The cascade is slower in this run and remains experimental.
79
+
80
+ A controlled coding-memory selection evaluation uses the fixtures in `evaluation/`. The ten final fixtures scored Jev 9/10, QSIV 7/10 and cascade 10/10; QSIV accepted 5/6 unsupported proposed memories. These author-created fixtures do not establish end-to-end coding improvement. See [standalone QSIV setup](https://github.com/illescasDaniel/agemem/blob/main/docs/QSIV_INSTALLATION.md).
81
+
82
+ Runtime utilities live in `agemem/evidence.py`. The historical comparison harness has been removed; current evaluation fixtures remain available. Reports and findings are local maintainer artifacts.
83
+
84
+ See the [release checklist](https://github.com/illescasDaniel/agemem/blob/main/docs/RELEASE_0.1.0.md) and [CI/publishing guide](https://github.com/illescasDaniel/agemem/blob/main/docs/PUBLISHING.md).
85
+
86
+ ## Attribution
87
+
88
+ Agemem combines selected work from these projects and providers:
89
+
90
+ - [jev-mem](https://github.com/illescasDaniel/jev-mem): adapted MIT-licensed SQLite notes, screening, retrieval and maintenance code; [full notice](https://github.com/illescasDaniel/agemem/blob/main/agemem/notes/LICENSE.jevmem).
91
+ - [RAW-RAG](https://github.com/Litmeb/RAW-RAG): adapted MIT-licensed token-window and dense/reranking retrieval; [full notice](https://github.com/illescasDaniel/agemem/blob/main/agemem/LICENSE.raw-rag) and [adaptation details](https://github.com/illescasDaniel/agemem/blob/main/agemem/RAW_RAG_ATTRIBUTION.md).
92
+ - [QSIV](https://huggingface.co/djinn-san/QSIV): optional local decision model and runtime, downloaded separately under Apache-2.0 with its original LICENSE and NOTICE.
93
+ - [Jev / TypeSafe AI](https://typesafe.ai): default hosted decision provider through its separately installed [Python SDK](https://github.com/typesafe-ai/typesafe-sdk-python); Jev weights and service implementation are not bundled.
94
+
95
+ See [third-party attribution](https://github.com/illescasDaniel/agemem/blob/main/THIRD_PARTY.md) for versions, source hashes, license boundaries and additional credits.
96
+
97
+ ## Checks
98
+
99
+ ```bash
100
+ .venv/bin/python -m unittest discover -s tests_live -q
101
+ ```
@@ -0,0 +1,70 @@
1
+ # Attribution and third-party material
2
+
3
+ Agemem builds on the following projects and services. Source-code licenses,
4
+ model licenses and hosted-service terms apply separately.
5
+
6
+ ## jev-mem
7
+
8
+ Selected code in `agemem/notes/` is adapted from
9
+ [jev-mem](https://github.com/illescasDaniel/jev-mem) 0.4.0, copyright 2026
10
+ Daniel Illescas Romero, under the MIT License. The complete copyright and
11
+ permission notice is bundled in [LICENSE.jevmem](agemem/notes/LICENSE.jevmem).
12
+ [UPSTREAM.json](agemem/notes/UPSTREAM.json) records original file hashes and
13
+ adaptations.
14
+
15
+ The SQLite store, policy prompts, screening, retrieval, consolidation and
16
+ matrix index are retained. The upstream hosted client, global settings, hooks
17
+ and remote index backends are excluded. Agemem's live MCP uses this internal
18
+ adaptation; the external jev-mem package is optional for database compatibility tests only.
19
+
20
+ ## RAW-RAG
21
+
22
+ [RAW-RAG](https://github.com/Litmeb/RAW-RAG), copyright 2026 RAW-RAG
23
+ contributors, supplies the overlapping token-window and dense candidate /
24
+ reranking pipeline adapted in [agemem/raw_rag.py](agemem/raw_rag.py). The full
25
+ MIT notice is bundled in [LICENSE.raw-rag](agemem/LICENSE.raw-rag).
26
+ [RAW_RAG_ATTRIBUTION.md](agemem/RAW_RAG_ATTRIBUTION.md) records the pinned
27
+ revision `95639191e9547219b426710e50fe1a36235e26fc`, reference-file hash and
28
+ changes.
29
+
30
+ The live implementation uses local BGE embeddings and MiniLM reranking, with
31
+ Agemem's source provenance and scope filtering. It omits upstream answer
32
+ generation and remote model clients. This is an adaptation, not a reproduction
33
+ of RAW-RAG's full method or published results. It does not require a RAW-RAG
34
+ checkout.
35
+
36
+ ## QSIV
37
+
38
+ [QSIV](https://huggingface.co/djinn-san/QSIV), copyright 2026 the QSIV authors,
39
+ is an optional local decision runtime and model. Setup fetches revision
40
+ `f1ee842daf758c0ab535cf7d281c85439d6e4b25`; the full runtime and its weights are not bundled in the Agemem package. The downloaded model directory
41
+ retains its complete Apache-2.0
42
+ [LICENSE](https://huggingface.co/djinn-san/QSIV/blob/f1ee842daf758c0ab535cf7d281c85439d6e4b25/LICENSE)
43
+ and [NOTICE](https://huggingface.co/djinn-san/QSIV/blob/f1ee842daf758c0ab535cf7d281c85439d6e4b25/NOTICE).
44
+
45
+ QSIV's NOTICE credits the Qwen team / Alibaba Cloud for Qwen3.5-0.8B-Base and
46
+ its tokenizer, as well as the Gated DeltaNet and flash-linear-attention work.
47
+ Those notices and dependency licenses remain applicable. Our installer changes
48
+ only the downloaded runtime's NumPy dependency pin to match the tested
49
+ environment; it does not change QSIV inference code or weights.
50
+
51
+ ## Jev and TypeSafe AI
52
+
53
+ [Jev / TypeSafe AI](https://typesafe.ai) provides the default hosted decision
54
+ service, accessed through the
55
+ [TypeSafe Python SDK](https://github.com/typesafe-ai/typesafe-sdk-python).
56
+ Agemem includes its own provider adapter and depends on the SDK as a separately
57
+ installed package, which retains its own MIT license. It does not copy or
58
+ redistribute Jev model weights or the hosted service's implementation.
59
+ Hosted API terms and metering apply when that provider is explicitly used;
60
+ no credentials are included in this repository.
61
+
62
+ ## Other material
63
+
64
+ The [memory-bank](https://github.com/illescasDaniel/memory-bank) project is a
65
+ design reference; this workspace does not install a copy of its skill.
66
+
67
+
68
+ Embedding and reranking weights download separately through FastEmbed and
69
+ retain their respective model licenses. Other installed dependencies retain
70
+ their own licenses; the notices above do not relicense those dependencies.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 RAW-RAG contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,22 @@
1
+ # RAW-RAG attribution
2
+
3
+ `raw_rag.py` adapts the overlapping token-window algorithm and dense candidate /
4
+ reranking pipeline from RAW-RAG, MIT License, copyright 2026 RAW-RAG contributors.
5
+ Full upstream license: `LICENSE.raw-rag`, included in this package.
6
+
7
+ Upstream: https://github.com/Litmeb/RAW-RAG
8
+ Revision: `95639191e9547219b426710e50fe1a36235e26fc`
9
+ Reference: `methods/EverCore/evaluation/src/adapters/rag_adapter.py`
10
+ Reference file SHA256: `997c35db93feea77eed897b3d5640bd9cd6f114da40bff5128efae65a6466637`
11
+
12
+ This is a deliberate adaptation, not an upstream reproduction. Source records
13
+ are chunked separately (256 cl100k tokens, overlap32), with exact source IDs.
14
+ The original conversation headers, cross-turn windows, temporal filters,
15
+ remote embedding/reranking/answer clients, incremental conversation ingestion,
16
+ dynamic selection and optional PostgreSQL support are omitted. Agemem filters
17
+ project, branch and current snapshot visibility before calling this adapter.
18
+ BGE/MiniLM run locally; dense cosine top128 feeds rerank top15, followed by
19
+ Agemem's context budget. Model licenses remain separate from source licensing.
20
+
21
+ The live service uses only this adapted implementation; no upstream checkout or
22
+ comparison harness is required.
@@ -0,0 +1,2 @@
1
+ """Live project memory composed from a memory bank, jev-mem and source retrieval."""
2
+ __version__ = "0.1.0"
@@ -0,0 +1,129 @@
1
+ """User-facing project setup and live memory commands."""
2
+ import argparse
3
+ import json
4
+ import sys
5
+ from pathlib import Path
6
+
7
+ from .engine import Engine
8
+ from .project import initialize
9
+ from .config import initialize_user_config, doctor, provider_options
10
+
11
+
12
+ def main():
13
+ parser = argparse.ArgumentParser(description=__doc__)
14
+ parser.add_argument("--project", type=Path, default=Path.cwd(), help="Project checkout to use")
15
+ parser.add_argument("--offline", action="store_true", help="Never use hosted decisions or download embedding weights")
16
+ sub = parser.add_subparsers(dest="command", required=True)
17
+ p = sub.add_parser("project", help="Set up a project and its MCP connection")
18
+ project_init = p.add_subparsers(dest="project_command", required=True).add_parser("init", help="Ensure user config, project files, index and MCP registration")
19
+ clients = project_init.add_mutually_exclusive_group()
20
+ clients.add_argument("--client", choices=["codex", "cursor", "claude-code"], help="Register one client")
21
+ clients.add_argument("--mcp", nargs="+", choices=["codex", "cursor", "claude", "claude-code"], help="Register selected clients; claude means Claude Code")
22
+ project_init.add_argument("--model", choices=["jev", "qsiv"], help="Select the decision provider without prompting")
23
+ hook_options = project_init.add_mutually_exclusive_group()
24
+ hook_options.add_argument("--no-hooks", dest="hooks", action="store_false", help="Do not install lifecycle hooks")
25
+ hook_options.add_argument("--hooks", dest="hooks", action="store_true", help=argparse.SUPPRESS)
26
+ project_init.set_defaults(hooks=True)
27
+ project_init.add_argument("--executable", type=Path, help="Use an installed agemem executable instead of uvx (source testing)")
28
+ project_init.add_argument("--no-input", action="store_true", help="Never prompt; fail when required setup choices are missing")
29
+ project_init.add_argument("--retrieval", choices=["hybrid", "bm25", "raw-rag"], default="hybrid")
30
+ project_init.add_argument("--embedder", default="BAAI/bge-small-en-v1.5")
31
+ p = sub.add_parser("config", help="Manage user configuration")
32
+ p.add_subparsers(dest="config_command", required=True).add_parser("init", help="Create a private YAML template without overwriting existing settings")
33
+ p = sub.add_parser("provider", help="Set up optional local providers")
34
+ provider_sub = p.add_subparsers(dest="provider_command", required=True)
35
+ setup = provider_sub.add_parser("setup", help="Explicitly download models and install an isolated runtime")
36
+ setup.add_argument("provider_name", choices=["qsiv"])
37
+ setup.add_argument("--model-directory", type=Path)
38
+ setup.add_argument("--runtime-directory", type=Path)
39
+ setup.add_argument("--dry-run", action="store_true", help="Show actions without downloads or filesystem changes")
40
+ sub.add_parser("doctor", help="Check provider setup without inference or API calls")
41
+ p = sub.add_parser("init", help="Create missing bank/config files; preserve existing memory")
42
+ p.add_argument("--retrieval", choices=["hybrid", "bm25", "raw-rag"], default="hybrid")
43
+ p.add_argument("--embedder", default="BAAI/bge-small-en-v1.5")
44
+ sub.add_parser("index", help="Snapshot selected tracked project files; no hosted calls")
45
+ p = sub.add_parser("capture", help="Archive original text as untrusted source evidence")
46
+ p.add_argument("text")
47
+ p.add_argument("--label", default="event")
48
+ p.add_argument("--shared", action="store_true")
49
+ p = sub.add_parser("remember", help="Write a durable note through jev-mem's actual screens")
50
+ p.add_argument("text")
51
+ p.add_argument("--source-id")
52
+ p.add_argument("--shared", action="store_true")
53
+ p = sub.add_parser("recall", help="Read current bank, recall notes, and retrieve source evidence live")
54
+ p.add_argument("query")
55
+ p.add_argument("--budget", type=int)
56
+ p.add_argument("--history", action="store_true", help="Also search older file snapshots on this branch")
57
+ sub.add_parser("maintain", help="Screen pending notes and run jev-mem consolidation")
58
+ sub.add_parser("mcp", help="Run the project's MCP server over stdio")
59
+ p = sub.add_parser("mcp-install", help="Register this project with a coding client")
60
+ p.add_argument("--client", choices=["codex", "cursor", "claude-code"], help="Prompt when omitted")
61
+ p.add_argument("--dry-run", action="store_true", help="Preview registration without changing client configuration")
62
+ p.add_argument("--executable", type=Path, help="Use an installed agemem executable instead of uvx")
63
+ p = sub.add_parser("hooks-install", help="Install optional read-only lifecycle hooks")
64
+ p.add_argument("--client", nargs="+", choices=["codex", "claude", "claude-code"], required=True)
65
+ p.add_argument("--executable", type=Path)
66
+ p.add_argument("--dry-run", action="store_true")
67
+ p = sub.add_parser("hook", help="Handle client lifecycle JSON on stdin; local read-only context")
68
+ p.add_argument("event", choices=["session-start", "user-prompt"])
69
+ args = parser.parse_args()
70
+ try:
71
+ if args.command == "project":
72
+ from .setup import initialize_project
73
+ result = initialize_project(args.project, args.client, args.retrieval, args.embedder, args.offline, model=args.model, clients=args.mcp, no_input=args.no_input, hooks=args.hooks, executable=args.executable)
74
+ elif args.command == "config":
75
+ result = initialize_user_config()
76
+ elif args.command == "mcp-install":
77
+ from .mcp_install import install
78
+ result = install(args.project, args.client, args.dry_run, args.offline, args.executable)
79
+ elif args.command == "hooks-install":
80
+ from .hooks import install
81
+ result = install(args.project, args.client, args.executable, args.dry_run)
82
+ elif args.command == "hook":
83
+ from .hooks import run
84
+ run(args.project, args.event)
85
+ return
86
+ elif args.command == "provider":
87
+ from .providers import setup_qsiv
88
+ options = provider_options({})
89
+ if options["qsiv_runtime"] != "fp8":
90
+ raise ValueError("Automatic QSIV setup currently supports runtime fp8 only")
91
+ runtime_python = options.get("qsiv_python")
92
+ runtime_directory = args.runtime_directory or (Path(runtime_python).parent.parent if runtime_python else None)
93
+ result = setup_qsiv(directory=args.model_directory or options.get("qsiv_directory"),
94
+ runtime_directory=runtime_directory, dry_run=args.dry_run)
95
+ elif args.command == "doctor":
96
+ result = doctor(args.project)
97
+ elif args.command == "init":
98
+ result = initialize(args.project, args.retrieval, args.embedder)
99
+ elif args.command == "mcp":
100
+ from .mcp import serve
101
+ serve(args.project, args.offline)
102
+ return
103
+ else:
104
+ engine = Engine(args.project, args.offline)
105
+ try:
106
+ if args.command == "index":
107
+ result = engine.index()
108
+ elif args.command == "capture":
109
+ result = engine.capture(args.text, args.label, args.shared)
110
+ elif args.command == "remember":
111
+ result = engine.remember(args.text, args.source_id, args.shared)
112
+ elif args.command == "recall":
113
+ result = engine.recall(args.query, args.budget, args.history)
114
+ else:
115
+ result = engine.maintain()
116
+ finally:
117
+ engine.close()
118
+ print(json.dumps(result, indent=2, ensure_ascii=False))
119
+ if args.command == "doctor" and not result["ok"]:
120
+ raise SystemExit(1)
121
+ except Exception as exc:
122
+ # Do not echo SDK exception bodies, key-bearing URLs or supplied source text.
123
+ message = str(exc) if isinstance(exc, ValueError) else "See installation/runtime diagnostics; provider details omitted"
124
+ print(json.dumps({"error": type(exc).__name__, "message": message}), file=sys.stderr)
125
+ raise SystemExit(1) from None
126
+
127
+
128
+ if __name__ == "__main__":
129
+ main()