@yugabytedb/meko-mcp 2.2.0 → 2.5.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/README.md +168 -61
- package/assets/hooks-handlers/lib/capture-cleanup-cli.js +2134 -0
- package/assets/hooks-handlers/lib/capture-notices.js +224 -14
- package/assets/hooks-handlers/lib/capture-state.js +206 -1
- package/assets/hooks-handlers/lib/capture-status-cli.js +6 -2
- package/assets/hooks-handlers/lib/capture.js +1364 -139
- package/assets/hooks-handlers/lib/checkpoint-timer.js +445 -18
- package/assets/hooks-handlers/lib/journal-bridge.js +218 -0
- package/assets/hooks-handlers/lib/kiro-handler.js +26 -4
- package/assets/hooks-handlers/lib/opencode-handler.js +643 -0
- package/assets/hooks-handlers/lib/opencode-normalizer.js +145 -0
- package/assets/hooks-handlers/lib/terminal-handoff.js +10 -1
- package/assets/opencode-plugin/meko.js +213 -0
- package/assets/scripts/meko-statusline.sh +102 -19
- package/assets/skills/meko-mcp-tools/SKILL.md +59 -16
- package/assets/skills/meko-mcp-tools/references/_sections.md +2 -2
- package/assets/skills/meko-mcp-tools/references/tools-agent-id-conventions.md +15 -7
- package/assets/skills/meko-mcp-tools/references/tools-cookbook.md +275 -19
- package/assets/skills/meko-mcp-tools/references/tools-datapack-workflow.md +7 -4
- package/assets/skills/meko-mcp-tools/references/tools-known-limitations.md +39 -11
- package/assets/skills/meko-mcp-tools/references/tools-memory-vs-conversation.md +10 -6
- package/assets/skills/meko-mcp-tools/references/tools-overview.md +44 -29
- package/assets/skills/meko-mcp-tools/references/tools-rag-workflow.md +79 -14
- package/assets/skills/meko-mcp-tools/references/tools-troubleshooting.md +47 -1
- package/assets/skills/meko-mcp-tools/references/tools-user-id-conventions.md +6 -39
- package/assets/skills/meko-mcp-tools-desktop/SKILL.md +57 -21
- package/assets/skills/meko-mcp-tools-desktop/desktop/README.md +4 -4
- package/assets/skills/meko-mcp-tools-desktop/references/_sections.md +1 -1
- package/assets/skills/meko-mcp-tools-desktop/references/tools-agent-id-conventions.md +8 -6
- package/assets/skills/meko-mcp-tools-desktop/references/tools-cookbook.md +284 -38
- package/assets/skills/meko-mcp-tools-desktop/references/tools-known-limitations.md +32 -10
- package/assets/skills/meko-mcp-tools-desktop/references/tools-memory-vs-conversation.md +16 -12
- package/assets/skills/meko-mcp-tools-desktop/references/tools-overview.md +46 -31
- package/assets/skills/meko-mcp-tools-desktop/references/tools-rag-workflow.md +79 -14
- package/assets/skills/meko-mcp-tools-desktop/references/tools-troubleshooting.md +69 -1
- package/assets/skills/meko-select-datapack-desktop/SKILL.md +93 -14
- package/assets/skills/meko-select-datapack-desktop/references/cookbook.md +44 -12
- package/assets/skills/meko-select-datapack-desktop/references/role-display-future.md +14 -10
- package/assets/skills/meko-select-datapack-desktop/references/troubleshooting.md +17 -5
- package/bin/create-meko-setup.mjs +186 -30
- package/lib/autofix.mjs +100 -0
- package/lib/browser-login.mjs +495 -0
- package/lib/capture-cleanup.mjs +63 -0
- package/lib/clients/claude-code.mjs +1 -0
- package/lib/clients/codex.mjs +80 -35
- package/lib/clients/common.mjs +7 -0
- package/lib/clients/index.mjs +2 -0
- package/lib/clients/kiro.mjs +5 -5
- package/lib/clients/opencode.mjs +537 -0
- package/lib/config.mjs +68 -1
- package/lib/installer.mjs +18 -2
- package/lib/migrate/adapters/claude-code.mjs +11 -2
- package/lib/migrate/adapters/codex.mjs +9 -2
- package/lib/migrate/adapters/memory-md.mjs +27 -8
- package/lib/migrate/adapters/opencode.mjs +148 -0
- package/lib/migrate/claude-parser.mjs +153 -9
- package/lib/migrate/datapack.mjs +254 -16
- package/lib/migrate/id.mjs +195 -13
- package/lib/migrate/mcp-client.mjs +59 -1
- package/lib/migrate/opencode-normalizer.mjs +132 -0
- package/lib/migrate/orchestrator.mjs +294 -78
- package/lib/migrate/progress.mjs +239 -5
- package/lib/migrate/registry.mjs +72 -0
- package/lib/migrate.mjs +97 -9
- package/lib/validate.mjs +111 -22
- package/package.json +5 -5
- package/scripts/bundle-assets.mjs +4 -0
|
@@ -4,15 +4,15 @@ description: Behavioral guide for AI agents using Meko MCP tools. Triggers when
|
|
|
4
4
|
license: MIT
|
|
5
5
|
metadata:
|
|
6
6
|
author: Meko
|
|
7
|
-
version: "3.
|
|
7
|
+
version: "3.4.0"
|
|
8
8
|
tags: mcp, tools, datapack, memory, conversation, rag, meko
|
|
9
9
|
---
|
|
10
10
|
|
|
11
11
|
# Meko MCP Tools — Agent Behavioral Guide
|
|
12
12
|
|
|
13
|
-
Meko is agent-native data infrastructure that enables continuous learning from context windows through collective memory and shared knowledge. This skill teaches you how to use Meko's
|
|
13
|
+
Meko is agent-native data infrastructure that enables continuous learning from context windows through collective memory and shared knowledge. This skill teaches you how to use Meko's 28 MCP tools available in production.
|
|
14
14
|
|
|
15
|
-
**Read this first.** On Claude Code, conversation capture is automatic (SessionStart / PreCompact / SessionEnd hooks) and the Meko server extracts durable memories from the captured turns on its own. Facts the user states in conversation are saved for you — you do **not** proactively call `memory_add` for them. Your active jobs are: **recall** what's already known (`memory_search
|
|
15
|
+
**Read this first.** On Claude Code, conversation capture is automatic (SessionStart / PreCompact / SessionEnd hooks) and the Meko server extracts durable memories from the captured turns on its own. Facts the user states in conversation are saved for you — you do **not** proactively call `memory_add` for them. Your active jobs are: **recall** what's already known (`context_search` first, then `memory_search` or `knowledgebase_search` for a single source), and the **few** save cases automatic extraction cannot reach. Details below.
|
|
16
16
|
|
|
17
17
|
## Non-negotiable operating contracts
|
|
18
18
|
|
|
@@ -22,8 +22,8 @@ Apply these rules before the longer guidance below. They are service-contract sa
|
|
|
22
22
|
|
|
23
23
|
Inspect the response envelope before its contents:
|
|
24
24
|
|
|
25
|
-
1. If `error` or an error-shaped `detail` is present, the search **failed** and its findings are **unknown**. Say exactly that. Never say "nothing was found," "no results," or "the store is empty."
|
|
26
|
-
2. Do not retry quota (`free_tier_limit_reached`) or
|
|
25
|
+
1. If `error` or an error-shaped `detail` is present, or the whole response is an error string (for example `Error searching memories: ...` or `[Errno 111] Connection refused`), the search **failed** and its findings are **unknown**. Say exactly that. Never say "nothing was found," "no results," or "the store is empty."
|
|
26
|
+
2. Do not retry quota (`free_tier_limit_reached`), permission (403), or validation errors. Report the error and stop. The one exception is `datapack_access_denied`: retry it once, because the server's access check also fails closed on a transient database error. Retry only documented transient failures (see `tools-troubleshooting.md`), with a bounded backoff. For `PAT_RATE_LIMITED`, wait out the retry-after (about 60s) before retrying.
|
|
27
27
|
3. Only a successful response with an explicit empty `results` array proves a legitimate empty search.
|
|
28
28
|
|
|
29
29
|
### 2. Treat `memory_get_all` as a recent window, never an export
|
|
@@ -39,6 +39,7 @@ If no candidate supports an answer, abstain: say the retrieved evidence does not
|
|
|
39
39
|
### 4. Verify writes and enforce real isolation
|
|
40
40
|
|
|
41
41
|
- A success-shaped write response is not proof. Read back memories and conversations. For artifacts, compute SHA-256 locally, require the matching `content_hash`, then read back important bytes. A missing hash means the upload is unconfirmed.
|
|
42
|
+
- A read-back must use the same `datapack_id` as the write. Checking the default datapack after writing to a pinned one proves nothing.
|
|
42
43
|
- `agent_id` attributes writes; it is not an access boundary. Put projects, tenants, or security domains that must not co-discover content in separate datapacks.
|
|
43
44
|
|
|
44
45
|
## `agent_id` — multi-agent identity
|
|
@@ -47,9 +48,11 @@ Use the SessionStart-injected `agent_id` verbatim. It normally has shape `<clien
|
|
|
47
48
|
|
|
48
49
|
**Read scoping varies by tool:**
|
|
49
50
|
- `memory_search` / `memory_get_all` — scoped to `(datapack_id, user_id)`; `agent_id` does not filter results. Do not fan out reads by agent.
|
|
50
|
-
- `conversation_get`
|
|
51
|
+
- `conversation_get`, `conversation_add_message`, `conversation_update`, `conversation_delete`: agent-owned. Pass the exact `agent_id` that created the conversation; any other value returns `agent_id_mismatch`.
|
|
52
|
+
- `memory_delete_all`: deletes only the passed `agent_id`'s bucket, even though memory reads span every agent. A `memory_search` preview can show rows this call won't delete.
|
|
51
53
|
- `conversation_list` — user/datapack scoped; `agent_id` is trace attribution only.
|
|
52
54
|
- `knowledgebase_search` — datapack scoped; `agent_id` is ignored.
|
|
55
|
+
- `context_search`: the memory and KB buckets follow the rules above. The conversation bucket is broader than both: it spans every user and agent on the datapack, and `agent_id` doesn't filter it.
|
|
53
56
|
|
|
54
57
|
See `tools-agent-id-conventions.md` for the full model, including how promotion works and how to phrase broad-query responses to the user. Legacy IDs remain readable through the same personal-memory read.
|
|
55
58
|
|
|
@@ -77,6 +80,8 @@ Meko context (inherited from parent session):
|
|
|
77
80
|
|
|
78
81
|
Reuse the inherited conversation unless the parent or user explicitly requests a fresh scope. Always reuse the inherited agent ID.
|
|
79
82
|
|
|
83
|
+
Parallel subagents writing to one conversation have hit intermittent `not_found` or `agent_id_mismatch` ("conversation belongs to agent 'None'") on `conversation_add_message` right after `conversation_create`, while other subagents succeeded with identical arguments. Retry that call once with the same `seed` after a few seconds. If it still fails, don't create a replacement conversation: save the durable findings with `memory_add` and tell the parent the transcript for that subagent is incomplete.
|
|
84
|
+
|
|
80
85
|
**You may be the subagent.** If no SessionStart context named a `conversation_id`, assume you are one and look for the block above in your prompt. If it is absent, do not guess, invent IDs, use the nil UUID, or write — ask the parent for both values.
|
|
81
86
|
|
|
82
87
|
## Core principle: capture is automatic — recall, don't re-store
|
|
@@ -93,11 +98,11 @@ Recall first; save only what capture cannot reach; never re-store a just-stated
|
|
|
93
98
|
| User corrects a prior fact | Capture adds the correction but may retain the old fact; find and update/delete the stale memory when it must not survive. |
|
|
94
99
|
| User explicitly says "remember this" / "save this to memory" | `memory_add` (verbatim). This is the clearest explicit-save case. |
|
|
95
100
|
| A durable fact appears only in assistant output or a tool result | `memory_add`; automatic extraction reads the user turn. |
|
|
96
|
-
| User asks "what do you know about X?" |
|
|
101
|
+
| User asks "what do you know about X?" | `context_search`. One call returns separate memory, knowledge-base, and past-conversation buckets; report each. Confirm an empty memory or KB bucket with `memory_search` or `knowledgebase_search` before saying nothing is stored. |
|
|
97
102
|
| User asks "what do we (as a team) know about X?" or about uploaded documents | `knowledgebase_search` (returns uploaded docs + promoted memories). |
|
|
98
103
|
| User asks to share private memories | Follow the exact-ID `memory_promote` confirmation workflow below. |
|
|
99
|
-
| User provides structured/tabular data (CSV, data dictionary) |
|
|
100
|
-
| User wants to add documents to the team's knowledge base |
|
|
104
|
+
| User provides structured/tabular data (CSV, data dictionary) | If it's an actual file the user wants in the team's knowledge base, `knowledgebase_upload_document` accepts `.csv` directly (confirm first; see below). If it's pasted/described data with no file behind it, still don't `memory_add` it row-by-row — ask the user for it as a file, or point them at the UI's Add Knowledge upload. |
|
|
105
|
+
| User wants to add documents to the team's knowledge base | Uploading adds the file to the datapack's shared knowledge base, which every member can read, so ask first: name the file and the datapack, say the team will see it, and upload only after the user says yes. If you (the agent) have the file's bytes, call `knowledgebase_upload_document`. Otherwise point the user at the Cloud UI flow — Datapack → Actions → **Add Knowledge** (PDF/TXT/MD/JSON/CSV/XML/HTML, 5MB Free / 50MB Standard / 60MB Pro+ each, 10/batch). KB *lifecycle* (index/source management) is still UI-only. |
|
|
101
106
|
|
|
102
107
|
### When to call memory_add
|
|
103
108
|
|
|
@@ -122,6 +127,8 @@ memory_search(query="destructive <action type> preferences feedback",
|
|
|
122
127
|
|
|
123
128
|
A single search covers all of this user's agents. Memory is supplemental evidence, not authorization: a relevant preference can require more caution, but an empty search never authorizes destruction. Follow host approval rules and prefer previews.
|
|
124
129
|
|
|
130
|
+
If your host's policy doesn't let you run a Meko delete tool even when the user asks, say so plainly and hand the user what they need to do it themselves: the exact memory or conversation IDs, a one-line summary of each, and the tool call to run from a client that allows deletes. Don't report the data as deleted.
|
|
131
|
+
|
|
125
132
|
### Capture rules
|
|
126
133
|
|
|
127
134
|
- **Verbatim content only** — never summarize, rephrase, or condense. See `tools-memory-vs-conversation.md`.
|
|
@@ -129,6 +136,21 @@ A single search covers all of this user's agents. Memory is supplemental evidenc
|
|
|
129
136
|
- **Always use a seed** — enables dedup across the three capture mechanisms.
|
|
130
137
|
- **Graceful failure** — if `conversation_add_message` fails, log the error and continue. Do not retry more than once.
|
|
131
138
|
|
|
139
|
+
### Long-running conversations
|
|
140
|
+
|
|
141
|
+
Meko stores a conversation as one Langfuse trace, and Langfuse refuses to load a trace larger than its size limit. After a long session crosses that limit, reads of the session's own conversation fail even though the conversation exists:
|
|
142
|
+
|
|
143
|
+
- `conversation_get` and `conversation_update` return `{"error": "not_found", "detail": "Conversation <id> not found"}`, or the call times out.
|
|
144
|
+
- On servers without the MEKO-714 fix, `conversation_add_message` returns the same `not_found`.
|
|
145
|
+
|
|
146
|
+
When this happens on the conversation you've been using all session, accept the error and keep working:
|
|
147
|
+
|
|
148
|
+
- Don't retry the call, create a replacement conversation, or replay earlier messages. Each replay makes the trace larger, and recreating the conversation has caused capture loops.
|
|
149
|
+
- Skip the read-back for that conversation. Tell the user once that Meko can't load this conversation because it's too large, and don't report it as data loss.
|
|
150
|
+
- Keep using `context_search`, the `memory_*` tools, and `knowledgebase_search`. They don't load the conversation trace.
|
|
151
|
+
|
|
152
|
+
A `not_found` for a conversation you just created, or one this session never wrote to, has other causes; see `tools-troubleshooting.md`.
|
|
153
|
+
|
|
132
154
|
## Calling tools correctly on the first attempt
|
|
133
155
|
|
|
134
156
|
**Use only the required parameters. Do not guess optional parameters.**
|
|
@@ -150,6 +172,27 @@ Required parameters: `text`, `conversation_id`. On **writes**, `conversation_id`
|
|
|
150
172
|
|
|
151
173
|
**Write one coherent fact per memory**, with the identifiers a later search will use — never a transcript or multi-topic dump; focused memories retrieve better and read far faster.
|
|
152
174
|
|
|
175
|
+
### context_search: default first call for recall
|
|
176
|
+
|
|
177
|
+
```
|
|
178
|
+
context_search(
|
|
179
|
+
query="auth migration decisions",
|
|
180
|
+
agent_id="<your-agent-id>",
|
|
181
|
+
conversation_id="<session_conversation_id>",
|
|
182
|
+
datapack_id="<pinned datapack UUID, if any>")
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
Required parameters: `query`, `conversation_id`. It queries memory, the knowledge base, and the conversation-history cache in parallel and returns `{"results": {"memory": [...], "knowledge_base": [...], "conversation": {"hits": [...], "thread": [...]}}, "token_savings": {...}}`.
|
|
186
|
+
|
|
187
|
+
- Read every bucket. A KB document can supersede a memory or a past conversation; nothing is hidden by another source's hit.
|
|
188
|
+
- An empty bucket is ambiguous: either that source found nothing relevant, or it failed. `context_search` turns a failed source into an empty list and records the error only in the trace. Before you tell the user nothing is stored about X, confirm with `memory_search` or `knowledgebase_search`, which return errors.
|
|
189
|
+
- A bucket is `null` only when that source wasn't queried: `force_source` excluded it, or the server couldn't build a query vector for it.
|
|
190
|
+
- The conversation bucket is datapack-wide. It returns embedded turns from every user and agent on the datapack, and each hit carries its author's `user_id`. Don't present a hit as this user's own history.
|
|
191
|
+
- `limit` bounds the memory and KB buckets only; the conversation bucket returns up to 10 hits plus a thread of whole turns.
|
|
192
|
+
- The memory bucket has no similarity floor on the default path, so it can contain weak rows. Discount them against the other buckets instead of treating them as answers.
|
|
193
|
+
- Set `force_source` to `"memory"`, `"knowledge_base"`, or `"conversation"` only when you already know the one source you need.
|
|
194
|
+
- Use `memory_search` or `knowledgebase_search` directly when you need `run_id` filtering, the memory similarity floor, or exact document IDs for `knowledgebase_delete_document`.
|
|
195
|
+
|
|
153
196
|
### memory_search — correct call pattern
|
|
154
197
|
|
|
155
198
|
```
|
|
@@ -159,9 +202,9 @@ memory_search(
|
|
|
159
202
|
conversation_id="<session_conversation_id>")
|
|
160
203
|
```
|
|
161
204
|
|
|
162
|
-
Required parameters: `query`, `
|
|
205
|
+
Required parameters: `query`, `conversation_id`. On **`memory_search`** specifically, `conversation_id` is used only for Langfuse trace nesting — it does NOT filter results. Pass the session's UUID so the search span appears under the active conversation in Observe. Never pass `""`: production `memory_search` currently fails on an empty value (MEKO-707). If you have no conversation yet, pass a freshly generated 32-character lowercase hex id (a UUID with the hyphens removed); on a read it only nests the trace.
|
|
163
206
|
|
|
164
|
-
`agent_id` does not filter what `memory_search` returns — one call covers every agent's rows for this user, including the `meko_agent` bucket (see Read scoping above).
|
|
207
|
+
`agent_id` does not filter what `memory_search` returns — one call covers every agent's rows for this user, including the `meko_agent` bucket (see Read scoping above). Results below a server-configured similarity floor (default 0.2) are dropped, so an empty `results` list can mean "only weak matches", not "nothing stored".
|
|
165
208
|
|
|
166
209
|
Evidence going into reasoning follows operating contract 3 (retrieve ≤ ~25, pass ≤ ~10).
|
|
167
210
|
|
|
@@ -180,7 +223,7 @@ knowledgebase_search(
|
|
|
180
223
|
limit=10)
|
|
181
224
|
```
|
|
182
225
|
|
|
183
|
-
Required parameters: `query`, `
|
|
226
|
+
Required parameters: `query`, `conversation_id`, `datapack_id`. `datapack_id` has no default here. `agent_id` is ignored for filtering — results are the team's shared knowledge on the datapack regardless of what you pass.
|
|
184
227
|
|
|
185
228
|
For recalling working memories — especially recently-changed facts — prefer `memory_search`; the knowledge base is the team's publish/archive surface.
|
|
186
229
|
|
|
@@ -201,7 +244,7 @@ The Cloud UI's Learnings tab remains an alternative user-driven path.
|
|
|
201
244
|
### Critical parameter rules
|
|
202
245
|
|
|
203
246
|
- **agent_id**: Per-session value, injected via `additionalContext` by the SessionStart hook. Shape: `<client>:<repo-basename>`. Pass verbatim on project-scoped writes and reads. Pass `"meko_agent"` for the cross-project common bucket (or empty/omit — server rewrites empty to `meko_agent`). Ignored on `knowledgebase_search`. See `tools-agent-id-conventions.md`.
|
|
204
|
-
- **conversation_id**: the conversation's ID *is* its trace ID, so every call carrying it becomes a span under that conversation in the Observe hub. On write tools (`memory_add`, `conversation_add_message`) pass a real UUID from `conversation_create` or the SessionStart hook — a nil/empty value orphans the trace. On
|
|
247
|
+
- **conversation_id**: the conversation's ID *is* its trace ID, so every call carrying it becomes a span under that conversation in the Observe hub. On write tools (`memory_add`, `conversation_add_message`) pass a real UUID from `conversation_create` or the SessionStart hook — a nil/empty value orphans the trace. On read tools it only nests the trace (it does not filter), but it must still be a 32-hex id: `memory_search` fails on `""`, and most other tools reject it with `conversation_id_required`. Never pass `"current"` or other non-UUID junk.
|
|
205
248
|
- **When in doubt about optional parameters, omit them.** The server has sensible defaults.
|
|
206
249
|
|
|
207
250
|
### Verify after writing
|
|
@@ -209,7 +252,7 @@ The Cloud UI's Learnings tab remains an alternative user-driven path.
|
|
|
209
252
|
Never confirm a successful save to the user without first validating via a read-back. `{"status": "accepted"}` or HTTP 200 from a write tool is not proof of persistence — indexing lag, silent server errors, and wrong-datapack routing all surface as "the write looked fine but nothing is there." Always read back before reporting success.
|
|
210
253
|
|
|
211
254
|
- **After `memory_add`**: call `memory_search` with a distinctive token from the stored text (a name, UUID, rare phrase — not a common word). Assert the new memory appears in the results. Only then tell the user it was saved.
|
|
212
|
-
- **After `conversation_add_message`**: call `conversation_get(include_messages=true)` with the returned `conversation_id`. Assert `message_count` > 0 and that the new message is in the returned list.
|
|
255
|
+
- **After `conversation_add_message`**: call `conversation_get(include_messages=true)` with the returned `conversation_id`. Assert `message_count` > 0 and that the new message is in the returned list. On a long conversation whose trace is too large for Langfuse, `conversation_get` returns `not_found` even though the write landed. Follow "Long-running conversations" above instead of re-posting or recreating the conversation.
|
|
213
256
|
- **After `artifact_put`**: operating contract 4 — the locally-computed SHA-256 must match the returned `content_hash` (a rate-limited or errored put carries **none**); read back important artifacts via `artifact_get` and compare bytes.
|
|
214
257
|
- **On verification failure**: tell the user the save did not succeed — do **not** claim it did. Include the verification-failure detail (empty search, missing message, HTTP error) so they can act — wrong datapack, scope mismatch, expired API key are the common causes.
|
|
215
258
|
|
|
@@ -234,13 +277,13 @@ On the first Meko tool call in a fresh session (no prior Meko tool call since pr
|
|
|
234
277
|
|
|
235
278
|
## Budgeting calls
|
|
236
279
|
|
|
237
|
-
`memory_add` takes ~10s for a one-line fact and ~20-30s for document-sized text; `memory_search` ~2-6s. Sustained bulk ingest throttles to roughly per-call latency — run large ingests as background jobs. `memory_search`, `knowledgebase_search`, and `memory_add` also draw from **lifetime per-user quotas** on Free/Standard tiers, so budget latency *and* call count. `datapack_id` is optional on most tools (default datapack) but **required** on `knowledgebase_search`. See `tools-known-limitations.md`.
|
|
280
|
+
`memory_add` takes ~10s for a one-line fact and ~20-30s for document-sized text; `memory_search` ~2-6s. Sustained bulk ingest throttles to roughly per-call latency — run large ingests as background jobs. `memory_search`, `knowledgebase_search`, and `memory_add` also draw from **lifetime per-user quotas** on Free/Standard tiers, and `context_search` and `conversation_add_message` on the Free tier, so budget latency *and* call count. `datapack_id` is optional on most tools (default datapack) but **required** on `knowledgebase_search`. See `tools-known-limitations.md`.
|
|
238
281
|
|
|
239
282
|
## Reference sections
|
|
240
283
|
|
|
241
284
|
| File | What it covers |
|
|
242
285
|
|------|---------------|
|
|
243
|
-
| `tools-overview.md` | Complete catalog of all
|
|
286
|
+
| `tools-overview.md` | Complete catalog of all 28 tools available in production, with decision tree |
|
|
244
287
|
| `tools-cookbook.md` | Per-tool examples with correct parameters, responses, and error cases |
|
|
245
288
|
| `tools-memory-vs-conversation.md` | When to use memory tools vs conversation tools |
|
|
246
289
|
| `tools-datapack-workflow.md` | Datapack lifecycle and datapack_id routing |
|
|
@@ -6,7 +6,7 @@ description: Maps reference files to their topics for the meko-mcp-tools skill
|
|
|
6
6
|
# Reference Sections
|
|
7
7
|
|
|
8
8
|
## Tool Selection & Catalog
|
|
9
|
-
- [tools-overview.md](tools-overview.md) — Complete catalog of all
|
|
9
|
+
- [tools-overview.md](tools-overview.md) — Complete catalog of all 28 tools available in production, with a decision tree
|
|
10
10
|
|
|
11
11
|
## Tool-Specific Guidance
|
|
12
12
|
- [tools-memory-vs-conversation.md](tools-memory-vs-conversation.md) — Decision framework: memory_add vs conversation_create/conversation_add_message
|
|
@@ -18,7 +18,7 @@ description: Maps reference files to their topics for the meko-mcp-tools skill
|
|
|
18
18
|
|
|
19
19
|
## Conventions & Deduplication
|
|
20
20
|
- [tools-agent-id-conventions.md](tools-agent-id-conventions.md) — agent_id naming rules, hyphen prohibition, and namespace isolation
|
|
21
|
-
- [tools-user-id-conventions.md](tools-user-id-conventions.md) —
|
|
21
|
+
- [tools-user-id-conventions.md](tools-user-id-conventions.md) — how the server resolves user_id from your credentials, and how it and agent_id scope memory
|
|
22
22
|
- [tools-conversation-dedup.md](tools-conversation-dedup.md) — Seed-based deterministic trace IDs for Langfuse deduplication
|
|
23
23
|
|
|
24
24
|
## Practical Usage
|
|
@@ -14,7 +14,16 @@ Each memory is written under an `agent_id` (stored on the row, shown as the UI b
|
|
|
14
14
|
| Loose client name | Non-coding agents (Claude Desktop, generic MCP clients) where there's no project concept. | `claude_desktop` |
|
|
15
15
|
| `meko_agent` | Cross-project common bucket — facts any agent should see regardless of project (user identity, global preferences). The server stores empty/missing `agent_id` here automatically. | `meko_agent` |
|
|
16
16
|
|
|
17
|
-
**Discover the value at session start.** The SessionStart hook injects the chosen `agent_id` into the first-turn `additionalContext
|
|
17
|
+
**Discover the value at session start.** The SessionStart hook injects the chosen `agent_id` into the first-turn `additionalContext`. Project-scoped ids are derived by walking parents of the session cwd for `.git` and taking the repo-root basename; the walk stops at `$HOME`, so a git-tracked home directory does not claim every directory beneath it. Sessions outside any repo get the bare client name (`claude_code`), not a leaf basename.
|
|
18
|
+
|
|
19
|
+
Use the injected value verbatim — do not re-derive it. A resumed session, or one that re-fires SessionStart (`/clear`, `/compact`), keeps the bucket its conversation already belongs to, and `MEKO_AGENT_ID` overrides either, so the injected value is not always what a fresh derivation would produce. If the block is absent, ask the user rather than guessing from the raw cwd basename (sibling directories like `docs/` or `webapp/` in unrelated repos would collide).
|
|
20
|
+
|
|
21
|
+
MEKO-590 changed new coding-session ids from the cwd leaf to the repository
|
|
22
|
+
root. Existing ownership does not change in place: migration checkpoints and
|
|
23
|
+
Kiro session intents keep their persisted pre-MEKO-590 id, because the server
|
|
24
|
+
does not allow an existing conversation's owner to change. Datapack pins also
|
|
25
|
+
fall back to the old cwd-leaf filename until the user pins or clears again.
|
|
26
|
+
New sessions without persisted state use the repository-root id.
|
|
18
27
|
|
|
19
28
|
For genuinely cross-project facts ("the user's name is Alice", "the user prefers dark mode") write with `agent_id="meko_agent"` so their attribution clearly identifies the common cross-project bucket.
|
|
20
29
|
|
|
@@ -42,7 +51,7 @@ Filter tuple: `(datapack_id, user_id)`. `agent_id` is **not** applied on memory
|
|
|
42
51
|
|
|
43
52
|
### Personal conversation reads — `conversation_get`, `conversation_list`
|
|
44
53
|
|
|
45
|
-
- `conversation_get` — agent-owned. Filter tuple `(datapack_id, user_id, agent_id)`: pass the exact `agent_id` that created the conversation; a wrong value returns `agent_id_mismatch`.
|
|
54
|
+
- `conversation_get`, `conversation_add_message`, `conversation_update`, `conversation_delete` — agent-owned. Filter tuple `(datapack_id, user_id, agent_id)`: pass the exact `agent_id` that created the conversation; a wrong value returns `agent_id_mismatch`.
|
|
46
55
|
- `conversation_list` — **not** agent-filtered. It lists by `(datapack_id, user_id)` only; `agent_id` on the call is trace-attribution only (like memory reads), so one call returns the datapack's conversations for your user regardless of which agent created them.
|
|
47
56
|
|
|
48
57
|
### Team-shared reads — `knowledgebase_search`
|
|
@@ -81,13 +90,12 @@ knowledgebase_search(agent_id=anything, query=...)
|
|
|
81
90
|
|
|
82
91
|
## When to use what — broad-query guidance
|
|
83
92
|
|
|
84
|
-
If the user asks "what do you know about X?": one `
|
|
93
|
+
If the user asks "what do you know about X?": one `context_search` returns the whole personal memory surface (every `agent_id`, nothing to fan out), team-shared knowledge, and matching past-conversation turns in separate buckets. Tell the user which surface each finding came from. Conversation hits can come from other users on the datapack.
|
|
85
94
|
|
|
86
95
|
## Optional sub-scoping
|
|
87
96
|
|
|
88
97
|
Optional parameters can narrow a call further:
|
|
89
|
-
- `
|
|
90
|
-
- `run_id` — on `memory_search` and the delete tools it is a **read/delete
|
|
98
|
+
- `run_id` — on `memory_search` and `memory_delete_all` it is a **read/delete
|
|
91
99
|
filter** on the row's `meko_conversation_id`, so pass a *conversation id* to
|
|
92
100
|
scope the call to that conversation (consistent scoping landed in
|
|
93
101
|
MEKO-473/MEKO-474, #271). On `memory_add` it is Langfuse trace metadata only
|
|
@@ -95,10 +103,10 @@ Optional parameters can narrow a call further:
|
|
|
95
103
|
`conversation_id` — a row written with `memory_add(run_id=X)` is not findable
|
|
96
104
|
via `memory_search(run_id=X)`.
|
|
97
105
|
|
|
98
|
-
|
|
106
|
+
Accepted by `memory_add`, `memory_search`, `memory_get_all`, `memory_delete_all`, and `conversation_create`. `memory_get_all` ignores it. No tool takes a `user_id` argument; the server resolves it from your credentials (see `tools-user-id-conventions.md`).
|
|
99
107
|
|
|
100
108
|
## Things I checked and found in-data on real Cloud datapacks
|
|
101
109
|
|
|
102
110
|
- `agent_id="agent"` appears on many legacy rows — it was the previous canonical constant. New writes should use the schema in the table above; memory reads still return the legacy rows.
|
|
103
|
-
- Memory Summary UI (`/datapacks/<name>/memory-summary`) is agent-id-agnostic — shows every row in the datapack, renders the stored `agent_id` as a badge. `memory_search` and `conversation_list` are likewise agent-agnostic (they return all your agents' rows for the user);
|
|
111
|
+
- Memory Summary UI (`/datapacks/<name>/memory-summary`) is agent-id-agnostic — shows every row in the datapack, renders the stored `agent_id` as a badge. `memory_search` and `conversation_list` are likewise agent-agnostic (they return all your agents' rows for the user); the conversation calls (`conversation_get`, `conversation_add_message`, `conversation_update`, `conversation_delete`) enforce `agent_id` (agent ownership), and `memory_delete_all` deletes only the passed `agent_id`'s bucket.
|
|
104
112
|
- Subagents spawned via the `Agent` tool in Claude Code do not automatically inherit the parent's `agent_id`. The parent must inject it into the spawn prompt. See the SKILL.md "When spawning subagents" section.
|