@lotargo/memory_plugin 1.6.1 → 1.6.3
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/CHANGELOG.md +42 -1
- package/README.md +59 -20
- package/mcp-server/cli/direct_commands.js +10 -1
- package/mcp-server/cli.js +2 -1
- package/mcp-server/codex_config.js +171 -0
- package/mcp-server/codex_diagnostics.js +263 -0
- package/mcp-server/config/config_manager.js +1 -0
- package/mcp-server/db/migrations.js +15 -0
- package/mcp-server/index.js +4 -2
- package/mcp-server/ingest/chunker.js +179 -12
- package/mcp-server/ingest/pipeline.js +3 -3
- package/mcp-server/prompt_manager.js +221 -218
- package/mcp-server/retrieval/retriever.js +142 -12
- package/mcp-server/setup.js +37 -21
- package/mcp-server/tools/rag_tools.js +344 -283
- package/package.json +8 -4
- package/skills/using-memory/SKILL.md +11 -1
package/package.json
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lotargo/memory_plugin",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.3",
|
|
4
4
|
"description": "100% local hybrid RAG memory for AI coding agents (OpenCode, Claude Code, Codex, Antigravity). MCP server + plugin: persistent user facts, document ingestion, vector + SQLite FTS5 retrieval across sessions.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "opencode-plugin/index.js",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"preinstall": "node mcp-server/preinstall.js || true",
|
|
9
9
|
"test": "node tests/run_all.js",
|
|
10
|
+
"test:rag": "node tests/unit/rag_evaluation.test.js",
|
|
10
11
|
"smoke": "node tests/smoke/e2e_real_embeddings.test.js",
|
|
11
|
-
"benchmark": "node mcp-server/benchmarks/run_benchmarks.js"
|
|
12
|
+
"benchmark": "node mcp-server/benchmarks/run_benchmarks.js",
|
|
13
|
+
"benchmark:table-code": "node mcp-server/benchmarks/table_code_retrieval.js"
|
|
12
14
|
},
|
|
13
15
|
"bin": {
|
|
14
16
|
"memory_plugin": "mcp-server/boot.js",
|
|
@@ -31,8 +33,10 @@
|
|
|
31
33
|
"mcp-server/tools",
|
|
32
34
|
"mcp-server/boot.js",
|
|
33
35
|
"mcp-server/cli_boot.js",
|
|
34
|
-
"mcp-server/cli.js",
|
|
35
|
-
"mcp-server/
|
|
36
|
+
"mcp-server/cli.js",
|
|
37
|
+
"mcp-server/codex_config.js",
|
|
38
|
+
"mcp-server/codex_diagnostics.js",
|
|
39
|
+
"mcp-server/index.js",
|
|
36
40
|
"mcp-server/fact_format.js",
|
|
37
41
|
"mcp-server/identity.js",
|
|
38
42
|
"mcp-server/logger.js",
|
|
@@ -32,6 +32,7 @@ You have access to a persistent dual-layer memory engine supercharged with an **
|
|
|
32
32
|
| Move or merge project memories to new target identity | `relink_project_memory` | `directory`, `remote` (target remote URL) |
|
|
33
33
|
| User asks to index a documentation URL, file, or repository | `ingest_document` | `content` (text/file path/URL), `type` ("text", "file", "url"), `title`, `path` |
|
|
34
34
|
| User asks a complex question about indexed docs or code | `query_knowledge_base` | `query`, `limit`, `instruction`, `generateEmbeddings` |
|
|
35
|
+
| User needs multiple queries executed in batch (comparisons, multi-topic) | `batch_query_knowledge_base` | `queries` (array), `limit`, `instruction`, `generateEmbeddings` |
|
|
35
36
|
| Read full raw content of an ambiguous/abstract document | `manage_knowledge_base` | `action: "read_document"`, `docId` |
|
|
36
37
|
| View DB stats, list indexed docs, read/delete docs, export/import snapshots | `manage_knowledge_base` | `action` ("stats", "list", "read_document", "delete", "export_snapshot", "import_snapshot"), `docId`, `snapshotPath` |
|
|
37
38
|
| Re-embed all documents after switching embedding model / dimension | `reindex_knowledge_base` | `model`, `dimension` (optional; defaults to active config) |
|
|
@@ -136,6 +137,14 @@ Use this tool when adding technical documentation, API specs, architectural docu
|
|
|
136
137
|
Use this tool BEFORE answering deep architectural or technical questions when indexed documents exist.
|
|
137
138
|
- Performs **Hybrid RRF/RSF Fusion** combining SQLite FTS5 BM25 keyword matching with dense ONNX vector semantic search.
|
|
138
139
|
- Returns candidate sections with breadcrumb paths and defined code symbols (classes, functions, types).
|
|
140
|
+
- **Policy Expansion** (default: ON): Table summaries and code signatures are automatically expanded to full content for better recall. Disable via config `policyExpansion: false` if pure micro_chunk precision is needed.
|
|
141
|
+
|
|
142
|
+
### Batch Retrieval (`batch_query_knowledge_base`)
|
|
143
|
+
Use when the user needs multiple related queries executed efficiently (comparisons, multi-topic analysis, cross-period reporting).
|
|
144
|
+
- **Single API call** — all queries executed in parallel with one ONNX embedding pass.
|
|
145
|
+
- Returns one result set per query, in the same order as input.
|
|
146
|
+
- **Example use cases**: "Compare Q1 vs Q2 vs Q3 revenue", "Find data for category A and category B".
|
|
147
|
+
- **Efficiency**: ~N× faster than N separate `query_knowledge_base` calls for N queries (shared ONNX inference).
|
|
139
148
|
|
|
140
149
|
#### Query Formulation Rules (CRITICAL for retrieval quality)
|
|
141
150
|
|
|
@@ -200,7 +209,8 @@ When working in multi-server environments (e.g., OpenCode, Claude Code), you mig
|
|
|
200
209
|
|
|
201
210
|
1. **Read Memories First (MANDATORY)**: At the very start of any session or conversation, your VERY FIRST STEP MUST BE to execute `recall` with `scope: "all"` (and without restrictive query filters) to load ALL saved global facts, user context, and project guidelines BEFORE performing any other task or code analysis. Do NOT filter or restrict the initial `recall` call with specific query keywords.
|
|
202
211
|
2. **Be Proactive**: When the user mentions a durable preference, personal fact, or constraint, save it immediately using `remember`. Do not wait for explicit user commands.
|
|
203
|
-
3. **Check Knowledge Base First**: If a query is related to specialized documentation, APIs, or project architectures, call `query_knowledge_base` using concept-dense search phrases.
|
|
212
|
+
3. **Check Knowledge Base First**: If a query is related to specialized documentation, APIs, or project architectures, call `query_knowledge_base` using concept-dense search phrases. For multi-part queries (comparisons, cross-period analysis), prefer `batch_query_knowledge_base` to reduce API calls and ONNX inference overhead.
|
|
213
|
+
4. **Optimize Search Queries**: Transform the user's natural language question into targeted search queries. "Compare revenue in Q1 vs Q3" → `["Выручка план факт Q1 2025", "Выручка план факт Q3 2025"]`. Avoid sending raw conversational questions to the RAG — formulated queries improve fact retrieval by 20-40%.
|
|
204
214
|
4. **Inspect Ambiguous Docs Directly**: If querying produces low relevance scores on abstractly-named documents, call `manage_knowledge_base(action: "read_document")` to inspect the full text directly.
|
|
205
215
|
5. **Keep Memory Clean**: If a preference changes, call `update_fact` to edit it in place, or `remember` with `supersedes` to keep a version trail. Use `keep: true` for facts that must survive an accidental `forget`, and give ephemeral facts a `ttl` so stale ones surface as `[EXPIRED]`.
|
|
206
216
|
6. **Leverage MCP Servers**: Proactively list available tools using `list-mcp-tools` and query `mcp-reminder` if unsure of which platform tool can help you automate tasks.
|