@korrlabs/mnemospi 3.2.0 → 4.1.0
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.
- package/LICENSE +216 -21
- package/README.md +116 -195
- package/README.ru.md +135 -207
- package/integrations/extensions/mnemos-mcp.ts +25 -0
- package/package.json +10 -2
package/LICENSE
CHANGED
|
@@ -1,21 +1,216 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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.
|
|
203
|
+
|
|
204
|
+
Copyright 2026 Korrnals
|
|
205
|
+
|
|
206
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
207
|
+
you may not use this file except in compliance with the License.
|
|
208
|
+
You may obtain a copy of the License at
|
|
209
|
+
|
|
210
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
211
|
+
|
|
212
|
+
Unless required by applicable law or agreed to in writing, software
|
|
213
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
214
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
215
|
+
See the License for the specific language governing permissions and
|
|
216
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -11,8 +11,10 @@
|
|
|
11
11
|
</p>
|
|
12
12
|
|
|
13
13
|
<p align="center">
|
|
14
|
+
<a href="https://pypi.org/project/mnemos-memory-server/"><img src="https://img.shields.io/pypi/v/mnemos-memory-server?label=pypi&color=3776ab" alt="PyPI"></a>
|
|
15
|
+
<a href="https://www.npmjs.com/package/pi-mnemos"><img src="https://img.shields.io/npm/v/pi-mnemos?label=npm&color=cb3837" alt="npm"></a>
|
|
14
16
|
<a href="pyproject.toml"><img src="https://img.shields.io/badge/python-3.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-3776ab" alt="Python"></a>
|
|
15
|
-
<a href="pyproject.toml"><img src="https://img.shields.io/badge/license-
|
|
17
|
+
<a href="pyproject.toml"><img src="https://img.shields.io/badge/license-Apache_2.0-blue" alt="License: Apache-2.0"></a>
|
|
16
18
|
<a href="https://github.com/Korrnals/mnemos/releases"><img src="https://img.shields.io/github/v/release/Korrnals/mnemos?label=version&color=blueviolet" alt="Version"></a>
|
|
17
19
|
</p>
|
|
18
20
|
|
|
@@ -21,166 +23,101 @@
|
|
|
21
23
|
</p>
|
|
22
24
|
|
|
23
25
|
<p align="center">
|
|
24
|
-
<a href="#-features">Features</a> ·
|
|
25
26
|
<a href="#-quick-start">Quick start</a> ·
|
|
27
|
+
<a href="#-features">Features</a> ·
|
|
26
28
|
<a href="#-what-mnemos-is">What it is</a> ·
|
|
29
|
+
<a href="#-connect-any-harness">Connect a harness</a> ·
|
|
27
30
|
<a href="#%EF%B8%8F-architecture">Architecture</a> ·
|
|
28
|
-
<a href="#%EF%B8%8F-three-surfaces-one-core">Surfaces</a> ·
|
|
29
31
|
<a href="#-documentation">Docs</a>
|
|
30
32
|
</p>
|
|
31
33
|
|
|
32
34
|
---
|
|
33
35
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
| Area | What you get |
|
|
39
|
-
|------|--------------|
|
|
40
|
-
| **Universal connectivity** | MCP server (26 tools, stdio) + REST API — any MCP-capable harness connects in one line ([tools](docs/en/user/mcp-tools.md) · [HTTP](docs/en/user/http-api.md)) |
|
|
41
|
-
| **Ready integrations** | zcode, the `~/.agents` standard (Claude / Codex / Continue / Qwen and more), pi — via [`mnemos integration`](docs/en/user/integration-guide.md): deploy targets, one-line MCP presets, multi-harness doctor |
|
|
42
|
-
| **Skill pack** | 14+ memory skills deployed into your harnesses |
|
|
43
|
-
| **Flexible memory** | Hybrid search (full-text + vector, rank fusion), [tag contract](docs/en/user/tag-contract.md), per-agent / per-project memory, [context-filter](docs/en/user/context-filter.md) profiles, CCR compression — 70–90% token savings, originals kept |
|
|
44
|
-
| **Context assembly** | `assemble_context`: search → compress → filter → secret scan → cache align → token budget, per-block provenance |
|
|
45
|
-
| **Context bridge** | `on_context_rewrite` — when the harness compacts history, the lossless original stays available on demand |
|
|
46
|
-
| **Lifecycle hooks** | `pre_llm_call` context injection, `on_session_start`, `post_tool_call` auto-compression of tool outputs |
|
|
47
|
-
| **Publication v3.0.0** | Entries visible immediately after save, background refinement with seamless swap, quarantine with neutral retraction |
|
|
48
|
-
| **Self-protection** | Injection / secret detectors on input and publication, every output scanned, full per-entry audit |
|
|
49
|
-
| **Auto-pipeline** | Background processor: clustering, deduplication, quality gate, publication |
|
|
36
|
+
AI agents forget everything when a session ends. Mnemos gives them a place to lay it down —
|
|
37
|
+
structured, searchable, governed by contract — so what they learn does not vanish with the
|
|
38
|
+
closing of a window.
|
|
50
39
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
40
|
+
- **Local-first.** One process on your machine. SQLite + a bundled embedding model; nothing leaves the host, no API keys, works offline.
|
|
41
|
+
- **One server, any harness.** VS Code Copilot, Claude Code, Cursor, OpenCode, Codex, Windsurf, ZCode, pi, Hermes — the same MCP wire, one line each.
|
|
42
|
+
- **The agent learns to *use* it.** Not just tools: always-on instructions, a skill pack, and a memory-first prompt mode, deployed into your harness in one command.
|
|
54
43
|
|
|
55
44
|
---
|
|
56
45
|
|
|
57
46
|
## 🚀 Quick start
|
|
58
47
|
|
|
59
|
-
|
|
48
|
+
Three commands from an empty machine to an agent that remembers — and knows when to look.
|
|
60
49
|
|
|
61
|
-
### 1 · Install
|
|
50
|
+
### 1 · Install the server
|
|
62
51
|
|
|
63
52
|
```bash
|
|
64
|
-
|
|
53
|
+
pip install mnemos-memory-server
|
|
65
54
|
```
|
|
66
55
|
|
|
67
|
-
|
|
56
|
+
One package, everything included: the memory server, the `mnemos` CLI, the REST API, and the
|
|
57
|
+
MCP server your agent harness talks to. The embedding model ships inside — search works fully
|
|
58
|
+
offline, no API keys, nothing downloaded.
|
|
68
59
|
|
|
69
|
-
|
|
70
|
-
- drops a `mnemos` launcher into `~/.local/bin`, so the CLI just works in any shell (**no venv activation needed**);
|
|
71
|
-
- offers to wire up VS Code MCP integration right there (or run it later — see step 3).
|
|
60
|
+
> ⚠️ Mind the name: `pip install mnemos` (without `-memory-server`) is an unrelated project.
|
|
72
61
|
|
|
73
|
-
|
|
74
|
-
> `… | bash -s -- --mcp`.
|
|
75
|
-
|
|
76
|
-
### 2 · Write & recall
|
|
77
|
-
|
|
78
|
-
```bash
|
|
79
|
-
mnemos add "First memory — Mnemos remembers across sessions" \
|
|
80
|
-
--tags project:mnemos,agent:tech-writer,mnemos:learning
|
|
81
|
-
|
|
82
|
-
mnemos search "remembers across sessions"
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
That's the whole loop: **write, find, never lose it.** Every entry carries a
|
|
86
|
-
[tag contract](docs/en/user/tag-contract.md) (`project:` / `agent:` / `mnemos:`) so memories stay organised.
|
|
87
|
-
|
|
88
|
-
### 3 · Connect VS Code (MCP)
|
|
89
|
-
|
|
90
|
-
If you answered **yes** during install, you're already done — just reload your VS Code window.
|
|
91
|
-
To set it up manually, or on another machine:
|
|
92
|
-
|
|
93
|
-
```bash
|
|
94
|
-
curl -fsSL https://raw.githubusercontent.com/Korrnals/mnemos/main/scripts/mcp-setup.sh | bash
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
Then **reload the VS Code window** (`Ctrl+Shift+P → Reload Window`). The `mnemos_*` tools appear in
|
|
98
|
-
Copilot's tool picker, and your agents can call `mnemos_add` / `mnemos_search` directly.
|
|
99
|
-
|
|
100
|
-
### 4 · Deploy behavioral instructions
|
|
62
|
+
### 2 · Connect your harness — and teach it to use memory
|
|
101
63
|
|
|
102
64
|
```bash
|
|
103
65
|
mnemos integration setup
|
|
104
66
|
```
|
|
105
67
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
`~/.
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
`--home <dir>` to install into another environment's home (e.g. a container).
|
|
68
|
+
One pass: detects the agent harnesses on your machine, registers the Mnemos MCP server in each
|
|
69
|
+
supported one (VS Code Copilot, Cursor, ZCode, OpenCode, pi, Hermes, and everything reading the
|
|
70
|
+
`~/.agents` standard — Claude Code, Codex and friends), and deploys the **behavioral pack** —
|
|
71
|
+
always-on instructions and memory skills, so the agent recalls at session start, checkpoints
|
|
72
|
+
before its context gets compacted, and treats memory as a priority instead of forgetting the
|
|
73
|
+
tools exist.
|
|
113
74
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
[integration guide](docs/en/user/integration-guide.md#agent-mcp-wiring)
|
|
117
|
-
for wiring flags and the [context filter guide](docs/en/user/context-filter.md)
|
|
118
|
-
for the five-stage noise stripper that runs automatically on every `mnemos_add`.
|
|
75
|
+
Running a harness that reads nothing standard? One paste block per harness:
|
|
76
|
+
[Connect Mnemos to any harness](integrations/mcp-presets.md).
|
|
119
77
|
|
|
120
|
-
|
|
121
|
-
<summary><strong>🛠️ Other ways to install</strong> — from source, released wheel, or container one-liner</summary>
|
|
78
|
+
### 3 · Verify — then try it
|
|
122
79
|
|
|
123
|
-
<br>
|
|
124
|
-
|
|
125
|
-
**From source** (for development):
|
|
126
|
-
|
|
127
|
-
```bash
|
|
128
|
-
git clone https://github.com/Korrnals/mnemos.git
|
|
129
|
-
cd mnemos
|
|
130
|
-
uv venv && source .venv/bin/activate
|
|
131
|
-
uv pip install -e ".[dev]"
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
**Released wheel** (pin a specific version):
|
|
135
|
-
|
|
136
|
-
<!-- version:pip -->
|
|
137
80
|
```bash
|
|
138
|
-
|
|
81
|
+
mnemos doctor
|
|
139
82
|
```
|
|
140
|
-
<!-- /version:pip -->
|
|
141
83
|
|
|
142
|
-
|
|
84
|
+
PASS / WARN / FAIL per check: store, config, MCP transport, harness registration (`--fix`
|
|
85
|
+
repairs the common warnings). Then give it a memory:
|
|
143
86
|
|
|
144
87
|
```bash
|
|
145
|
-
|
|
146
|
-
|
|
88
|
+
mnemos add "First memory — Mnemos remembers across sessions" \
|
|
89
|
+
--tags project:mnemos,agent:me,mnemos:learning
|
|
90
|
+
mnemos search "remembers across sessions"
|
|
147
91
|
```
|
|
148
92
|
|
|
149
|
-
|
|
93
|
+
That is the whole loop: **write, find, never lose it — and the agent knows when to look.**
|
|
150
94
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
<br>
|
|
95
|
+
> 📘 **Want every detail?** The extended guide covers all install variants (`uv tool`, `pipx`,
|
|
96
|
+
> CLI-only, external LLM extras, installer script, container), per-harness connection
|
|
97
|
+
> walkthroughs, configuration, and troubleshooting:
|
|
98
|
+
> **[Getting Started — the complete first run](docs/en/user/getting-started.md)**.
|
|
157
99
|
|
|
158
|
-
|
|
100
|
+
---
|
|
159
101
|
|
|
160
|
-
|
|
161
|
-
# Generate a TOTP master key (required — the container binds 0.0.0.0)
|
|
162
|
-
export MNEMOS_API__TOTP_MASTER_KEY=$(python3 -c "import secrets; print(secrets.token_urlsafe(32))")
|
|
163
|
-
|
|
164
|
-
podman run -d --name mnemos \
|
|
165
|
-
-p 8787:8787 \
|
|
166
|
-
-v mnemos-data:/data \
|
|
167
|
-
-v mnemos-vault:/vault \
|
|
168
|
-
-e MNEMOS_API__TOTP_MASTER_KEY="${MNEMOS_API__TOTP_MASTER_KEY}" \
|
|
169
|
-
<!-- version:image -->
|
|
170
|
-
ghcr.io/korrnals/mnemos:3.1.0
|
|
171
|
-
<!-- /version:image -->
|
|
172
|
-
|
|
173
|
-
curl -s http://localhost:8787/health | jq
|
|
174
|
-
```
|
|
102
|
+
## ✨ Features
|
|
175
103
|
|
|
176
|
-
|
|
177
|
-
Tags: `:3.1.0` (pinned) · `:latest` (rolling). Works with `docker` too — swap `podman` for `docker`.
|
|
178
|
-
<!-- /version:tags -->
|
|
104
|
+
One local server — and a connected agent harness gets the full memory stack.
|
|
179
105
|
|
|
180
|
-
|
|
106
|
+
| Area | What you get |
|
|
107
|
+
|------|--------------|
|
|
108
|
+
| **Universal connectivity** | MCP server (26 tools, stdio) + REST API — any MCP-capable harness connects in one line ([tools](docs/en/user/mcp-tools.md) · [HTTP](docs/en/user/http-api.md)) |
|
|
109
|
+
| **Ready integrations** | VS Code Copilot, Claude Code, Cursor, Codex, Windsurf, OpenCode, ZCode, pi, Hermes Agent — one-line MCP presets for all of them, [native deploy targets](docs/en/user/integration-guide.md) for most, multi-harness doctor (`mnemos doctor`) |
|
|
110
|
+
| **Skill pack** | 14+ memory skills deployed into your harnesses |
|
|
111
|
+
| **Flexible memory** | Hybrid search (full-text + vector, rank fusion) over the bundled offline model `mnema-embed-v1`, [tag contract](docs/en/user/tag-contract.md), per-agent / per-project memory, [context-filter](docs/en/user/context-filter.md) profiles, CCR compression — 70–90% token savings, originals kept |
|
|
112
|
+
| **Context assembly** | `assemble_context`: search → compress → filter → secret scan → cache align → token budget, per-block provenance |
|
|
113
|
+
| **Context bridge** | `on_context_rewrite` — when the harness compacts history, the lossless original stays available on demand |
|
|
114
|
+
| **Lifecycle hooks** | `pre_llm_call` context injection, `on_session_start`, `post_tool_call` auto-compression of tool outputs |
|
|
115
|
+
| **Publication v3.0.0** | Entries visible immediately after save, background refinement with seamless swap, quarantine with neutral retraction |
|
|
116
|
+
| **Self-protection** | Injection / secret detectors on input and publication, every output scanned, full per-entry audit |
|
|
117
|
+
| **Auto-pipeline** | Background processor: clustering, deduplication, quality gate, publication |
|
|
181
118
|
|
|
182
|
-
|
|
183
|
-
|
|
119
|
+
Autonomy for an arbitrary harness and LLM-driven enrichment are partial — the
|
|
120
|
+
full, honest map lives in [docs/en/features.md](docs/en/features.md).
|
|
184
121
|
|
|
185
122
|
---
|
|
186
123
|
|
|
@@ -197,8 +134,8 @@ control surfaces, and a storage layer you can read with your own eyes.
|
|
|
197
134
|
| ⚙️ | **Policy engine** | Schedule and trigger automation over the memory store |
|
|
198
135
|
| 🧹 | **Context filter** | Five-stage noise stripper for logs / stdout before anything hits a model |
|
|
199
136
|
| 🗜️ | **Reversible compression (CCR)** | Compress large content with zero data loss — originals cached in SQLite, retrievable via hash marker |
|
|
200
|
-
| 🧷 | **CacheAligner
|
|
201
|
-
| 🪶 | **Output token reduction
|
|
137
|
+
| 🧷 | **CacheAligner** | Relocate dynamic content (timestamps, UUIDs, session ids, tokens) to the tail so provider KV caches (Anthropic `cache_control`, OpenAI prefix caching) hit across requests |
|
|
138
|
+
| 🪶 | **Output token reduction** | Optional `verbosity` / `effort` params on `mnemos_add` / `mnemos_search` / `mnemos_recall_context` steer the caller's output style — backward compatible, defaults are a no-op |
|
|
202
139
|
| 📂 | **Path-scoped rules** | Ingest project rules and apply them by file path |
|
|
203
140
|
| 🗂️ | **Obsidian vault** | A markdown mirror humans can browse, edit, and grep |
|
|
204
141
|
|
|
@@ -207,6 +144,38 @@ for the humans in the loop.
|
|
|
207
144
|
|
|
208
145
|
---
|
|
209
146
|
|
|
147
|
+
## 🤝 Connect any harness
|
|
148
|
+
|
|
149
|
+
Mnemos works with every MCP-capable agent harness. Three integration levels —
|
|
150
|
+
pick the strongest one your harness supports:
|
|
151
|
+
|
|
152
|
+
| Harness | Native deploy target | One-line MCP preset | Adapter template |
|
|
153
|
+
|---------|----------------------|---------------------|------------------|
|
|
154
|
+
| VS Code Copilot | `copilot` (+ prompts via `generic-copilot`) | [mcp-setup.sh](scripts/mcp-setup.sh) | ✓ |
|
|
155
|
+
| Claude Code | via `agents` | [preset](integrations/mcp-presets.md#claude-code) | ✓ |
|
|
156
|
+
| Cursor | `cursor` | [preset](integrations/mcp-presets.md#cursor) | ✓ |
|
|
157
|
+
| Codex | via `agents` | [preset](integrations/mcp-presets.md#codex) | ✓ |
|
|
158
|
+
| Windsurf | — | [preset](integrations/mcp-presets.md#windsurf) | ✓ |
|
|
159
|
+
| OpenCode | — | [preset](integrations/mcp-presets.md#opencode) | ✓ |
|
|
160
|
+
| ZCode | `zcode` | — | ✓ |
|
|
161
|
+
| Any AGENTS.md-standard harness | `agents` | — | ✓ |
|
|
162
|
+
| pi | `pi` (bridge extension, also on npm as [`pi-mnemos`](https://www.npmjs.com/package/pi-mnemos)) | [preset](integrations/mcp-presets.md#pi) | ✓ |
|
|
163
|
+
| [Hermes Agent](https://hermes-agent.nousresearch.com/) | `hermes` (native in-process `MemoryProvider` plugin) | — | — |
|
|
164
|
+
|
|
165
|
+
- **Native targets** — `mnemos integration setup --target <name>` deploys the behavioral pack and
|
|
166
|
+
registers the MCP server in one pass ([integration guide](docs/en/user/integration-guide.md)).
|
|
167
|
+
- **One-line presets** — [`integrations/mcp-presets.md`](integrations/mcp-presets.md): every harness
|
|
168
|
+
above, copy-paste ready.
|
|
169
|
+
- **Adapter template** — [`integrations/adapter-template.md`](integrations/adapter-template.md):
|
|
170
|
+
Connect / Expose / Configure + acceptance checklist for any harness that speaks MCP stdio.
|
|
171
|
+
- **Hermes Agent** runs Mnemos in-process: `pip install mnemos-memory-server` in the Hermes environment,
|
|
172
|
+
then `mnemos integration setup --target hermes` ([details](docs/en/user/integration-guide.md#hermes-agent)).
|
|
173
|
+
|
|
174
|
+
The shared contract is the [tag schema](docs/en/user/tag-contract.md) — `project:<slug>`, `agent:<slug>`,
|
|
175
|
+
and at least one `mnemos:<subtype>` — that every memory entry must carry.
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
210
179
|
## 🏗️ Architecture
|
|
211
180
|
|
|
212
181
|
<details open>
|
|
@@ -217,7 +186,7 @@ for the humans in the loop.
|
|
|
217
186
|
```mermaid
|
|
218
187
|
flowchart TB
|
|
219
188
|
subgraph CLIENTS["Clients"]
|
|
220
|
-
C1(["
|
|
189
|
+
C1(["Agent harness\nstdio MCP"])
|
|
221
190
|
C2(["CLI — mnemos …"])
|
|
222
191
|
C3(["HTTP API client"])
|
|
223
192
|
end
|
|
@@ -283,27 +252,12 @@ The same `MemoryManager` powers all three interfaces. Pick the one that fits you
|
|
|
283
252
|
|
|
284
253
|
| Surface | Use it when… | Reference |
|
|
285
254
|
|---------|--------------|-----------|
|
|
255
|
+
| **MCP** — `mnemos mcp-server` | You are an agent harness — the path every connected agent takes | [mcp-tools.md](docs/en/user/mcp-tools.md) |
|
|
286
256
|
| **CLI** — `mnemos …` | You live in a shell, want fast ad-hoc add / search, or are scripting cron jobs | [cli-reference.md](docs/en/user/cli-reference.md) |
|
|
287
257
|
| **HTTP** — `mnemos serve` | You have a non-MCP client — a web dashboard, a mobile app, a CI runner | [http-api.md](docs/en/user/http-api.md) |
|
|
288
|
-
| **MCP** — `mnemos mcp-server` | You are VS Code Copilot or any MCP-aware agent — the path Copilot agents take | [mcp-tools.md](docs/en/user/mcp-tools.md) |
|
|
289
|
-
|
|
290
|
-
The MCP surface also exposes the **A2A Sessions API** (M16) — a persistent backend for multi-step agent
|
|
291
|
-
conversations. Five endpoints (`POST /v1/sessions`, append-turn, range-load, …) let agents survive restarts
|
|
292
|
-
without losing context. See [a2a-sessions.md](docs/en/architecture/a2a-sessions.md).
|
|
293
|
-
|
|
294
|
-
---
|
|
295
|
-
|
|
296
|
-
## 📖 The lore
|
|
297
|
-
|
|
298
|
-
> In Hesiod's *Theogony*, **Mnemosyne** (Μνημοσύνη) is the Titaness of memory — she who, by Zeus, gave
|
|
299
|
-
> birth to the nine Muses and through them made the world's remembering possible. Her name is the root of
|
|
300
|
-
> *mnemonic*, and she is what every singer, poet, and philosopher prays to before they begin.
|
|
301
258
|
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
before. Mnemos gives them a place to lay it down — structured, searchable, governed by contract — so that
|
|
305
|
-
what they learn does not vanish with the closing of a session. The Muses, after all, were not for the
|
|
306
|
-
gods' benefit. They were for the songs.
|
|
259
|
+
The HTTP surface also exposes the **A2A Sessions API** — a persistent backend for multi-step agent
|
|
260
|
+
conversations that survive restarts. See [a2a-sessions.md](docs/en/architecture/a2a-sessions.md).
|
|
307
261
|
|
|
308
262
|
---
|
|
309
263
|
|
|
@@ -312,73 +266,40 @@ gods' benefit. They were for the songs.
|
|
|
312
266
|
| Page | What it covers |
|
|
313
267
|
|------|----------------|
|
|
314
268
|
| [docs/README.md](docs/README.md) | Documentation landing — language picker (EN / RU) |
|
|
315
|
-
| [getting-started.md](docs/en/user/getting-started.md) | First run: install → first memory → first search →
|
|
269
|
+
| [getting-started.md](docs/en/user/getting-started.md) | First run: install → first memory → first search → connect your harness |
|
|
270
|
+
| [mcp-presets.md](integrations/mcp-presets.md) | Connect Mnemos to any harness — one-line MCP presets (VS Code, Claude Code, Cursor, OpenCode, Codex, Windsurf, pi, Hermes) |
|
|
271
|
+
| [integration-guide.md](docs/en/user/integration-guide.md) | The behavioral pack: instructions, skills, prompt mode, deploy targets, agent wiring, Hermes plugin |
|
|
272
|
+
| [features.md](docs/en/features.md) | What works out of the box, what is partial, what is planned |
|
|
316
273
|
| [architecture/overview.md](docs/en/architecture/overview.md) | System shape, data model, state machines, security boundaries |
|
|
317
274
|
| [cli-reference.md](docs/en/user/cli-reference.md) | Every `mnemos` subcommand with flags, defaults, examples |
|
|
318
|
-
| [mcp-tools.md](docs/en/user/mcp-tools.md) | Every `mnemos_*` tool exposed to
|
|
319
|
-
| [http-api.md](docs/en/user/http-api.md) | Every HTTP endpoint (memory CRUD
|
|
320
|
-
| [a2a-sessions.md](docs/en/architecture/a2a-sessions.md) | Agent-to-agent conversation contract (M16) |
|
|
275
|
+
| [mcp-tools.md](docs/en/user/mcp-tools.md) | Every `mnemos_*` tool exposed to agent harnesses |
|
|
276
|
+
| [http-api.md](docs/en/user/http-api.md) | Every HTTP endpoint (memory CRUD, workflow, hooks, A2A Sessions) |
|
|
321
277
|
| [tag-contract.md](docs/en/user/tag-contract.md) | The `project:` / `agent:` / `mnemos:` schema enforced on every memory |
|
|
322
|
-
| [security.md](docs/en/admin/security.md) | Threat model, SSRF guard, FTS5 escape,
|
|
323
|
-
| [runbooks/](docs/en/admin/runbooks/) | Install, migrate, backup / restore, dependency updates |
|
|
324
|
-
| [container-deployment.md](docs/en/admin/runbooks/container-deployment.md) | Build, push, compose, podman, Kubernetes, quadlet |
|
|
278
|
+
| [security.md](docs/en/admin/security.md) | Threat model, SSRF guard, FTS5 escape, auth model |
|
|
279
|
+
| [runbooks/](docs/en/admin/runbooks/) | Install, migrate, backup / restore, dependency updates, container deployment |
|
|
325
280
|
| [adr/](docs/project/adr/) | Architectural decision records — the *why* behind the design |
|
|
326
|
-
| [milestones.md](docs/project/milestones.md) | Milestone ledger with status legend |
|
|
327
|
-
| [reports/](docs/project/reports/) | Phase completion reports — final report per completed roadmap phase |
|
|
328
281
|
| [CHANGELOG.md](CHANGELOG.md) | Release notes — Keep a Changelog format |
|
|
282
|
+
| [CONTRIBUTING.md](CONTRIBUTING.md) | Development setup, git workflow, quality gate |
|
|
329
283
|
|
|
330
284
|
---
|
|
331
285
|
|
|
332
|
-
##
|
|
333
|
-
|
|
334
|
-
Mnemos works with every MCP-capable agent harness. Three integration levels —
|
|
335
|
-
pick the strongest one your harness supports:
|
|
286
|
+
## 📖 The lore
|
|
336
287
|
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
| Claude Code | via `agents` | [preset](integrations/mcp-presets.md#claude-code) | ✓ |
|
|
341
|
-
| Cursor | `cursor` | [preset](integrations/mcp-presets.md#cursor) | ✓ |
|
|
342
|
-
| Codex | via `agents` | [preset](integrations/mcp-presets.md#codex) | ✓ |
|
|
343
|
-
| Windsurf | — | [preset](integrations/mcp-presets.md#windsurf) | ✓ |
|
|
344
|
-
| ZCode | `zcode` | — | ✓ |
|
|
345
|
-
| Any AGENTS.md-standard harness | `agents` | — | ✓ |
|
|
346
|
-
| [Hermes Agent](https://hermes-agent.nousresearch.com/) | `hermes` (native `MemoryProvider` plugin) | — | — |
|
|
347
|
-
|
|
348
|
-
- **[Hermes Agent](https://hermes-agent.nousresearch.com/)** — native `MemoryProvider` plugin
|
|
349
|
-
(`integrations/hermes/`): automatic prefetch, sync-turn, built-in memory mirroring.
|
|
350
|
-
Since plugin **3.0.0** (ADR-0017 D1) the plugin runs **in-process** — it needs `pip install mnemos`
|
|
351
|
-
in the Hermes Python environment, and the legacy `base_url` / `api_key` / `totp_secret` config keys are gone.
|
|
352
|
-
See the [integration guide](docs/en/user/integration-guide.md#hermes-agent).
|
|
353
|
-
- **Native targets** — `mnemos integration setup --target <name>` deploys the
|
|
354
|
-
behavioral pack and registers the MCP server in one pass. See the
|
|
355
|
-
[integration guide](docs/en/user/integration-guide.md).
|
|
356
|
-
- **One-line MCP presets** — [`integrations/mcp-presets.md`](integrations/mcp-presets.md):
|
|
357
|
-
connect Cursor, Claude Code, Codex, or Windsurf by pasting one line.
|
|
358
|
-
- **Adapter template** — [`integrations/adapter-template.md`](integrations/adapter-template.md):
|
|
359
|
-
Connect / Expose / Configure + acceptance checklist for any harness that
|
|
360
|
-
speaks MCP stdio.
|
|
288
|
+
> In Hesiod's *Theogony*, **Mnemosyne** (Μνημοσύνη) is the Titaness of memory — she who, by Zeus, gave
|
|
289
|
+
> birth to the nine Muses and through them made the world's remembering possible. Her name is the root of
|
|
290
|
+
> *mnemonic*, and she is what every singer, poet, and philosopher prays to before they begin.
|
|
361
291
|
|
|
362
|
-
|
|
363
|
-
|
|
292
|
+
This software carries her name because it is built for the same task: **to make remembering possible for
|
|
293
|
+
the things that think.** AI agents, unmoored from any single conversation, lose everything that came
|
|
294
|
+
before. Mnemos gives them a place to lay it down — structured, searchable, governed by contract — so that
|
|
295
|
+
what they learn does not vanish with the closing of a session. The Muses, after all, were not for the
|
|
296
|
+
gods' benefit. They were for the songs.
|
|
364
297
|
|
|
365
298
|
---
|
|
366
299
|
|
|
367
|
-
## ⚖️
|
|
300
|
+
## ⚖️ License & contributing
|
|
368
301
|
|
|
369
|
-
-
|
|
370
|
-
- **License** — MIT (see [pyproject.toml](pyproject.toml)).
|
|
302
|
+
Apache-2.0 — see [LICENSE](LICENSE) and [NOTICE](NOTICE). Source: [github.com/Korrnals/mnemos](https://github.com/Korrnals/mnemos).
|
|
371
303
|
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
PRs welcome. Read [PLAN.md](PLAN.md) for the roadmap and follow the conventions in the [docs/](docs/) set.
|
|
375
|
-
|
|
376
|
-
Git workflow: `feat/*` → `dev-<stage>` → `release/X.Y.Z` → `main`; `main` accepts only `release/*` and
|
|
377
|
-
`hotfix/*` PRs. Conventional Commits required. Run `make verify` before opening a PR.
|
|
378
|
-
|
|
379
|
-
---
|
|
380
|
-
|
|
381
|
-
<p align="center">
|
|
382
|
-
<sub><strong>Reproduce the green state:</strong> <code>make verify</code> runs the full quality gate
|
|
383
|
-
— ruff + mypy --strict + bandit + pip-audit + 867 tests. If it's green, the change is good to ship.</sub>
|
|
384
|
-
</p>
|
|
304
|
+
Contributions are welcome — [CONTRIBUTING.md](CONTRIBUTING.md) has the development setup, the branch
|
|
305
|
+
and commit conventions, and the quality gate a change must pass.
|
package/README.ru.md
CHANGED
|
@@ -7,12 +7,14 @@
|
|
|
7
7
|
|
|
8
8
|
<p align="center">
|
|
9
9
|
<strong>Сервер памяти и знаний для AI-агентов</strong><br>
|
|
10
|
-
<em>назван в честь титаниды памяти, создан для
|
|
10
|
+
<em>назван в честь титаниды памяти, создан для агентов, которым нужно помнить</em>
|
|
11
11
|
</p>
|
|
12
12
|
|
|
13
13
|
<p align="center">
|
|
14
|
+
<a href="https://pypi.org/project/mnemos-memory-server/"><img src="https://img.shields.io/pypi/v/mnemos-memory-server?label=pypi&color=3776ab" alt="PyPI"></a>
|
|
15
|
+
<a href="https://www.npmjs.com/package/pi-mnemos"><img src="https://img.shields.io/npm/v/pi-mnemos?label=npm&color=cb3837" alt="npm"></a>
|
|
14
16
|
<a href="pyproject.toml"><img src="https://img.shields.io/badge/python-3.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-3776ab" alt="Python"></a>
|
|
15
|
-
<a href="pyproject.toml"><img src="https://img.shields.io/badge/license-
|
|
17
|
+
<a href="pyproject.toml"><img src="https://img.shields.io/badge/license-Apache_2.0-blue" alt="License: Apache-2.0"></a>
|
|
16
18
|
<a href="https://github.com/Korrnals/mnemos/releases"><img src="https://img.shields.io/github/v/release/Korrnals/mnemos?label=version&color=blueviolet" alt="Version"></a>
|
|
17
19
|
</p>
|
|
18
20
|
|
|
@@ -21,160 +23,101 @@
|
|
|
21
23
|
</p>
|
|
22
24
|
|
|
23
25
|
<p align="center">
|
|
24
|
-
<a href="#-возможности">Возможности</a> ·
|
|
25
26
|
<a href="#-быстрый-старт">Быстрый старт</a> ·
|
|
27
|
+
<a href="#-возможности">Возможности</a> ·
|
|
26
28
|
<a href="#-что-такое-mnemos">Что это</a> ·
|
|
29
|
+
<a href="#-подключение-любого-харнеса">Подключить харнес</a> ·
|
|
27
30
|
<a href="#%EF%B8%8F-архитектура">Архитектура</a> ·
|
|
28
|
-
<a href="#%EF%B8%8F-три-поверхности-одно-ядро">Поверхности</a> ·
|
|
29
31
|
<a href="#-документация">Документация</a>
|
|
30
32
|
</p>
|
|
31
33
|
|
|
32
34
|
---
|
|
33
35
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
| Область | Что даёт |
|
|
39
|
-
|---------|----------|
|
|
40
|
-
| **Универсальное подключение** | MCP-сервер (26 инструментов, stdio) + REST API — любой харнесс с поддержкой MCP подключается одной строкой ([инструменты](docs/ru/user/mcp-tools.md) · [HTTP](docs/ru/user/http-api.md)) |
|
|
41
|
-
| **Готовые интеграции** | zcode, стандарт `~/.agents` (Claude / Codex / Continue / Qwen и др.), pi — через [`mnemos integration`](docs/ru/user/integration-guide.md): таргеты развёртывания, однострочные MCP-пресеты, доктор мульти-харнесов |
|
|
42
|
-
| **Пакет скиллов** | 14+ скиллов памяти деплоятся в харнесы |
|
|
43
|
-
| **Гибкая память** | Гибридный поиск (полнотекстовый + векторный, слияние ранжирования), [теги-контракт](docs/ru/user/tag-contract.md), память по агентам и проектам, профили [контекстного фильтра](docs/ru/user/context-filter.md), сжатие CCR — экономия 70–90% токенов, оригиналы сохраняются |
|
|
44
|
-
| **Сборка контекста** | `assemble_context`: поиск → сжатие → фильтр → скан секретов → выравнивание кэша → бюджет токенов, провенанс каждого блока |
|
|
45
|
-
| **Мост контекста** | `on_context_rewrite` — при сжатии истории харнессом оригинал без потерь доступен по требованию |
|
|
46
|
-
| **Хуки жизненного цикла** | `pre_llm_call` (впрыск контекста перед запросом модели), `on_session_start`, `post_tool_call` (авто-сжатие выводов инструментов) |
|
|
47
|
-
| **Публикация v3.0.0** | Запись видна сразу после сохранения, фоновая дообработка с бесшовной подменой, карантин с нейтральной ретракцией |
|
|
48
|
-
| **Автозащита** | Детекторы инъекций / секретов на входе и публикации, скан каждой выдачи, полный аудит с привязкой к записи |
|
|
49
|
-
| **Автоконвейер** | Фоновый обработчик: кластеризация, дедупликация, гейт качества, публикация |
|
|
36
|
+
AI-агенты забывают всё, когда сессия заканчивается. Mnemos даёт им место, куда это можно
|
|
37
|
+
положить — структурированно, с поиском, по контракту — чтобы то, что агент узнал, не исчезало
|
|
38
|
+
с закрытием окна.
|
|
50
39
|
|
|
51
|
-
|
|
52
|
-
|
|
40
|
+
- **Локальность прежде всего.** Один процесс на вашей машине. SQLite + встроенная модель эмбеддингов; ничего не покидает хост, без API-ключей, работает офлайн.
|
|
41
|
+
- **Один сервер, любой харнес.** VS Code Copilot, Claude Code, Cursor, OpenCode, Codex, Windsurf, ZCode, pi, Hermes — один и тот же MCP-провод, одна строка на каждого.
|
|
42
|
+
- **Агент учится этим *пользоваться*.** Не только инструменты: always-on инструкции, пакет скиллов и режим промпта «память прежде всего», разворачиваемые в ваш харнес одной командой.
|
|
53
43
|
|
|
54
44
|
---
|
|
55
45
|
|
|
56
46
|
## 🚀 Быстрый старт
|
|
57
47
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
### 1 · Установка
|
|
48
|
+
Три команды от пустой машины до агента, который помнит — и знает, когда заглянуть.
|
|
61
49
|
|
|
62
|
-
|
|
63
|
-
curl -fsSL https://raw.githubusercontent.com/Korrnals/mnemos/main/scripts/install.sh | bash
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
Установщик делает всё за вас — знание Python или venv не требуется:
|
|
67
|
-
|
|
68
|
-
- создаёт изолированное окружение в `~/.mnemos/venv`;
|
|
69
|
-
- кладёт лаунчер `mnemos` в `~/.local/bin`, чтобы CLI работал в любом шелле (**активировать venv не нужно**);
|
|
70
|
-
- тут же предлагает настроить интеграцию VS Code MCP (или сделайте это позже — см. шаг 3).
|
|
71
|
-
|
|
72
|
-
> Нужен неинтерактивный запуск? Добавьте `--mcp` / `--no-mcp`, чтобы выбрать заранее, например
|
|
73
|
-
> `… | bash -s -- --mcp`.
|
|
74
|
-
|
|
75
|
-
### 2 · Запись и поиск
|
|
50
|
+
### 1 · Установите сервер
|
|
76
51
|
|
|
77
52
|
```bash
|
|
78
|
-
|
|
79
|
-
--tags project:mnemos,agent:tech-writer,mnemos:learning
|
|
80
|
-
|
|
81
|
-
mnemos search "помнит между сессиями"
|
|
53
|
+
pip install mnemos-memory-server
|
|
82
54
|
```
|
|
83
55
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
### 3 · Подключение к VS Code (MCP)
|
|
88
|
-
|
|
89
|
-
Если во время установки вы ответили **да** — всё готово, просто перезагрузите окно VS Code.
|
|
90
|
-
Чтобы настроить вручную или на другой машине:
|
|
91
|
-
|
|
92
|
-
```bash
|
|
93
|
-
curl -fsSL https://raw.githubusercontent.com/Korrnals/mnemos/main/scripts/mcp-setup.sh | bash
|
|
94
|
-
```
|
|
56
|
+
Всё в одном пакете: сервер памяти, CLI `mnemos`, REST API и MCP-сервер, с которым разговаривает
|
|
57
|
+
ваш агентский харнес. Модель эмбеддингов встроена — поиск работает полностью офлайн,
|
|
58
|
+
без API-ключей и без загрузок.
|
|
95
59
|
|
|
96
|
-
|
|
97
|
-
в палитре инструментов Copilot, и агенты смогут вызывать `mnemos_add` / `mnemos_search` напрямую.
|
|
60
|
+
> ⚠️ Не перепутайте имя: `pip install mnemos` (без `-memory-server`) — посторонний проект.
|
|
98
61
|
|
|
99
|
-
###
|
|
62
|
+
### 2 · Подключите харнес — и научите его пользоваться памятью
|
|
100
63
|
|
|
101
64
|
```bash
|
|
102
65
|
mnemos integration setup
|
|
103
66
|
```
|
|
104
67
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
по флагам wiring и [руководство по контекстному фильтру](docs/ru/user/context-filter.md)
|
|
112
|
-
— пятиступенчатый очиститель шума, который запускается автоматически при каждом `mnemos_add`.
|
|
113
|
-
|
|
114
|
-
<details>
|
|
115
|
-
<summary><strong>🛠️ Другие способы установки</strong> — из исходников, готовый wheel или контейнер</summary>
|
|
116
|
-
|
|
117
|
-
<br>
|
|
118
|
-
|
|
119
|
-
**Из исходников** (для разработки):
|
|
68
|
+
Один проход: находит агентские харнесы на вашей машине, регистрирует MCP-сервер Mnemos в каждом
|
|
69
|
+
поддерживаемом харнесе (VS Code Copilot, Cursor, ZCode, OpenCode, pi, Hermes и всё, что читает
|
|
70
|
+
стандарт `~/.agents`, — Claude Code, Codex и друзья) и разворачивает **поведенческий пакет** —
|
|
71
|
+
always-on инструкции и скиллы памяти, чтобы агент вспоминал в начале сессии, делал чекпоинт
|
|
72
|
+
до того, как его контекст сожмут, и относился к памяти как к приоритету, а не забывал,
|
|
73
|
+
что инструменты существуют.
|
|
120
74
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
cd mnemos
|
|
124
|
-
uv venv && source .venv/bin/activate
|
|
125
|
-
uv pip install -e ".[dev]"
|
|
126
|
-
```
|
|
75
|
+
Харнес, который не читает ничего стандартного? Один блок для копипаста на каждый:
|
|
76
|
+
[Подключите Mnemos к любому харнесу](integrations/mcp-presets.md).
|
|
127
77
|
|
|
128
|
-
|
|
78
|
+
### 3 · Проверьте — и попробуйте
|
|
129
79
|
|
|
130
|
-
<!-- version:pip -->
|
|
131
80
|
```bash
|
|
132
|
-
|
|
81
|
+
mnemos doctor
|
|
133
82
|
```
|
|
134
|
-
<!-- /version:pip -->
|
|
135
83
|
|
|
136
|
-
|
|
84
|
+
PASS / WARN / FAIL по каждой проверке: хранилище, конфиг, MCP-транспорт, регистрация харнесов
|
|
85
|
+
(`--fix` чинит типовые предупреждения). Затем дайте ему память:
|
|
137
86
|
|
|
138
87
|
```bash
|
|
139
|
-
|
|
140
|
-
|
|
88
|
+
mnemos add "Первая запись — Mnemos помнит между сессиями" \
|
|
89
|
+
--tags project:mnemos,agent:me,mnemos:learning
|
|
90
|
+
mnemos search "помнит между сессиями"
|
|
141
91
|
```
|
|
142
92
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
</details>
|
|
146
|
-
|
|
147
|
-
<details>
|
|
148
|
-
<summary><strong>🐳 Запуск готового образа напрямую (GHCR)</strong></summary>
|
|
93
|
+
Это весь цикл: **записал, нашёл, не потерял — и агент знает, когда заглянуть в память.**
|
|
149
94
|
|
|
150
|
-
|
|
95
|
+
> 📘 **Хотите каждую деталь?** Расширенный гид покрывает все варианты установки (`uv tool`, `pipx`,
|
|
96
|
+
> только CLI, внешние LLM-экстры, скрипт-установщик, контейнер), пошаговое подключение каждого
|
|
97
|
+
> харнеса, конфигурацию и разбор неполадок:
|
|
98
|
+
> **[Начало работы — полное руководство](docs/ru/user/getting-started.md)**.
|
|
151
99
|
|
|
152
|
-
|
|
100
|
+
---
|
|
153
101
|
|
|
154
|
-
|
|
155
|
-
# Сгенерируйте TOTP-ключ (обязательно — контейнер слушает 0.0.0.0)
|
|
156
|
-
export MNEMOS_API__TOTP_MASTER_KEY=$(python3 -c "import secrets; print(secrets.token_urlsafe(32))")
|
|
157
|
-
|
|
158
|
-
podman run -d --name mnemos \
|
|
159
|
-
-p 8787:8787 \
|
|
160
|
-
-v mnemos-data:/data \
|
|
161
|
-
-v mnemos-vault:/vault \
|
|
162
|
-
-e MNEMOS_API__TOTP_MASTER_KEY="${MNEMOS_API__TOTP_MASTER_KEY}" \
|
|
163
|
-
<!-- version:image -->
|
|
164
|
-
ghcr.io/korrnals/mnemos:3.1.0
|
|
165
|
-
<!-- /version:image -->
|
|
166
|
-
|
|
167
|
-
curl -s http://localhost:8787/health | jq
|
|
168
|
-
```
|
|
102
|
+
## ✨ Возможности
|
|
169
103
|
|
|
170
|
-
|
|
171
|
-
Теги: `:3.1.0` (фиксированная) · `:latest` (rolling). Работает и с `docker` — замените `podman` на `docker`.
|
|
172
|
-
<!-- /version:tags -->
|
|
104
|
+
Один локальный сервер — и подключённый агентский харнес получает полный стек памяти.
|
|
173
105
|
|
|
174
|
-
|
|
106
|
+
| Область | Что даёт |
|
|
107
|
+
|---------|----------|
|
|
108
|
+
| **Универсальное подключение** | MCP-сервер (26 инструментов, stdio) + REST API — любой харнесс с поддержкой MCP подключается одной строкой ([инструменты](docs/ru/user/mcp-tools.md) · [HTTP](docs/ru/user/http-api.md)) |
|
|
109
|
+
| **Готовые интеграции** | VS Code Copilot, Claude Code, Cursor, Codex, Windsurf, OpenCode, ZCode, pi, Hermes Agent — однострочные MCP-пресеты для всех, [нативные таргеты развёртывания](docs/ru/user/integration-guide.md) для большинства, мульти-харнесный доктор (`mnemos doctor`) |
|
|
110
|
+
| **Пакет скиллов** | 14+ скиллов памяти разворачиваются в ваши харнесы |
|
|
111
|
+
| **Гибкая память** | Гибридный поиск (полнотекстовый + векторный, слияние рангов) поверх встроенной офлайн-модели `mnema-embed-v1`, [контракт тегов](docs/ru/user/tag-contract.md), память по агентам и проектам, профили [контекстного фильтра](docs/ru/user/context-filter.md), сжатие CCR — экономия 70–90% токенов, оригиналы сохраняются |
|
|
112
|
+
| **Сборка контекста** | `assemble_context`: поиск → сжатие → фильтр → скан секретов → выравнивание кэша → бюджет токенов, провенанс каждого блока |
|
|
113
|
+
| **Мост контекста** | `on_context_rewrite` — когда харнес сжимает историю, оригинал без потерь доступен по требованию |
|
|
114
|
+
| **Хуки жизненного цикла** | `pre_llm_call` — впрыск контекста, `on_session_start`, `post_tool_call` — авто-сжатие вывода инструментов |
|
|
115
|
+
| **Публикация v3.0.0** | Запись видна сразу после сохранения, фоновая дообработка с бесшовной подменой, карантин с нейтральной ретракцией |
|
|
116
|
+
| **Автозащита** | Детекторы инъекций / секретов на входе и на публикации, скан каждого вывода, полный аудит по каждой записи |
|
|
117
|
+
| **Автоконвейер** | Фоновый процессор: кластеризация, дедупликация, гейт качества, публикация |
|
|
175
118
|
|
|
176
|
-
|
|
177
|
-
|
|
119
|
+
Автономность для произвольного харнесса и LLM-дообогащение — частично; полная
|
|
120
|
+
честная карта: [docs/ru/features.md](docs/ru/features.md).
|
|
178
121
|
|
|
179
122
|
---
|
|
180
123
|
|
|
@@ -185,19 +128,52 @@ curl -s http://localhost:8787/health | jq
|
|
|
185
128
|
|
|
186
129
|
| | Возможность | Что это даёт |
|
|
187
130
|
|---|------------|-------------------|
|
|
188
|
-
| 🔎 | **Гибридный поиск** | Векторная близость +
|
|
131
|
+
| 🔎 | **Гибридный поиск** | Векторная близость + SQLite FTS5 полнотекст по каждой записи |
|
|
189
132
|
| 🧪 | **Конвейер знаний** | Жизненный цикл `raw → processing → processed → published` с конечным автоматом |
|
|
190
133
|
| 🧠 | **Recall на агента** | Сфокусированная поверхность recall в контексте проекта каждого агента |
|
|
191
134
|
| ⚙️ | **Движок политик** | Планирование и триггеры автоматизации над хранилищем памяти |
|
|
192
|
-
| 🧹 | **Контекстный фильтр** | Пятиступенчатая очистка логов / stdout
|
|
135
|
+
| 🧹 | **Контекстный фильтр** | Пятиступенчатая очистка шума из логов / stdout до того, как что-то попадёт в модель |
|
|
193
136
|
| 🗜️ | **Обратимое сжатие (CCR)** | Сжатие большого контента без потери данных — оригиналы кэшируются в SQLite, извлекаются по хеш-маркеру |
|
|
194
|
-
| 🧷 | **CacheAligner
|
|
195
|
-
| 🪶 | **Сокращение токенов
|
|
137
|
+
| 🧷 | **CacheAligner** | Перенос динамического контента (таймстампы, UUID, session id, токены) в хвост, чтобы KV-кэши провайдеров (Anthropic `cache_control`, OpenAI prefix caching) попадали между запросами |
|
|
138
|
+
| 🪶 | **Сокращение токенов вывода** | Опциональные параметры `verbosity` / `effort` на `mnemos_add` / `mnemos_search` / `mnemos_recall_context` управляют стилем вывода вызывающей стороны — обратно совместимо, значения по умолчанию — no-op |
|
|
196
139
|
| 📂 | **Path-scoped rules** | Ингест правил проекта и применение их по пути файла |
|
|
197
|
-
| 🗂️ | **Obsidian vault** | Markdown-зеркало, которое люди могут
|
|
140
|
+
| 🗂️ | **Obsidian vault** | Markdown-зеркало, которое люди могут листать, править и грепать |
|
|
198
141
|
|
|
199
142
|
SQLite для метаданных, локальный векторный индекс на numpy + SQLite для recall и Obsidian-совместимый
|
|
200
|
-
vault для людей в
|
|
143
|
+
vault для людей в контуре.
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## 🤝 Подключение любого харнеса
|
|
148
|
+
|
|
149
|
+
Mnemos работает с любым агентским харнесом с поддержкой MCP. Три уровня интеграции —
|
|
150
|
+
выбирайте самый сильный из доступных для вашего харнеса:
|
|
151
|
+
|
|
152
|
+
| Харнесс | Нативная цель | Однострочный MCP-пресет | Шаблон адаптера |
|
|
153
|
+
|---------|---------------|-------------------------|-----------------|
|
|
154
|
+
| VS Code Copilot | `copilot` (+ промпты через `generic-copilot`) | [mcp-setup.sh](scripts/mcp-setup.sh) | ✓ |
|
|
155
|
+
| Claude Code | через `agents` | [пресет](integrations/mcp-presets.md#claude-code) | ✓ |
|
|
156
|
+
| Cursor | `cursor` | [пресет](integrations/mcp-presets.md#cursor) | ✓ |
|
|
157
|
+
| Codex | через `agents` | [пресет](integrations/mcp-presets.md#codex) | ✓ |
|
|
158
|
+
| Windsurf | — | [пресет](integrations/mcp-presets.md#windsurf) | ✓ |
|
|
159
|
+
| OpenCode | — | [пресет](integrations/mcp-presets.md#opencode) | ✓ |
|
|
160
|
+
| ZCode | `zcode` | — | ✓ |
|
|
161
|
+
| Любой харнесс стандарта AGENTS.md | `agents` | — | ✓ |
|
|
162
|
+
| pi | `pi` (бридж-расширение, также на npm как [`pi-mnemos`](https://www.npmjs.com/package/pi-mnemos)) | [пресет](integrations/mcp-presets.md#pi) | ✓ |
|
|
163
|
+
| [Hermes Agent](https://hermes-agent.nousresearch.com/) | `hermes` (нативный in-process плагин `MemoryProvider`) | — | — |
|
|
164
|
+
|
|
165
|
+
- **Нативные таргеты** — `mnemos integration setup --target <имя>` разворачивает поведенческий пакет
|
|
166
|
+
и регистрирует MCP-сервер за один проход ([руководство по интеграции](docs/ru/user/integration-guide.md)).
|
|
167
|
+
- **Однострочные пресеты** — [`integrations/mcp-presets.md`](integrations/mcp-presets.md): каждый
|
|
168
|
+
харнес из таблицы выше, готово к копипасту.
|
|
169
|
+
- **Шаблон адаптера** — [`integrations/adapter-template.md`](integrations/adapter-template.md):
|
|
170
|
+
Connect / Expose / Configure + чеклист приёмки для любого харнеса, говорящего по MCP stdio.
|
|
171
|
+
- **Hermes Agent** запускает Mnemos in-process: `pip install mnemos-memory-server` в Python-окружении
|
|
172
|
+
Hermes, затем `mnemos integration setup --target hermes`
|
|
173
|
+
([подробнее](docs/ru/user/integration-guide.md#hermes-agent)).
|
|
174
|
+
|
|
175
|
+
Общий контракт — [схема тегов](docs/ru/user/tag-contract.md) — `project:<slug>`, `agent:<slug>`
|
|
176
|
+
и хотя бы один `mnemos:<subtype>` — обязательна для каждой записи памяти.
|
|
201
177
|
|
|
202
178
|
---
|
|
203
179
|
|
|
@@ -210,13 +186,13 @@ vault для людей в процессе.
|
|
|
210
186
|
|
|
211
187
|
```mermaid
|
|
212
188
|
flowchart TB
|
|
213
|
-
subgraph CLIENTS["
|
|
214
|
-
C1(["
|
|
189
|
+
subgraph CLIENTS["Clients"]
|
|
190
|
+
C1(["Agent harness\nstdio MCP"])
|
|
215
191
|
C2(["CLI — mnemos …"])
|
|
216
|
-
C3(["HTTP API
|
|
192
|
+
C3(["HTTP API client"])
|
|
217
193
|
end
|
|
218
194
|
|
|
219
|
-
subgraph IFACE["
|
|
195
|
+
subgraph IFACE["Interface Layer"]
|
|
220
196
|
MCP["mcp_server.py"]
|
|
221
197
|
FAPI["api/main.py · FastAPI"]
|
|
222
198
|
TYPER["cli/main.py · Typer"]
|
|
@@ -224,19 +200,19 @@ flowchart TB
|
|
|
224
200
|
|
|
225
201
|
MGR(["MemoryManager\nmanager.py"])
|
|
226
202
|
|
|
227
|
-
subgraph PROC["
|
|
203
|
+
subgraph PROC["Processing Subsystems"]
|
|
228
204
|
CF["Context Filter\nfilter/"]
|
|
229
205
|
PP["Knowledge Pipeline\npipeline/"]
|
|
230
206
|
RE["Recall Engine\nrecall/"]
|
|
231
207
|
PE["Policy Engine\npolicy/"]
|
|
232
208
|
end
|
|
233
209
|
|
|
234
|
-
subgraph BG["
|
|
210
|
+
subgraph BG["Background Services"]
|
|
235
211
|
WA["Watchers\nwatchers/"]
|
|
236
212
|
AC["Auto-collect\nauto_collect.py"]
|
|
237
213
|
end
|
|
238
214
|
|
|
239
|
-
subgraph STORE["
|
|
215
|
+
subgraph STORE["Storage Layer"]
|
|
240
216
|
SQ[("SQLite\nFTS5 · traces · projects")]
|
|
241
217
|
VS[("Vector Store\nnumpy + SQLite")]
|
|
242
218
|
VLT[("Obsidian Vault\nmarkdown mirror")]
|
|
@@ -266,38 +242,23 @@ flowchart TB
|
|
|
266
242
|
|
|
267
243
|
</details>
|
|
268
244
|
|
|
269
|
-
Более глубокий разбор — модель данных, конечные автоматы, границы безопасности, эксплуатационные
|
|
270
|
-
в [architecture/overview.md](docs/ru/architecture/overview.md).
|
|
245
|
+
Более глубокий разбор — модель данных, конечные автоматы, границы безопасности, эксплуатационные
|
|
246
|
+
аспекты — в [architecture/overview.md](docs/ru/architecture/overview.md).
|
|
271
247
|
|
|
272
248
|
---
|
|
273
249
|
|
|
274
250
|
## 🎛️ Три поверхности, одно ядро
|
|
275
251
|
|
|
276
|
-
Один и тот же `MemoryManager`
|
|
252
|
+
Один и тот же `MemoryManager` питает все три интерфейса. Выберите тот, что подходит вашему клиенту.
|
|
277
253
|
|
|
278
254
|
| Поверхность | Когда использовать… | Документация |
|
|
279
255
|
|---------|--------------|-----------|
|
|
280
|
-
| **
|
|
256
|
+
| **MCP** — `mnemos mcp-server` | Вы — агентский харнес; путь, по которому идёт каждый подключённый агент | [mcp-tools.md](docs/ru/user/mcp-tools.md) |
|
|
257
|
+
| **CLI** — `mnemos …` | Вы живёте в шелле, нужен быстрый ad-hoc add / search или скрипты для cron | [cli-reference.md](docs/ru/user/cli-reference.md) |
|
|
281
258
|
| **HTTP** — `mnemos serve` | У вас не-MCP клиент — веб-дашборд, мобильное приложение, CI runner | [http-api.md](docs/ru/user/http-api.md) |
|
|
282
|
-
| **MCP** — `mnemos mcp-server` | Вы VS Code Copilot или любой MCP-aware агент — путь Copilot-агентов | [mcp-tools.md](docs/ru/user/mcp-tools.md) |
|
|
283
|
-
|
|
284
|
-
MCP-поверхность также предоставляет **A2A Sessions API** (M16) — постоянный бэкенд для многошаговых
|
|
285
|
-
разговоров агентов. Пять endpoints (`POST /v1/sessions`, append-turn, range-load, …) позволяют агентам
|
|
286
|
-
переживать рестарты без потери контекста. См. [a2a-sessions.md](docs/ru/architecture/a2a-sessions.md).
|
|
287
|
-
|
|
288
|
-
---
|
|
289
|
-
|
|
290
|
-
## 📖 Лор
|
|
291
259
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
> каждый певец, поэт и философ, прежде чем начать.
|
|
295
|
-
|
|
296
|
-
Это программное обеспечение носит её имя, потому что создано для той же задачи: **сделать воспоминание
|
|
297
|
-
возможным для тех, кто мыслит.** AI-агенты, оторванные от единственного разговора, теряют всё, что было
|
|
298
|
-
до. Mnemos даёт им место, где можно это сохранить — структурированно, с поиском, по контракту — чтобы то,
|
|
299
|
-
что они узнали, не исчезало с закрытием сессии. Музы, в конце концов, были не для богов. Они были для
|
|
300
|
-
песен.
|
|
260
|
+
HTTP-поверхность также открывает **A2A Sessions API** — постоянный бэкенд для многошаговых
|
|
261
|
+
разговоров агентов, которые переживают рестарты. См. [a2a-sessions.md](docs/ru/architecture/a2a-sessions.md).
|
|
301
262
|
|
|
302
263
|
---
|
|
303
264
|
|
|
@@ -306,73 +267,40 @@ MCP-поверхность также предоставляет **A2A Sessions
|
|
|
306
267
|
| Страница | Содержание |
|
|
307
268
|
|------|----------------|
|
|
308
269
|
| [docs/README.md](docs/README.md) | Главная страница документации — выбор языка (EN / RU) |
|
|
309
|
-
| [getting-started.md](docs/ru/user/getting-started.md) | Первый запуск: установка → первая запись → первый поиск →
|
|
310
|
-
| [
|
|
270
|
+
| [getting-started.md](docs/ru/user/getting-started.md) | Первый запуск: установка → первая запись → первый поиск → подключение харнеса |
|
|
271
|
+
| [mcp-presets.md](integrations/mcp-presets.md) | Подключение Mnemos к любому харнесу — однострочные MCP-пресеты (VS Code, Claude Code, Cursor, OpenCode, Codex, Windsurf, pi, Hermes) |
|
|
272
|
+
| [integration-guide.md](docs/ru/user/integration-guide.md) | Поведенческий пакет: инструкции, скиллы, режим промпта, таргеты развёртывания, wiring агентов, плагин Hermes |
|
|
273
|
+
| [features.md](docs/ru/features.md) | Что работает из коробки, что частично, что в планах |
|
|
274
|
+
| [architecture/overview.md](docs/ru/architecture/overview.md) | Устройство системы, модель данных, конечные автоматы, границы безопасности |
|
|
311
275
|
| [cli-reference.md](docs/ru/user/cli-reference.md) | Все подкоманды `mnemos` с флагами, значениями по умолчанию, примерами |
|
|
312
|
-
| [mcp-tools.md](docs/ru/user/mcp-tools.md) | Все инструменты `mnemos_
|
|
313
|
-
| [http-api.md](docs/ru/user/http-api.md) | Все HTTP
|
|
314
|
-
| [
|
|
315
|
-
| [
|
|
316
|
-
| [
|
|
317
|
-
| [
|
|
318
|
-
| [container-deployment.md](docs/ru/admin/runbooks/container-deployment.md) | Сборка, push, compose, podman, Kubernetes, quadlet |
|
|
319
|
-
| [adr/](docs/project/adr/) | Архитектурные решения (ADR) — *почему* за каждым дизайном |
|
|
320
|
-
| [milestones.md](docs/project/milestones.md) | Журнал milestones со статусами |
|
|
321
|
-
| [reports/](docs/project/reports/) | Отчёты о завершённых этапах — итоговый отчёт по каждой фазе дорожной карты |
|
|
276
|
+
| [mcp-tools.md](docs/ru/user/mcp-tools.md) | Все инструменты `mnemos_*`, доступные агентским харнесам |
|
|
277
|
+
| [http-api.md](docs/ru/user/http-api.md) | Все HTTP-эндпоинты (CRUD памяти, workflow, хуки, A2A Sessions) |
|
|
278
|
+
| [tag-contract.md](docs/ru/user/tag-contract.md) | Схема `project:` / `agent:` / `mnemos:`, обязательная для каждой записи памяти |
|
|
279
|
+
| [security.md](docs/ru/admin/security.md) | Модель угроз, SSRF-защита, FTS5 escape, модель аутентификации |
|
|
280
|
+
| [runbooks/](docs/ru/admin/runbooks/) | Установка, миграция, резервное копирование / восстановление, обновление зависимостей, развёртывание в контейнере |
|
|
281
|
+
| [adr/](docs/project/adr/) | Архитектурные решения (ADR) — *почему* за каждым решением в дизайне |
|
|
322
282
|
| [CHANGELOG.md](CHANGELOG.md) | Release notes — формат Keep a Changelog |
|
|
283
|
+
| [CONTRIBUTING.ru.md](CONTRIBUTING.ru.md) | Настройка разработки, git-workflow, quality gate |
|
|
323
284
|
|
|
324
285
|
---
|
|
325
286
|
|
|
326
|
-
##
|
|
287
|
+
## 📖 Легенда
|
|
327
288
|
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
| Харнесс | Нативная цель | Однострочный MCP-пресет | Шаблон адаптера |
|
|
332
|
-
|---------|---------------|-------------------------|-----------------|
|
|
333
|
-
| VS Code Copilot | `copilot` (+ промпты через `generic-copilot`) | [mcp-setup.sh](scripts/mcp-setup.sh) | ✓ |
|
|
334
|
-
| Claude Code | через `agents` | [пресет](integrations/mcp-presets.md#claude-code) | ✓ |
|
|
335
|
-
| Cursor | `cursor` | [пресет](integrations/mcp-presets.md#cursor) | ✓ |
|
|
336
|
-
| Codex | через `agents` | [пресет](integrations/mcp-presets.md#codex) | ✓ |
|
|
337
|
-
| Windsurf | — | [пресет](integrations/mcp-presets.md#windsurf) | ✓ |
|
|
338
|
-
| ZCode | `zcode` | — | ✓ |
|
|
339
|
-
| Любой харнесс стандарта AGENTS.md | `agents` | — | ✓ |
|
|
340
|
-
| [Hermes Agent](https://hermes-agent.nousresearch.com/) | `hermes` (нативный `MemoryProvider` плагин) | — | — |
|
|
341
|
-
|
|
342
|
-
- **[Hermes Agent](https://hermes-agent.nousresearch.com/)** — нативный `MemoryProvider` плагин
|
|
343
|
-
(`integrations/hermes/`): автоматический prefetch, sync-turn, зеркалирование встроенной памяти.
|
|
344
|
-
С версии плагина **3.0.0** (ADR-0017 D1) плагин работает **in-process** — требуется `pip install mnemos`
|
|
345
|
-
в Python-окружении Hermes, а легаси-ключи конфигурации `base_url` / `api_key` / `totp_secret` удалены.
|
|
346
|
-
См. [руководство по интеграции](docs/ru/user/integration-guide.md#hermes-agent).
|
|
347
|
-
- **Нативные цели** — `mnemos integration setup --target <имя>` развёртывает
|
|
348
|
-
поведенческий пакет и регистрирует MCP-сервер за один проход. См.
|
|
349
|
-
[руководство по интеграции](docs/ru/user/integration-guide.md).
|
|
350
|
-
- **Однострочные MCP-пресеты** — [`integrations/mcp-presets.md`](integrations/mcp-presets.md):
|
|
351
|
-
Cursor, Claude Code, Codex и Windsurf подключаются вставкой одной строки.
|
|
352
|
-
- **Шаблон адаптера** — [`integrations/adapter-template.md`](integrations/adapter-template.md):
|
|
353
|
-
Connect / Expose / Configure + чеклист приёмки для любого харнесса,
|
|
354
|
-
говорящего по MCP stdio.
|
|
289
|
+
> В «Теогонии» Гесиода **Мнемосина** (Μνημοσύνη) — титанида памяти. Она, от Зевса, родила девять муз и
|
|
290
|
+
> через них сделала возможным воспоминание мира. Её имя — корень слова *мнемонический*, и к ней
|
|
291
|
+
> обращается каждый певец, поэт и философ, прежде чем начать.
|
|
355
292
|
|
|
356
|
-
|
|
357
|
-
|
|
293
|
+
Это программное обеспечение носит её имя, потому что создано для той же задачи: **сделать воспоминание
|
|
294
|
+
возможным для тех, кто мыслит.** AI-агенты, не привязанные ни к одному разговору, теряют всё, что было
|
|
295
|
+
до. Mnemos даёт им место, куда это можно положить — структурированно, с поиском, по контракту — чтобы
|
|
296
|
+
то, что они узнали, не исчезало с закрытием сессии. Музы, в конце концов, были не для богов. Они были
|
|
297
|
+
для песен.
|
|
358
298
|
|
|
359
299
|
---
|
|
360
300
|
|
|
361
|
-
## ⚖️
|
|
362
|
-
|
|
363
|
-
- **Исходник** — этот репозиторий, [github.com/Korrnals/mnemos](https://github.com/Korrnals/mnemos).
|
|
364
|
-
- **Лицензия** — MIT (см. [pyproject.toml](pyproject.toml)).
|
|
301
|
+
## ⚖️ Лицензия и вклад
|
|
365
302
|
|
|
366
|
-
|
|
303
|
+
Apache-2.0 — см. [LICENSE](LICENSE) и [NOTICE](NOTICE). Исходники: [github.com/Korrnals/mnemos](https://github.com/Korrnals/mnemos).
|
|
367
304
|
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
Git-workflow: `feat/*` → `dev-<этап>` → `release/X.Y.Z` → `main`; `main` принимает только `release/*` и
|
|
371
|
-
`hotfix/*` PR. Обязательны Conventional Commits. Запустите `make verify` перед открытием PR.
|
|
372
|
-
|
|
373
|
-
---
|
|
374
|
-
|
|
375
|
-
<p align="center">
|
|
376
|
-
<sub><strong>Воспроизведите зелёное состояние:</strong> <code>make verify</code> запускает полный
|
|
377
|
-
quality gate — ruff + mypy --strict + bandit + pip-audit + 802 тестов. Если зелёно — готово к публикации.</sub>
|
|
378
|
-
</p>
|
|
305
|
+
Вклад приветствуется — в [CONTRIBUTING.ru.md](CONTRIBUTING.ru.md): настройка окружения разработки,
|
|
306
|
+
конвенции веток и коммитов и quality gate, который должно пройти каждое изменение.
|
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
* has no built-in MCP client by design: tools arrive via TypeScript
|
|
6
6
|
* extensions. This extension spawns `mnemos mcp-server` over stdio, performs
|
|
7
7
|
* the MCP handshake and registers every `mnemos_*` tool as a native Pi tool.
|
|
8
|
+
* It also injects the always-on mnemos behavioral pack into Pi's system
|
|
9
|
+
* prompt (before_agent_start hook) — Pi has no AGENTS.md surface, so the
|
|
10
|
+
* extension is the standing-instructions channel.
|
|
8
11
|
*
|
|
9
12
|
* Deployed by: mnemos integration setup --target pi
|
|
10
13
|
* Location: ~/.pi/agent/extensions/mnemos-mcp.ts
|
|
@@ -19,6 +22,20 @@ import { Type } from "typebox";
|
|
|
19
22
|
const MNEMOS_BIN = process.env.MNEMOS_BIN ?? "mnemos";
|
|
20
23
|
const REQ_TIMEOUT_MS = 60_000;
|
|
21
24
|
|
|
25
|
+
// Standing behavioral pack, injected into the system prompt on every turn
|
|
26
|
+
// (mnemos:integration — kept in sync with integrations/agents_md/). Pi has
|
|
27
|
+
// no AGENTS.md mechanism; for the bridge extension this hint IS the
|
|
28
|
+
// always-on instructions channel.
|
|
29
|
+
const MNEMOS_STANDING_HINT = [
|
|
30
|
+
"# Mnemos memory — always-on rules",
|
|
31
|
+
"",
|
|
32
|
+
"You have persistent shared memory through the `mnemos_*` tools.",
|
|
33
|
+
"- Session start: call mnemos_recall_context(project=<current-project>) BEFORE reading project files; surface a <=4-line memory header. Never block on failure.",
|
|
34
|
+
"- Before context compaction, session end or handoff: mnemos_save_context(project, goals, completed, next_steps) — unsaved context is lost.",
|
|
35
|
+
"- PRIORITY ops: mnemos_search before architectural decisions and before web searches; mnemos_add when you learn something non-obvious or make a decision; mnemos_agent_recall when resuming a named agent role.",
|
|
36
|
+
"- Tag contract on every mnemos_add/mnemos_ingest_url: exactly one project:<slug>, one agent:<slug>, at least one mnemos:<subtype>.",
|
|
37
|
+
].join("\n");
|
|
38
|
+
|
|
22
39
|
interface McpTool {
|
|
23
40
|
name: string;
|
|
24
41
|
description?: string;
|
|
@@ -164,6 +181,14 @@ export default function mnemosMcpBridge(pi: ExtensionAPI) {
|
|
|
164
181
|
}
|
|
165
182
|
|
|
166
183
|
// ── Lifecycle ────────────────────────────────────────────────────────────
|
|
184
|
+
// Standing hint: before_agent_start fires once per system-prompt build;
|
|
185
|
+
// returning an object with systemPrompt appends our pack to Pi's prompt
|
|
186
|
+
// (chained across extensions).
|
|
187
|
+
pi.on("before_agent_start", (event: { systemPrompt?: string }) => {
|
|
188
|
+
const base = typeof event.systemPrompt === "string" ? event.systemPrompt : "";
|
|
189
|
+
if (base.includes("mnemos:integration")) return event; // hint already present — never duplicate
|
|
190
|
+
return { systemPrompt: base + (base ? "\n\n" : "") + MNEMOS_STANDING_HINT };
|
|
191
|
+
});
|
|
167
192
|
pi.on("session_start", (_event: unknown, ctx: Parameters<Parameters<typeof pi.on>[1]>[1]) =>
|
|
168
193
|
connect(ctx as { ui?: { notify: (m: string, l?: string) => void } }),
|
|
169
194
|
);
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@korrlabs/mnemospi",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "Mnemos memory & knowledge server — Pi extension. Spawns `mnemos mcp-server` over stdio and exposes every mnemos_* tool as a native Pi tool, plus the mnemos skill pack.",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"license": "
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
7
|
"author": "Korrnals",
|
|
8
8
|
"homepage": "https://github.com/Korrnals/mnemos",
|
|
9
9
|
"repository": {
|
|
@@ -55,5 +55,13 @@
|
|
|
55
55
|
],
|
|
56
56
|
"publishConfig": {
|
|
57
57
|
"access": "public"
|
|
58
|
+
},
|
|
59
|
+
"pipeline": {
|
|
60
|
+
"npmPublishNames": [
|
|
61
|
+
"pi-mnemos",
|
|
62
|
+
"mnemos-pi",
|
|
63
|
+
"@korrlabs/mnemospi",
|
|
64
|
+
"@korrlabs/mnemos-pi"
|
|
65
|
+
]
|
|
58
66
|
}
|
|
59
67
|
}
|