memoose 0.4.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.
- memoose-0.4.0/.gitignore +28 -0
- memoose-0.4.0/CONTEXT.md +129 -0
- memoose-0.4.0/LICENSE +202 -0
- memoose-0.4.0/PKG-INFO +281 -0
- memoose-0.4.0/README.md +263 -0
- memoose-0.4.0/harness/agents/memory-keeper.md +71 -0
- memoose-0.4.0/harness/hooks/_common.py +279 -0
- memoose-0.4.0/harness/hooks/capture.py +177 -0
- memoose-0.4.0/harness/hooks/hooks.json +48 -0
- memoose-0.4.0/harness/hooks/recommend.py +164 -0
- memoose-0.4.0/harness/hooks/session_start.py +105 -0
- memoose-0.4.0/harness/skills/memoose/SKILL.md +337 -0
- memoose-0.4.0/harness/skills/memoose-onboard/SKILL.md +133 -0
- memoose-0.4.0/harness/skills/memoose-sessions/SKILL.md +78 -0
- memoose-0.4.0/harness/skills/memoose-upkeep/SKILL.md +94 -0
- memoose-0.4.0/pyproject.toml +44 -0
- memoose-0.4.0/src/memoose/__init__.py +9 -0
- memoose-0.4.0/src/memoose/cli/__init__.py +3 -0
- memoose-0.4.0/src/memoose/cli/graph_html.py +208 -0
- memoose-0.4.0/src/memoose/cli/integrations.py +286 -0
- memoose-0.4.0/src/memoose/cli/main.py +534 -0
- memoose-0.4.0/src/memoose/engine.py +620 -0
- memoose-0.4.0/src/memoose/graph/__init__.py +1 -0
- memoose-0.4.0/src/memoose/graph/chunking.py +58 -0
- memoose-0.4.0/src/memoose/graph/contradictions.py +102 -0
- memoose-0.4.0/src/memoose/graph/ids.py +35 -0
- memoose-0.4.0/src/memoose/graph/memify.py +122 -0
- memoose-0.4.0/src/memoose/graph/models.py +40 -0
- memoose-0.4.0/src/memoose/graph/ontology.py +271 -0
- memoose-0.4.0/src/memoose/graph/procedures.py +99 -0
- memoose-0.4.0/src/memoose/graph/retrieval.py +274 -0
- memoose-0.4.0/src/memoose/graph/sessions.py +78 -0
- memoose-0.4.0/src/memoose/server.py +204 -0
- memoose-0.4.0/src/memoose/store/__init__.py +3 -0
- memoose-0.4.0/src/memoose/store/datasets.py +50 -0
- memoose-0.4.0/src/memoose/store/embeddings.py +116 -0
- memoose-0.4.0/src/memoose/store/schema.py +85 -0
- memoose-0.4.0/src/memoose/store/sqlite_store.py +654 -0
- memoose-0.4.0/tests/conftest.py +18 -0
- memoose-0.4.0/tests/test_cli.py +207 -0
- memoose-0.4.0/tests/test_core.py +254 -0
- memoose-0.4.0/tests/test_engine.py +110 -0
- memoose-0.4.0/tests/test_hooks.py +474 -0
- memoose-0.4.0/tests/test_integrations.py +99 -0
- memoose-0.4.0/tests/test_mcp_roundtrip.py +47 -0
- memoose-0.4.0/tests/test_procedures.py +290 -0
- memoose-0.4.0/tests/test_version.py +17 -0
memoose-0.4.0/.gitignore
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
.venv/
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.egg-info/
|
|
4
|
+
dist/
|
|
5
|
+
.pytest_cache/
|
|
6
|
+
*.sqlite
|
|
7
|
+
*.sqlite-wal
|
|
8
|
+
*.sqlite-shm
|
|
9
|
+
.omc/
|
|
10
|
+
**/results/*/data/
|
|
11
|
+
**/results/*/cwd/
|
|
12
|
+
|
|
13
|
+
# third-party benchmark dataset, fetched by benchmarks/locomo/fetch_dataset.py
|
|
14
|
+
benchmarks/locomo/locomo10.json
|
|
15
|
+
|
|
16
|
+
# the Procedural Graphs paper, cited by ADR 0004 as arXiv:2609.09153
|
|
17
|
+
docs/*.pdf
|
|
18
|
+
|
|
19
|
+
# third-party benchmark datasets, fetched on demand
|
|
20
|
+
benchmarks/longmemeval/longmemeval_s*.json
|
|
21
|
+
|
|
22
|
+
# LaTeX build artifacts (memoose.bbl is kept: arXiv needs it and does not run BibTeX)
|
|
23
|
+
paper/*
|
|
24
|
+
|
|
25
|
+
# this machine's agent tooling, not part of memoose (skill managers, host-scoped installs)
|
|
26
|
+
.agents/
|
|
27
|
+
.claude/
|
|
28
|
+
skills-lock.json
|
memoose-0.4.0/CONTEXT.md
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# memoose
|
|
2
|
+
|
|
3
|
+
A dual-path memory system for proactive agents, packaged as an Agent Plugin (skills plus an MCP server). The deterministic parts of memory management are MCP tools; the judgment that other memory libraries delegate to an LLM is described in skills and done by the Host Model as it calls the tools.
|
|
4
|
+
|
|
5
|
+
## Language
|
|
6
|
+
|
|
7
|
+
### Actors
|
|
8
|
+
|
|
9
|
+
**Host**:
|
|
10
|
+
The agent client that installs the plugin and runs the conversation, such as Claude Code or Codex.
|
|
11
|
+
_Avoid_: Provider, client, harness, IDE
|
|
12
|
+
|
|
13
|
+
**Host Model**:
|
|
14
|
+
The LLM the Host is already running the conversation with. The only model memoose ever uses.
|
|
15
|
+
_Avoid_: LLM, provider model, API model, sampling
|
|
16
|
+
|
|
17
|
+
**Engine**:
|
|
18
|
+
The MCP server part of the plugin. It stores, indexes, and retrieves memory. It never calls, prompts, or orchestrates a model.
|
|
19
|
+
_Avoid_: Server, backend
|
|
20
|
+
|
|
21
|
+
### Memory
|
|
22
|
+
|
|
23
|
+
**Dataset**:
|
|
24
|
+
A named scope that memory belongs to and recall is restricted to. A project directory and a user's global memory are each a Dataset.
|
|
25
|
+
_Avoid_: Namespace, collection, workspace
|
|
26
|
+
|
|
27
|
+
**Ontology**:
|
|
28
|
+
The declared entity types and relation types that extracted facts are resolved against.
|
|
29
|
+
_Avoid_: Schema, taxonomy, graph model
|
|
30
|
+
|
|
31
|
+
**Session**:
|
|
32
|
+
One conversation's short-lived memory: turns plus typed context entries, distilled into Lessons when the conversation ends.
|
|
33
|
+
_Avoid_: Thread, chat, conversation log
|
|
34
|
+
|
|
35
|
+
**Fact**:
|
|
36
|
+
One relation between two entities with a one-sentence description and an evidence pointer. The unit recall returns.
|
|
37
|
+
_Avoid_: Triple, edge, triplet, claim
|
|
38
|
+
|
|
39
|
+
**Evidence**:
|
|
40
|
+
Where a Fact comes from, as a pointer a later run can re-check: a file range, URL, issue id, or "user said <date>".
|
|
41
|
+
_Avoid_: Source, citation, reference
|
|
42
|
+
|
|
43
|
+
**Functional Relation**:
|
|
44
|
+
A relation name that holds one current value per subject, such as owned_by. A newer Fact supersedes the older one automatically.
|
|
45
|
+
_Avoid_: Single-valued, cardinality-one, unique relation
|
|
46
|
+
|
|
47
|
+
**Superseded**:
|
|
48
|
+
The state of a Fact that a newer Fact replaced. It leaves default recall but stays in history.
|
|
49
|
+
_Avoid_: Deleted, archived, stale, outdated
|
|
50
|
+
|
|
51
|
+
**Contradiction**:
|
|
52
|
+
Two Facts that cannot both be true of the same subject at the same time, recorded with a reason and a confidence until one supersedes the other.
|
|
53
|
+
_Avoid_: Conflict, inconsistency, clash
|
|
54
|
+
|
|
55
|
+
**Hotspot**:
|
|
56
|
+
A subject that holds several values for one relation. A candidate for a Contradiction or a Functional Relation, not yet judged. A Procedure with several Transitions is a branch, never a Hotspot.
|
|
57
|
+
_Avoid_: Duplicate, collision
|
|
58
|
+
|
|
59
|
+
**Lesson**:
|
|
60
|
+
A distilled, reusable learning from a Session, stored as an entity linked to what it applies to.
|
|
61
|
+
_Avoid_: Insight, takeaway, note, memory
|
|
62
|
+
|
|
63
|
+
**Bucket**:
|
|
64
|
+
A group of entities of one type with a written summary; together the Buckets form the global context of a Dataset.
|
|
65
|
+
_Avoid_: Cluster, community, index entry, topic
|
|
66
|
+
|
|
67
|
+
**Procedure**:
|
|
68
|
+
A step an agent takes, stored as an entity: a tool action, a check, or a state of the work. A Fact answers what is; a Procedure and its Transitions answer what to do next.
|
|
69
|
+
_Avoid_: Workflow, playbook, recipe, step, skill (a skill is the host's instruction file, not memory)
|
|
70
|
+
|
|
71
|
+
**Transition**:
|
|
72
|
+
A Fact whose source and target are both Procedures. It says the target is admissible after the source, and carries a Condition, an Advice and a Pitfall.
|
|
73
|
+
_Avoid_: Edge, next step, arrow, link
|
|
74
|
+
|
|
75
|
+
**Condition**:
|
|
76
|
+
The circumstance under which a Transition applies.
|
|
77
|
+
_Avoid_: Precondition, trigger, when-clause
|
|
78
|
+
|
|
79
|
+
**Advice**:
|
|
80
|
+
How to carry out the target Procedure once a Transition is taken.
|
|
81
|
+
_Avoid_: Guidance (that is the assembled neighbourhood), instruction, how-to, tip
|
|
82
|
+
|
|
83
|
+
**Pitfall**:
|
|
84
|
+
What went wrong on a Transition before and must be avoided when it is taken again.
|
|
85
|
+
_Avoid_: Warning, anti-pattern, gotcha, failure
|
|
86
|
+
|
|
87
|
+
**Start**:
|
|
88
|
+
A Procedure that marks the entry of a chain, so the first Position of a task can be localised and a chain can be built from nothing.
|
|
89
|
+
_Avoid_: Root, entry point, begin
|
|
90
|
+
|
|
91
|
+
**Position**:
|
|
92
|
+
The Procedure the agent is at now, declared on a Session turn. The only signal Guidance is keyed on.
|
|
93
|
+
_Avoid_: Active node, current step, state, location
|
|
94
|
+
|
|
95
|
+
**Trace**:
|
|
96
|
+
The ordered Positions of one Session, closed by its Outcome. What a later distillation contrasts a failed run against a successful one with.
|
|
97
|
+
_Avoid_: Trajectory, history, log, path
|
|
98
|
+
|
|
99
|
+
**Outcome**:
|
|
100
|
+
How a Session ended: succeeded, failed, or abandoned. Declared by the agent when the Session ends.
|
|
101
|
+
_Avoid_: Score, result, status, verdict
|
|
102
|
+
|
|
103
|
+
**Guidance**:
|
|
104
|
+
The Transitions two hops out from the agent's Position, put in front of the agent before it acts. The agent decides; Guidance is memory, not an instruction.
|
|
105
|
+
_Avoid_: Suggestion, plan, next steps, recommendation
|
|
106
|
+
|
|
107
|
+
**Dismissal**:
|
|
108
|
+
A recorded judgment that a candidate was reviewed and declined, with the reason: a maintenance candidate (a Hotspot, a possible duplicate, a possible connection, an undistilled Session) or a proposed change to a Transition. It removes the candidate from later passes and changes nothing in the graph. Lives in Provenance.
|
|
109
|
+
_Avoid_: Rejection, ignore, mute, suppress
|
|
110
|
+
|
|
111
|
+
**Provenance**:
|
|
112
|
+
The append-only ledger of every change to memory: who did what to which entity or Fact, and when.
|
|
113
|
+
_Avoid_: Audit log, history table, changelog
|
|
114
|
+
|
|
115
|
+
## Code layout
|
|
116
|
+
|
|
117
|
+
`src/memoose/` is three layers plus two entry points. Nothing imports upward.
|
|
118
|
+
|
|
119
|
+
`harness/` beside it holds what reaches the Host without code: `skills/`, `hooks/`, `agents/`. The plugin manifest and `memoose install` both read from there.
|
|
120
|
+
|
|
121
|
+
| Package | Holds | Imports from |
|
|
122
|
+
|---|---|---|
|
|
123
|
+
| `store/` | `sqlite_store`, `schema`, `embeddings`, `datasets` (where a Dataset's file lives) | nothing internal |
|
|
124
|
+
| `graph/` | `models`, `ids`, `ontology`, `chunking`, `retrieval`, `contradictions`, `memify`, `sessions`, `procedures` | `store/` |
|
|
125
|
+
| `engine.py` | the `Engine` facade every surface calls | `graph/`, `store/` |
|
|
126
|
+
| `server.py` | MCP tools over `Engine` | `engine`, `graph/` |
|
|
127
|
+
| `cli/` | `main` (the `memoose` command), `integrations` (host installers), `graph_html` (the viewer) | `engine`, `graph/`, `store/` |
|
|
128
|
+
|
|
129
|
+
Library users import from the top: `from memoose import Engine, EntityIn, RelationIn, OntologyError`.
|
memoose-0.4.0/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
memoose-0.4.0/PKG-INFO
ADDED
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: memoose
|
|
3
|
+
Version: 0.4.0
|
|
4
|
+
Summary: A dual-path memory system for proactive agents: facts and procedures in a local graph, exposed as a CLI, MCP tools and skills, no API key.
|
|
5
|
+
Author: Hieu Ngo
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Keywords: agent-plugins,claude-code,codex,knowledge-graph,mcp,memory
|
|
9
|
+
Requires-Python: >=3.11
|
|
10
|
+
Requires-Dist: mcp>=1.10
|
|
11
|
+
Requires-Dist: numpy>=1.26
|
|
12
|
+
Requires-Dist: pydantic>=2.7
|
|
13
|
+
Provides-Extra: fastembed
|
|
14
|
+
Requires-Dist: fastembed>=0.5; extra == 'fastembed'
|
|
15
|
+
Provides-Extra: ontology
|
|
16
|
+
Requires-Dist: rdflib>=7; extra == 'ontology'
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
|
|
19
|
+
<div align="center">
|
|
20
|
+
|
|
21
|
+
<img src="assets/memoose-mascot.png" alt="the Memoose mascot" width="220">
|
|
22
|
+
|
|
23
|
+
# Memoose: A Dual-Path Memory System for Proactive Agents
|
|
24
|
+
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Contents
|
|
30
|
+
|
|
31
|
+
- [What is Memoose](#what-is-memoose)
|
|
32
|
+
- [Quick start](#quick-start)
|
|
33
|
+
- [Give your agent memory](#give-your-agent-memory)
|
|
34
|
+
- [How Memoose works](#how-memoose-works)
|
|
35
|
+
- [Usage](#usage): [tools](#tools) · [skills](#skills) · [CLI](#cli)
|
|
36
|
+
- [Benchmarks](#benchmarks)
|
|
37
|
+
- [Learn more](#learn-more): [documentation](#documentation) · [inspiration](#inspiration) · [contributing](#contributing) · [license](#license)
|
|
38
|
+
|
|
39
|
+
# What is Memoose
|
|
40
|
+
|
|
41
|
+
**Memoose** is a dual-path memory system for proactive agents. Memory survives the session and
|
|
42
|
+
survives switching agents. It is found two ways: by search when the agent asks, and by
|
|
43
|
+
recommendation when it does not. An **engine** keeps a typed knowledge graph on your machine; a
|
|
44
|
+
**harness** of skills, hooks and tools teaches the model your host already runs how to use it.
|
|
45
|
+
|
|
46
|
+
It is built for long-lived project work: decisions, conventions and ownership facts that must stay
|
|
47
|
+
correct for months, each with an evidence pointer back to its source.
|
|
48
|
+
|
|
49
|
+
### Vision
|
|
50
|
+
|
|
51
|
+
**Memory is upkeep.** Facts are written as they surface. `memoose maintain` sweeps the store into
|
|
52
|
+
one worklist of things to judge and decides nothing itself; a model makes every call, on a small
|
|
53
|
+
subagent that costs neither your attention nor the conversation's turns.
|
|
54
|
+
|
|
55
|
+
**Search and recommendation are the two ways anything gets found.** Search answers a question you
|
|
56
|
+
thought to ask. Recommendation surfaces what you did not. A search-only memory stays silent unless
|
|
57
|
+
the agent already suspects something is there. Memoose does both: `recall`, and a hint before each
|
|
58
|
+
prompt.
|
|
59
|
+
|
|
60
|
+
**The context an agent most often lacks is procedural.** It knows what things are and still runs
|
|
61
|
+
steps out of order, skips a check, or repeats a step that already failed. Memoose stores procedures
|
|
62
|
+
as a graph, after Google's [Procedural Graphs](https://arxiv.org/abs/2609.09153): steps as nodes,
|
|
63
|
+
transitions carrying a condition, an advice and a pitfall. The agent declares where it is, reads the
|
|
64
|
+
transitions two hops out, and decides. When the session ends with an outcome, every transition it
|
|
65
|
+
took counts it, so the next run learns from the last.
|
|
66
|
+
|
|
67
|
+
Read more: [Vision](https://andrewngo-ini.github.io/mnemoth/vision.html).
|
|
68
|
+
|
|
69
|
+
# Quick start
|
|
70
|
+
|
|
71
|
+
Python 3.11 or newer, nothing else:
|
|
72
|
+
|
|
73
|
+
```sh
|
|
74
|
+
pip install memoose # or: pipx install memoose, or uvx memoose --help
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Store a fact, ask a question, look at the graph:
|
|
78
|
+
|
|
79
|
+
```sh
|
|
80
|
+
memoose remember "Bao:Person --owns--> auth-service:System" -e "user said 2026-09-18"
|
|
81
|
+
memoose remember "auth-service --uses--> PostgreSQL:Technology" -e "repo://src/db.py#L1-L20"
|
|
82
|
+
memoose recall "who owns auth and what does it run on"
|
|
83
|
+
memoose view # the graph in your browser, nothing uploaded
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
A fact is `source[:Type] --relation--> target[:Type]`. Give the `:Type` the first time an entity
|
|
87
|
+
appears; after that the name is enough. Every fact takes `-e/--evidence`, `--valid-from` and
|
|
88
|
+
`--desc`. Later:
|
|
89
|
+
|
|
90
|
+
```sh
|
|
91
|
+
memoose maintain # one worklist: conflicts, duplicates, sessions to distil
|
|
92
|
+
memoose history auth-service # every change to an entity or fact, by whom and why
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Memory lives in `~/.memoose/<dataset>.sqlite`: one dataset per project plus a `user` dataset for
|
|
96
|
+
facts that hold everywhere. `MEMOOSE_DATA_DIR` moves it. Full command table under [CLI](#cli).
|
|
97
|
+
|
|
98
|
+
# Give your agent memory
|
|
99
|
+
|
|
100
|
+
The CLI is enough for an agent with a shell. To add the skills, and on Claude Code the hooks and the
|
|
101
|
+
`memory-keeper` subagent:
|
|
102
|
+
|
|
103
|
+
```sh
|
|
104
|
+
memoose install claude # or: codex | opencode | cursor
|
|
105
|
+
memoose status # what is installed where
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
`install` copies the skills into the host. On Claude Code it also registers the hooks in
|
|
109
|
+
`~/.claude/settings.json` and drops the agent into `~/.claude/agents/`. It is user-scoped;
|
|
110
|
+
`--project .` scopes it to one repository; `uninstall <host>` reverses it. No MCP server is wired
|
|
111
|
+
unless the agent has no shell: `install <host> --mcp` adds `uvx memoose serve`, which needs
|
|
112
|
+
[uv](https://docs.astral.sh/uv/).
|
|
113
|
+
|
|
114
|
+
On **Claude Code** the plugin is the simplest route and keeps one copy of everything:
|
|
115
|
+
|
|
116
|
+
```
|
|
117
|
+
/plugin marketplace add AndrewNgo-ini/mnemoth
|
|
118
|
+
/plugin install memoose@memoose
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
<details>
|
|
122
|
+
<summary><b>Working from a checkout</b></summary>
|
|
123
|
+
<br>
|
|
124
|
+
|
|
125
|
+
```sh
|
|
126
|
+
git clone https://github.com/AndrewNgo-ini/mnemoth.git && cd mnemoth && uv sync
|
|
127
|
+
uv run memoose install claude # skills, hooks and agent from this checkout
|
|
128
|
+
claude --plugin-dir . # or load the checkout as a plugin
|
|
129
|
+
uv sync --extra fastembed # local embeddings (a keyless hash fallback is used otherwise)
|
|
130
|
+
uv sync --extra ontology # full RDF parsing
|
|
131
|
+
uv run pytest
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
</details>
|
|
135
|
+
|
|
136
|
+
> Upgrading from mnemoth: `MNEMOTH_*` variables are still read, an existing `~/.mnemoth` store is
|
|
137
|
+
> reused, and `install` clears the old MCP entry.
|
|
138
|
+
|
|
139
|
+
**Onboarding.** Ask your agent to onboard Memoose. The
|
|
140
|
+
[`memoose-onboard`](./harness/skills/memoose-onboard/SKILL.md) skill checks what works on this host,
|
|
141
|
+
installs what is missing, then fills the project's memory from its README, docs and git log so the
|
|
142
|
+
next session starts with context.
|
|
143
|
+
|
|
144
|
+
# How Memoose works
|
|
145
|
+
|
|
146
|
+
Two layers. A deterministic **engine**: a knowledge graph behind a CLI and 26 MCP tools, no model.
|
|
147
|
+
A **harness** of skills, hooks and a subagent that carries the judgment, run by the model your host
|
|
148
|
+
already has.
|
|
149
|
+
|
|
150
|
+
- [Overview](https://andrewngo-ini.github.io/mnemoth/) explains the split.
|
|
151
|
+
- [Automatic memory](https://andrewngo-ini.github.io/mnemoth/automatic.html): what runs without being asked, on which hosts.
|
|
152
|
+
- [Evidence & history](https://andrewngo-ini.github.io/mnemoth/trust.html): what a fact carries and how it changes.
|
|
153
|
+
- [Configuration](https://andrewngo-ini.github.io/mnemoth/configuration.html): the switches.
|
|
154
|
+
|
|
155
|
+
# Usage
|
|
156
|
+
|
|
157
|
+
### Tools
|
|
158
|
+
|
|
159
|
+
26 MCP tools; every capability is a tool call on any MCP host.
|
|
160
|
+
|
|
161
|
+
| area | tools |
|
|
162
|
+
| -------- | ----- |
|
|
163
|
+
| ontology | `describe_ontology`, `add_entity_type`, `import_ontology` (OWL/RDF/Turtle), `declare_functional_relations` |
|
|
164
|
+
| write | `remember`, `mark_contradiction`, `supersede`, `merge_entities`, `cross_connect`, `set_bucket_summary`, `forget` |
|
|
165
|
+
| read | `recall`, `guidance`, `contradiction_candidates`, `history`, `memify_candidates`, `global_context`, `list_datasets` |
|
|
166
|
+
| sessions | `session_start`, `session_add_turn`, `session_set_context`, `session_get`, `session_timeline`, `publish_lessons`, `session_end` |
|
|
167
|
+
|
|
168
|
+
### Skills
|
|
169
|
+
|
|
170
|
+
| skill | teaches the host model |
|
|
171
|
+
| ----- | ---------------------- |
|
|
172
|
+
| [`memoose`](./harness/skills/memoose/SKILL.md) | when to recall; how to extract facts with evidence, store procedures, shape the ontology |
|
|
173
|
+
| [`memoose-sessions`](./harness/skills/memoose-sessions/SKILL.md) | the working loop: position and guidance, context sections, outcome, distilling lessons |
|
|
174
|
+
| [`memoose-upkeep`](./harness/skills/memoose-upkeep/SKILL.md) | judging what the store surfaces: contradictions, duplicates, connections, stale summaries |
|
|
175
|
+
| [`memoose-onboard`](./harness/skills/memoose-onboard/SKILL.md) | check what works, install what is missing, then fill this project's memory from its docs and history |
|
|
176
|
+
|
|
177
|
+
### CLI
|
|
178
|
+
|
|
179
|
+
Memory operations, the same ones the tools expose:
|
|
180
|
+
|
|
181
|
+
| command | what it does |
|
|
182
|
+
| ------- | ------------ |
|
|
183
|
+
| `memoose recall "who owns billing"` | search memory; `--mode`, `--limit`, `--superseded`, `--json` |
|
|
184
|
+
| `memoose remember "bao:Person --owns--> auth:System"` | store a fact; `--desc`, `-e`, `--valid-from`; `--when`, `--do`, `--avoid` on a transition; `--stdin` for a JSON batch |
|
|
185
|
+
| `memoose guidance "run the test suite"` | what comes next from a procedure: transitions two hops out, with how past runs ended |
|
|
186
|
+
| `memoose history auth-service` | the provenance ledger for an entity or fact |
|
|
187
|
+
| `memoose contradictions [names]` | hotspots and open contradictions to judge |
|
|
188
|
+
| `memoose ontology` · `memoose datasets` · `memoose context` | entity types and stats · memory scopes · global context |
|
|
189
|
+
| `memoose session start\|turn\|context\|get\|timeline\|lessons\|end` | session lifecycle; `turn --at <procedure>` declares position, `end --outcome` records how it went |
|
|
190
|
+
| `memoose maintain` | the periodic pass: everything that needs judging, in one worklist |
|
|
191
|
+
| `memoose dismiss <key> --reason "..."` | decline a candidate so it is not proposed again |
|
|
192
|
+
| `memoose view` | the graph in your browser as one HTML file (`--superseded` draws history dashed) |
|
|
193
|
+
| `memoose forget --entity X` | delete an entity, fact, session or dataset |
|
|
194
|
+
| `memoose tool <name> --stdin` | any remaining tool, arguments as JSON on stdin |
|
|
195
|
+
|
|
196
|
+
Output is compact text; over `--max-inline` (2000 chars) it goes to a file whose path is printed.
|
|
197
|
+
`--json` gives the exact tool payload, never cut. Setup:
|
|
198
|
+
|
|
199
|
+
| command | what it does |
|
|
200
|
+
| ------- | ------------ |
|
|
201
|
+
| `memoose install <host>` | skills, hooks and the agent into a host (`--project`, `--mcp`) |
|
|
202
|
+
| `memoose uninstall <host>` | reverse it |
|
|
203
|
+
| `memoose status` | what is installed where |
|
|
204
|
+
| `memoose serve` | the stdio MCP server, for a host that launches one |
|
|
205
|
+
|
|
206
|
+
# Benchmarks
|
|
207
|
+
|
|
208
|
+
Memoose has no model of its own, so its score is inseparable from the model driving it. We report
|
|
209
|
+
the number that matches how it is meant to run: a small, fast model throughout.
|
|
210
|
+
|
|
211
|
+
LoCoMo is the standard conversational-memory benchmark: long multi-session conversations, then
|
|
212
|
+
questions about them. One model answers from what the memory system retrieves; another grades. We
|
|
213
|
+
run mem0's protocol with their prompts verbatim, so the memory system is the only difference.
|
|
214
|
+
|
|
215
|
+
### Our run
|
|
216
|
+
|
|
217
|
+
**Claude Haiku 4.5** as answerer and judge, all 1,540 questions: **90.4% correct** at **4,699 mean
|
|
218
|
+
prompt tokens** ($88.55, September 2026). A reference point, not a competitive entry.
|
|
219
|
+
|
|
220
|
+
| category | questions | score |
|
|
221
|
+
| ----------- | --------- | ----- |
|
|
222
|
+
| single-hop | 841 | 93.5 |
|
|
223
|
+
| temporal | 321 | 89.7 |
|
|
224
|
+
| multi-hop | 282 | 88.7 |
|
|
225
|
+
| open-domain | 96 | 70.8 |
|
|
226
|
+
|
|
227
|
+
Open-domain is the weak category: its gold answers are single turns that never reach the retrieved
|
|
228
|
+
context.
|
|
229
|
+
|
|
230
|
+
### What others report
|
|
231
|
+
|
|
232
|
+
Every figure is **self-reported by its vendor** on a different model, judge and retrieval setup.
|
|
233
|
+
They are not comparable with each other or with ours; they are context.
|
|
234
|
+
|
|
235
|
+
| system | reported | notes |
|
|
236
|
+
| ----------------------- | ----------- | ----- |
|
|
237
|
+
| ZeroMemory | 96.1 | unverified |
|
|
238
|
+
| Zep | 94.7 | third-party testing found 75.1 |
|
|
239
|
+
| ByteRover | 92.2 / 96.1 | two conflicting figures published |
|
|
240
|
+
| mem0 | 92.5 | single-hop 94.6, multi-hop 95.4, temporal 92.5, open-domain 82.3; 6,956 prompt tokens |
|
|
241
|
+
| **Memoose (Haiku 4.5)** | **90.4** | the run above; per-category scores, CI, cost and raw rows published |
|
|
242
|
+
| Dakera | 88.2 | no LLM reranking |
|
|
243
|
+
| full context, no memory | ~73 | the whole conversation in the prompt |
|
|
244
|
+
|
|
245
|
+
mem0 is the only entry with a per-category breakdown; we trail it everywhere, most on multi-hop
|
|
246
|
+
(−6.7) and open-domain (−11.5), at a third fewer prompt tokens with a much smaller answerer.
|
|
247
|
+
Swapping the answerer moves a score more than swapping the memory system, so treat the ordering as
|
|
248
|
+
noise.
|
|
249
|
+
|
|
250
|
+
Two findings cut against us and are published anyway: the knowledge graph does **not** beat plain
|
|
251
|
+
chunk retrieval on LoCoMo (paired McNemar p = 1.00) and costs 77% more tokens, and a larger
|
|
252
|
+
retrieval budget does not lift the score. LoCoMo asks needle questions over conversations that fit
|
|
253
|
+
in a context window; it does not test what a graph is for.
|
|
254
|
+
|
|
255
|
+
Protocol, full tables and raw rows: [`benchmarks/`](./benchmarks/README.md). Setup and traps:
|
|
256
|
+
[`benchmarks/SETUP.md`](./benchmarks/SETUP.md).
|
|
257
|
+
|
|
258
|
+
# Learn more
|
|
259
|
+
|
|
260
|
+
### Documentation
|
|
261
|
+
|
|
262
|
+
[Site](https://andrewngo-ini.github.io/mnemoth/)
|
|
263
|
+
|
|
264
|
+
### Inspiration
|
|
265
|
+
|
|
266
|
+
- [**cognee**](https://github.com/topoteretes/cognee) for the memory philosophy: a typed graph,
|
|
267
|
+
ontology-constrained extraction, deterministic ids, hybrid retrieval, contradictions and
|
|
268
|
+
supersession as first-class concepts. Where cognee calls a model, Memoose has a skill.
|
|
269
|
+
- [**OpenWiki**](https://github.com/langchain-ai/openwiki) for grounded claims: every fact carries a
|
|
270
|
+
checkable evidence pointer.
|
|
271
|
+
- [**mem0**](https://github.com/mem0ai/mem0) for the LoCoMo protocol, with prompts vendored verbatim
|
|
272
|
+
from [memory-benchmarks](https://github.com/mem0ai/memory-benchmarks).
|
|
273
|
+
|
|
274
|
+
### Contributing
|
|
275
|
+
|
|
276
|
+
Pull requests and [issues](https://github.com/AndrewNgo-ini/mnemoth/issues) are welcome; open an
|
|
277
|
+
issue first for larger changes. `uv run pytest` runs the suite.
|
|
278
|
+
|
|
279
|
+
### License
|
|
280
|
+
|
|
281
|
+
Apache 2.0. See [LICENSE](./LICENSE).
|