@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.
Files changed (67) hide show
  1. package/README.md +168 -61
  2. package/assets/hooks-handlers/lib/capture-cleanup-cli.js +2134 -0
  3. package/assets/hooks-handlers/lib/capture-notices.js +224 -14
  4. package/assets/hooks-handlers/lib/capture-state.js +206 -1
  5. package/assets/hooks-handlers/lib/capture-status-cli.js +6 -2
  6. package/assets/hooks-handlers/lib/capture.js +1364 -139
  7. package/assets/hooks-handlers/lib/checkpoint-timer.js +445 -18
  8. package/assets/hooks-handlers/lib/journal-bridge.js +218 -0
  9. package/assets/hooks-handlers/lib/kiro-handler.js +26 -4
  10. package/assets/hooks-handlers/lib/opencode-handler.js +643 -0
  11. package/assets/hooks-handlers/lib/opencode-normalizer.js +145 -0
  12. package/assets/hooks-handlers/lib/terminal-handoff.js +10 -1
  13. package/assets/opencode-plugin/meko.js +213 -0
  14. package/assets/scripts/meko-statusline.sh +102 -19
  15. package/assets/skills/meko-mcp-tools/SKILL.md +59 -16
  16. package/assets/skills/meko-mcp-tools/references/_sections.md +2 -2
  17. package/assets/skills/meko-mcp-tools/references/tools-agent-id-conventions.md +15 -7
  18. package/assets/skills/meko-mcp-tools/references/tools-cookbook.md +275 -19
  19. package/assets/skills/meko-mcp-tools/references/tools-datapack-workflow.md +7 -4
  20. package/assets/skills/meko-mcp-tools/references/tools-known-limitations.md +39 -11
  21. package/assets/skills/meko-mcp-tools/references/tools-memory-vs-conversation.md +10 -6
  22. package/assets/skills/meko-mcp-tools/references/tools-overview.md +44 -29
  23. package/assets/skills/meko-mcp-tools/references/tools-rag-workflow.md +79 -14
  24. package/assets/skills/meko-mcp-tools/references/tools-troubleshooting.md +47 -1
  25. package/assets/skills/meko-mcp-tools/references/tools-user-id-conventions.md +6 -39
  26. package/assets/skills/meko-mcp-tools-desktop/SKILL.md +57 -21
  27. package/assets/skills/meko-mcp-tools-desktop/desktop/README.md +4 -4
  28. package/assets/skills/meko-mcp-tools-desktop/references/_sections.md +1 -1
  29. package/assets/skills/meko-mcp-tools-desktop/references/tools-agent-id-conventions.md +8 -6
  30. package/assets/skills/meko-mcp-tools-desktop/references/tools-cookbook.md +284 -38
  31. package/assets/skills/meko-mcp-tools-desktop/references/tools-known-limitations.md +32 -10
  32. package/assets/skills/meko-mcp-tools-desktop/references/tools-memory-vs-conversation.md +16 -12
  33. package/assets/skills/meko-mcp-tools-desktop/references/tools-overview.md +46 -31
  34. package/assets/skills/meko-mcp-tools-desktop/references/tools-rag-workflow.md +79 -14
  35. package/assets/skills/meko-mcp-tools-desktop/references/tools-troubleshooting.md +69 -1
  36. package/assets/skills/meko-select-datapack-desktop/SKILL.md +93 -14
  37. package/assets/skills/meko-select-datapack-desktop/references/cookbook.md +44 -12
  38. package/assets/skills/meko-select-datapack-desktop/references/role-display-future.md +14 -10
  39. package/assets/skills/meko-select-datapack-desktop/references/troubleshooting.md +17 -5
  40. package/bin/create-meko-setup.mjs +186 -30
  41. package/lib/autofix.mjs +100 -0
  42. package/lib/browser-login.mjs +495 -0
  43. package/lib/capture-cleanup.mjs +63 -0
  44. package/lib/clients/claude-code.mjs +1 -0
  45. package/lib/clients/codex.mjs +80 -35
  46. package/lib/clients/common.mjs +7 -0
  47. package/lib/clients/index.mjs +2 -0
  48. package/lib/clients/kiro.mjs +5 -5
  49. package/lib/clients/opencode.mjs +537 -0
  50. package/lib/config.mjs +68 -1
  51. package/lib/installer.mjs +18 -2
  52. package/lib/migrate/adapters/claude-code.mjs +11 -2
  53. package/lib/migrate/adapters/codex.mjs +9 -2
  54. package/lib/migrate/adapters/memory-md.mjs +27 -8
  55. package/lib/migrate/adapters/opencode.mjs +148 -0
  56. package/lib/migrate/claude-parser.mjs +153 -9
  57. package/lib/migrate/datapack.mjs +254 -16
  58. package/lib/migrate/id.mjs +195 -13
  59. package/lib/migrate/mcp-client.mjs +59 -1
  60. package/lib/migrate/opencode-normalizer.mjs +132 -0
  61. package/lib/migrate/orchestrator.mjs +294 -78
  62. package/lib/migrate/progress.mjs +239 -5
  63. package/lib/migrate/registry.mjs +72 -0
  64. package/lib/migrate.mjs +97 -9
  65. package/lib/validate.mjs +111 -22
  66. package/package.json +5 -5
  67. package/scripts/bundle-assets.mjs +4 -0
@@ -6,6 +6,47 @@ Every tool example below shows the correct parameters, expected response, and co
6
6
 
7
7
  ---
8
8
 
9
+ ## Retrieval
10
+
11
+ ### context_search
12
+
13
+ Default first call for open-ended recall ("what do you know about X?"). One call queries memory, the knowledge base, and the conversation-history cache in parallel.
14
+
15
+ ```
16
+ context_search(
17
+ query="auth migration decisions",
18
+ agent_id="claude_desktop",
19
+ conversation_id="<session conversation id>",
20
+ datapack_id="<datapack UUID>")
21
+ ```
22
+
23
+ Required: `query`, `conversation_id`. `datapack_id` is optional (default datapack if omitted); pass the pinned id when you have one.
24
+
25
+ Response:
26
+
27
+ ```
28
+ {
29
+ "results": {
30
+ "memory": [{"id": "...", "memory": "...", "score": 0.51, ...}],
31
+ "knowledge_base": [{"id": "...", "chunk_text": "...", "document_id": "...", "distance": 0.31, "match_type": "hybrid", ...}],
32
+ "conversation": {"hits": [...], "thread": [...]}
33
+ },
34
+ "token_savings": {"total_tokens": 49000, "memory": {"tokens_sent": 600, "tokens_saved": 48400}, "tokens_saved": 48400}
35
+ }
36
+ ```
37
+
38
+ - 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.
39
+ - 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.
40
+ - 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.
41
+ - `limit` bounds the memory and KB buckets only; the conversation bucket returns up to 10 hits plus a thread of whole turns.
42
+ - The memory bucket has no similarity floor on the default path. The KB bucket drops chunks above an absolute distance cutoff, so it can be empty even when `knowledgebase_search` would return a weak best match.
43
+ - `force_source="memory" | "knowledge_base" | "conversation"` queries only that source. `force_source="memory"` reapplies the `memory_search` similarity floor.
44
+ - `token_savings` is an estimate for reporting. Don't base decisions on it.
45
+
46
+ **Errors:** `conversation_id_required`, `invalid_force_source`, `datapack_access_denied`, and `free_tier_limit_reached` (Free tier: 1,000 lifetime calls). Treat any error as a failed search (SKILL.md operating contract 1).
47
+
48
+ ---
49
+
9
50
  ## Memory Tools
10
51
 
11
52
  **Critical:** Pass your session's `agent_id` on every memory call. For Claude Desktop that's `claude_desktop` for normal attribution, or `meko_agent` when writing genuinely cross-project facts. Writes retain that attribution, while personal memory reads span all of this user's agents.
@@ -16,6 +57,7 @@ Every tool example below shows the correct parameters, expected response, and co
16
57
 
17
58
  ```
18
59
  memory_add(agent_id="claude_desktop",
60
+ conversation_id="<id from conversation_create>",
19
61
  text="Remember: deploy scripts must be run from the repo root, never a subdir.")
20
62
  ```
21
63
 
@@ -24,15 +66,9 @@ memory_add(agent_id="claude_desktop",
24
66
  {"results": [{"id": "mem-uuid-123", "memory": "User Amiram is VP of Product at YugabyteDB. Prefers concise responses."}]}
25
67
  ```
26
68
 
27
- **With user scoping:**
28
- ```
29
- memory_add(agent_id="agent", user_id="amiram",
30
- text="Prefers Python for backend, Go for infrastructure.")
31
- ```
32
-
33
69
  **What NOT to store via memory_add:**
34
70
  - Full conversations (use `conversation_create` + `conversation_add_message`)
35
- - Large documents (use the UI's Datapack → Actions → Add Knowledge upload flow)
71
+ - Large documents (use `knowledgebase_upload_document`, or the UI's Datapack → Actions → Add Knowledge upload flow)
36
72
 
37
73
  **Common errors:**
38
74
  - `syntax error at or near "-"` — legacy error from the pre-multi-tenancy schema when `agent_id` became part of a PostgreSQL identifier. No longer applies on Cloud (agent_id is a TEXT column value, any string is accepted). If you hit it on a deployment that still uses the old schema, use underscores instead of hyphens.
@@ -46,35 +82,32 @@ memory_add(agent_id="agent", user_id="amiram",
46
82
 
47
83
  **Cross-conversation discovery.** `memory_search` returns hits across every stored conversation for the `(datapack_id, user_id)` pair, across all agents (the tool intentionally passes `meko_agent_id=None` to mem0, so the `agent_id` argument scopes the trace but does not filter results). When a hit references an interesting conversation, follow up with `conversation_list` to browse the associated threads and `conversation_get` to read a specific one — the memory hit's `meko_conversation_id` field is the id to fetch. Pass `run_id` on the search itself to narrow to a single conversation up front.
48
84
 
49
- **Relevance floor.** Vector-matched `results` below `MEMORY_SEARCH_MIN_SCORE` (mem0's cosine-similarity score, default `0.5`) are dropped as weak matches rather than returned. A query can come back with fewer results than `limit`, or an empty list, when nothing clears the bar; that means no sufficiently relevant memory, not a broken call.
85
+ **Relevance floor.** `memory_search` drops results whose raw cosine similarity is below the server's `memory_search_min_score` setting (default `0.2`, tunable at runtime). A query can return fewer results than `limit`, or an empty list, when nothing clears the bar. That means no sufficiently relevant memory, not a broken call.
50
86
 
51
87
  ```
52
- memory_search(query="What programming language does the team use?", agent_id="agent")
88
+ memory_search(query="What programming language does the team use?", agent_id="claude_desktop", conversation_id="<id>")
53
89
  ```
54
90
 
55
91
  **Response:**
56
92
  ```json
57
- {"results": [{"id": "mem-uuid-123", "memory": "Team uses Python for backend", "score": 0.89}]}
93
+ {"results": [{"id": "mem-uuid-123", "memory": "Team uses Python for backend", "score": 0.89, "raw_similarity_score": 0.72}]}
58
94
  ```
59
95
 
96
+ `score` is the fused hybrid rank (semantic + keyword + entity boost) used to order results; `raw_similarity_score` is the unfused cosine value. A similarity threshold like `MEMORY_SEARCH_MIN_SCORE` gates on `raw_similarity_score` when it is not null, and falls back to `score` when the raw field is absent or null.
97
+
60
98
  **With limit:**
61
99
  ```
62
- memory_search(query="user preferences", agent_id="agent", limit=5)
100
+ memory_search(query="user preferences", agent_id="claude_desktop", conversation_id="<id>", limit=5)
63
101
  ```
64
102
 
65
103
  ---
66
104
 
67
105
  ### memory_get_all
68
106
 
69
- **When to use:** List everything stored for an agent. Useful at session start to load context.
107
+ **When to use:** See the most recent memories (about 20 rows) across every `agent_id`, plus the true `total`. It is not a complete listing and takes no paging arguments (SKILL.md operating contract 2). Use `memory_search` or `memory_get_by_id` for anything older or specific.
70
108
 
71
109
  ```
72
- memory_get_all(agent_id="agent")
73
- ```
74
-
75
- **With user scoping:**
76
- ```
77
- memory_get_all(agent_id="agent", user_id="amiram")
110
+ memory_get_all(agent_id="claude_desktop", conversation_id="<id>")
78
111
  ```
79
112
 
80
113
  ---
@@ -82,7 +115,7 @@ memory_get_all(agent_id="agent", user_id="amiram")
82
115
  ### memory_get_by_id
83
116
 
84
117
  ```
85
- memory_get_by_id(memory_id="mem-uuid-123", agent_id="agent")
118
+ memory_get_by_id(memory_id="mem-uuid-123", agent_id="claude_desktop", conversation_id="<id>")
86
119
  ```
87
120
 
88
121
  ---
@@ -92,7 +125,7 @@ memory_get_by_id(memory_id="mem-uuid-123", agent_id="agent")
92
125
  **When to use:** Overwrite a specific memory's text. Requires the memory UUID.
93
126
 
94
127
  ```
95
- memory_update(memory_id="mem-uuid-123", text="Updated: Team uses Go for all new services", agent_id="agent")
128
+ memory_update(memory_id="mem-uuid-123", text="Updated: Team uses Go for all new services", agent_id="claude_desktop", conversation_id="<id>")
96
129
  ```
97
130
 
98
131
  ---
@@ -100,17 +133,19 @@ memory_update(memory_id="mem-uuid-123", text="Updated: Team uses Go for all new
100
133
  ### memory_delete_by_id
101
134
 
102
135
  ```
103
- memory_delete_by_id(memory_id="mem-uuid-123", agent_id="agent")
136
+ memory_delete_by_id(memory_id="mem-uuid-123", agent_id="claude_desktop", conversation_id="<id>")
104
137
  ```
105
138
 
139
+ `memory_update` and `memory_delete_by_id` return `memory_is_promoted` for a promoted memory, and `not_found` for an id that is missing or belongs to another account.
140
+
106
141
  ---
107
142
 
108
143
  ### memory_delete_all
109
144
 
110
- **Destructive.** Deletes all memories for the agent. For removing a single memory, prefer `memory_delete_by_id` — `memory_delete_all` wipes the entire agent scope in the datapack.
145
+ **Destructive.** Deletes all memories in the passed `agent_id`'s bucket in the datapack. It does not touch other agents' rows, even though `memory_search` shows them; omitting `agent_id` deletes only the `meko_agent` bucket. Pass `run_id=<conversation_id>` to limit it to one conversation. For removing a single memory, prefer `memory_delete_by_id`.
111
146
 
112
147
  ```
113
- memory_delete_all(agent_id="agent")
148
+ memory_delete_all(agent_id="claude_desktop", conversation_id="<id>")
114
149
  ```
115
150
 
116
151
  ---
@@ -142,10 +177,13 @@ On 403, authentication, or permission failure, report the error and stop — do
142
177
  **When to use:** Start storing a multi-turn exchange. Do this when the session contains valuable dialog worth preserving.
143
178
 
144
179
  ```
145
- conversation_create(agent_id="agent", user_id="amiram",
146
- title="Debugging the auth middleware")
180
+ conversation_create(agent_id="claude_desktop",
181
+ title="Debugging the auth middleware",
182
+ datapack_id="<uuid from datapack_search>")
147
183
  ```
148
184
 
185
+ `datapack_id` is required whenever no server-side default resolves for the caller. Omitting it in that state returns `{"error": "datapack_id_required"}` and persists nothing; the same contract applies to `conversation_add_message`, `conversation_get`, `conversation_update`, and `conversation_delete`.
186
+
149
187
  **Response:**
150
188
  ```json
151
189
  {"id": "conv-uuid-123", "title": "Debugging the auth middleware"}
@@ -186,8 +224,8 @@ conversation_get(conversation_id="conv-uuid-123", agent_id="agent",
186
224
  ### conversation_list
187
225
 
188
226
  Target the datapack by `datapack_id` (UUID). It's optional — omit it to use the
189
- pinned/default datapack, or pass the pinned `datapack_id`. Use `datapack_list`
190
- to look up the id.
227
+ pinned/default datapack, or pass the pinned `datapack_id`. Use
228
+ `datapack_search(query="<part of the name>")` to look up the id.
191
229
 
192
230
  ```
193
231
  conversation_list(datapack_id="<datapack-uuid>", agent_id="agent", limit=20)
@@ -216,7 +254,7 @@ conversation_delete(conversation_id="conv-uuid-123", agent_id="agent")
216
254
 
217
255
  ## Knowledge Base Tools
218
256
 
219
- **KB ingestion is a UI-only activity.** Users upload files via the datapack's Actions → **Add Knowledge** dialog (PDF/TXT/MD/JSON/MP4, 5MB each, 10/batch). `knowledgebase_search` is the one KB tool exposed via MCP.
257
+ Agents upload files via `knowledgebase_upload_document` and poll `knowledgebase_document_status` for indexing progress; a human uploading through the Cloud UI still uses the datapack's Actions → **Add Knowledge** dialog (PDF/TXT/MD/JSON/CSV/XML/HTML, 5MB Free / 50MB Standard / 60MB Pro+ each, 10/batch) — both paths feed the same index. `knowledgebase_search` queries whatever the KB currently holds. MCP also exposes `knowledgebase_delete_document` for removing a single uploaded file.
220
258
 
221
259
  See `tools-rag-workflow.md` for the decision table.
222
260
 
@@ -244,6 +282,184 @@ Populated KBs return results with chunk content and similarity scores. An empty/
244
282
 
245
283
  ---
246
284
 
285
+ ### knowledgebase_delete_document
286
+
287
+ Permanently deletes ONE knowledge-base file — its chunks and metadata in one transaction, plus a best-effort delete of the stored file. Irreversible: confirm with the user before calling, and take `document_id` from `knowledgebase_search` hits — hits carry `document_id` but NOT a filename, so confirm by echoing the id and the matched chunk text (the documents list API / Meko UI is the authoritative name source). Never guess an id; non-UUID values are rejected.
288
+
289
+ ```
290
+ knowledgebase_delete_document(document_id="<uuid from a search hit>",
291
+ conversation_id="<session conversation id>")
292
+ ```
293
+
294
+ Returns `{"document_id", "chunks_deleted", "s3_deleted"}` — if `s3_deleted` is `false`, say so: the index entries are gone but the stored file may remain. Errors include a numeric `status`: `403` means the user is not the datapack owner, a maintainer, or the file's uploader — report it, don't retry; `409` (`DOCUMENT_PROCESSING`) means the file is still being indexed — wait for indexing to finish, then retry.
295
+
296
+ ### knowledgebase_upload_document
297
+
298
+ **When to use:** Get a file's bytes into the datapack's KB for later `knowledgebase_search` retrieval — a file already on disk, or one generated mid-conversation. This tool never touches the file's bytes itself; it only requests a presigned S3 URL. Meko registers the file once it lands, so there's no separate confirm call. **The caller POSTs the file to the returned `url` directly** — multipart/form-data, every key in `fields` as a form field (in order), then the file's bytes last as a field named `"file"`.
299
+
300
+ **Confirm first.** The file goes into the datapack's shared knowledge base, which every member can read. Before calling the tool, tell the user which file and datapack, say the team will see it, and wait for a yes.
301
+
302
+ **You need a shell that can make the POST** (Python, curl, or PowerShell, below). Without one, as in Claude Desktop by default, don't call the tool: point the user at Datapack → Actions → **Add Knowledge**. An issued URL holds its `size` against the storage quota for up to 15 minutes even if nothing is uploaded.
303
+
304
+ **After the user confirms and the tool returns, POST the file in the same turn.** The upload is only half-done once you have `url`/`fields`; nothing else completes it for you.
305
+
306
+ **`content_hash` and `content_head_base64` are both computed on the caller's own device, from the file's real bytes — this tool never computes either for you.** `content_head_base64` is compulsory: the tool refuses with `content_head_base64_required` if it's missing or blank, so there's no path that skips the sniff.
307
+
308
+ Linux:
309
+ ```bash
310
+ CONTENT_HASH=$(sha256sum report.pdf | cut -d' ' -f1)
311
+ CONTENT_HEAD_B64=$(head -c 3072 report.pdf | base64 -w0)
312
+ ```
313
+
314
+ macOS (no `sha256sum` by default — use `shasum`; BSD `base64` has no `-w0`, so strip newlines with `tr` instead):
315
+ ```bash
316
+ CONTENT_HASH=$(shasum -a 256 report.pdf | cut -d' ' -f1)
317
+ CONTENT_HEAD_B64=$(head -c 3072 report.pdf | base64 | tr -d '\n')
318
+ ```
319
+
320
+ Windows PowerShell:
321
+ ```powershell
322
+ $ContentHash = (Get-FileHash -Algorithm SHA256 -Path "report.pdf").Hash.ToLower()
323
+ $bytes = [System.IO.File]::ReadAllBytes("report.pdf")
324
+ $head = $bytes[0..([Math]::Min(3071, $bytes.Length - 1))]
325
+ $ContentHeadB64 = [Convert]::ToBase64String($head)
326
+ ```
327
+
328
+ Windows cmd.exe (`certutil` ships built in for the hash — prints it on its own line, strip the header/footer lines before use; cmd.exe has **no** built-in way to take just the first 3072 bytes *and* base64-encode them in one step, so use the PowerShell or Python snippet for `content_head_base64` even in a cmd.exe-driven workflow):
329
+ ```bat
330
+ certutil -hashfile report.pdf SHA256
331
+ ```
332
+
333
+ Python (cross-platform; streams the file so a large one isn't fully loaded into memory, and reuses the same read to build `content_head_base64` too):
334
+ ```python
335
+ import hashlib, base64
336
+
337
+ h = hashlib.sha256()
338
+ with open(LOCAL_PATH, "rb") as f:
339
+ head = f.read(3072) # also the content_head_base64 sample
340
+ h.update(head)
341
+ for chunk in iter(lambda: f.read(1 << 20), b""):
342
+ h.update(chunk)
343
+
344
+ content_hash = h.hexdigest()
345
+ content_head_base64 = base64.b64encode(head).decode()
346
+ ```
347
+
348
+ **Then, after the tool call returns `{url, fields}` — a portable snippet (identical on Linux/macOS/Windows, needs `python3` + `requests`), because it loops over whatever `fields` came back instead of hand-enumerating field names, so it can't drift out of sync with what the response actually contains:**
349
+
350
+ ```python
351
+ import json, requests
352
+ resp = json.loads(RESPONSE_JSON) # the tool's raw JSON string
353
+ if not resp.get("already_uploaded"):
354
+ with open(LOCAL_PATH, "rb") as f:
355
+ r = requests.post(resp["url"], data=resp["fields"], files={"file": (FILENAME, f)})
356
+ r.raise_for_status()
357
+ ```
358
+
359
+ **Linux/macOS, curl (needs `jq`; builds the `-F` flags dynamically from whatever `fields` actually contains — a signer using temporary credentials adds `x-amz-security-token`, and extra policy conditions add their own fields, so a hardcoded field list drops them and S3 answers 403 on a form missing a signed field):**
360
+
361
+ ```bash
362
+ if [ "$(echo "$RESPONSE_JSON" | jq -r '.already_uploaded')" != "true" ]; then
363
+ URL=$(echo "$RESPONSE_JSON" | jq -r '.url')
364
+ FIELDS=()
365
+ while IFS= read -r -d '' key && IFS= read -r -d '' value; do
366
+ FIELDS+=(-F "${key}=${value}")
367
+ done < <(echo "$RESPONSE_JSON" | jq -j '.fields | to_entries[] | (.key, "\u0000", .value, "\u0000")')
368
+ curl -sS --fail "${FIELDS[@]}" -F file=@/local/path/report.pdf "$URL"
369
+ fi
370
+ ```
371
+
372
+ **Windows PowerShell 7+ (`Invoke-RestMethod -Form` takes the whole `fields` object as a hashtable — no per-field enumeration needed at all; use `[ordered]@{}`, not a plain `@{}`, since S3 requires `file` to be the *last* form field and a plain hashtable has no guaranteed enumeration order):**
373
+
374
+ ```powershell
375
+ $resp = $json | ConvertFrom-Json
376
+ if (-not $resp.already_uploaded) {
377
+ $form = [ordered]@{}
378
+ $resp.fields.PSObject.Properties | ForEach-Object { $form[$_.Name] = $_.Value }
379
+ $form["file"] = Get-Item "C:\path\to\report.pdf"
380
+ Invoke-RestMethod -Uri $resp.url -Method Post -Form $form
381
+ }
382
+ ```
383
+
384
+ **Windows cmd.exe:** cmd.exe has no built-in JSON parsing, so there's no safe way to build the `-F` flags dynamically from whatever `fields` contains without an extra tool. Rather than hardcode a field list that silently drops fields (e.g. `x-amz-security-token` on temporary credentials, or extra policy conditions) and fail with a confusing S3 403, use the PowerShell or Python snippet above even from a cmd.exe-driven workflow.
385
+
386
+ `size` must be the file's exact length in bytes, and the URL only accepts a body of exactly that size and SHA-256, for 5 minutes. Accepted extensions: pdf, txt, text, md, json, csv, xml, html, htm. `content_head_base64` — the file's first 3072 bytes, or the whole file if shorter, base64-encoded — is **required**: the tool sniffs it against the extension before requesting the URL and rejects an obvious mismatch (e.g. a renamed file) at once as `VALIDATION_ERROR`; a missing or blank one is `content_head_base64_required`. Text files must be UTF-8, because indexing reads UTF-8 only: a Latin-1 or Excel "CSV (Windows)" file is refused with a message to save it as UTF-8 (Excel: "CSV UTF-8"). Samples up to 4096 bytes are accepted and trimmed, so older snippets that send 4096 still work. A mismatch the server catches later surfaces as `state: "abandoned"` from `knowledgebase_document_status`. Idempotent — uploading the same content twice (by SHA-256) returns `already_uploaded: true` with an empty `url` and no `fields`; if that file's indexing never started or failed, the repeat queues it again.
387
+
388
+ ```
389
+ knowledgebase_upload_document(
390
+ filename="report.pdf",
391
+ size=42000,
392
+ content_hash="<sha256 hex of the file's bytes>",
393
+ conversation_id="<uuid from conversation_create>",
394
+ content_head_base64="<base64 of the file's first 3072 bytes>",
395
+ agent_id="claude_desktop",
396
+ )
397
+ ```
398
+
399
+ **Response (fresh upload):**
400
+ ```json
401
+ {
402
+ "datapack_id": "...",
403
+ "url": "https://<bucket>.s3.amazonaws.com/",
404
+ "fields": {"key": "...", "policy": "...", "...": "..."},
405
+ "key": "user/datapack/hash/report.pdf",
406
+ "already_uploaded": false
407
+ }
408
+ ```
409
+
410
+ **Response (identical content already uploaded):**
411
+ ```json
412
+ {
413
+ "datapack_id": "...",
414
+ "url": "",
415
+ "key": "user/datapack/hash/report.pdf",
416
+ "already_uploaded": true,
417
+ "existing_filename": "report.pdf"
418
+ }
419
+ ```
420
+
421
+ After a fresh upload, POST the file to `url` yourself (see above), then save `key` (as `document_key`) and poll `knowledgebase_document_status` until `state` is terminal. S3 answers a successful POST with `204`. `400 EntityTooSmall` or `EntityTooLarge` means `size` wasn't the file's exact byte count: call the tool again with the right size and upload through the new URL. The earlier URL can never succeed (it only accepts the wrong size) and expires on its own within 5 minutes.
422
+
423
+ **Common errors:**
424
+ - `conversation_id_required` — `conversation_id` was missing or blank.
425
+ - `datapack_id_required` — no `datapack_id` was given and no tenant default could be resolved.
426
+ - `content_head_base64_required` — `content_head_base64` was missing or blank. Checked after the `filename`/`size`/`content_hash` `VALIDATION_ERROR` checks, but always before a URL is requested — there is no way to skip it.
427
+ - `VALIDATION_ERROR` — missing filename, unsupported extension, missing/malformed `content_hash`, size ≤ 0, invalid or oversized `content_head_base64`, a sample shorter than `min(size, 3072)` bytes or longer than `size` (so `size` is wrong), or the sampled content doesn't match its extension.
428
+ - `FREE_TIER_KB_STORAGE_LIMIT` / `STANDARD_TIER_KB_STORAGE_LIMIT` (`status` 402) — no room left in the storage quota. Tell the user to free space or upgrade instead of retrying: every issued URL holds its `size` against the quota until the file is registered, or for up to 15 minutes if it is never uploaded.
429
+
430
+ Every error from the server also carries `status`, its HTTP status code.
431
+ - `knowledgebase_upload_document_failed` — unexpected error (see `detail`).
432
+ - The actual S3 POST isn't made through this tool, so its own failures (e.g. the body exceeding the cap the URL was signed under) surface to whatever made that call directly, not from this tool.
433
+
434
+ ---
435
+
436
+ ### knowledgebase_document_status
437
+
438
+ **When to use:** Track a file uploaded via `knowledgebase_upload_document` from "waiting for bytes" through to indexed.
439
+
440
+ ```
441
+ knowledgebase_document_status(
442
+ document_key="user/datapack/hash/report.pdf",
443
+ conversation_id="<uuid from conversation_create>",
444
+ agent_id="claude_desktop"
445
+ )
446
+ ```
447
+
448
+ **Response (still indexing):**
449
+ ```json
450
+ {
451
+ "document_key": "user/datapack/hash/report.pdf",
452
+ "filename": "report.pdf",
453
+ "state": "indexing",
454
+ "message": "The file is registered and being indexed.",
455
+ "document": {"status": "PROCESSING", "chunks_processed": 3}
456
+ }
457
+ ```
458
+
459
+ Poll until `state` is `completed` or `failed` (or the pre-registration terminals `abandoned`/`oversized`). `NOT_FOUND` means `document_key` is unknown to this datapack — check it was copied verbatim from the upload response. `datapack_id_required` means no `datapack_id` was given and no tenant default could be resolved.
460
+
461
+ ---
462
+
247
463
  ## Artifact Tools
248
464
 
249
465
  ### artifact_put
@@ -323,24 +539,54 @@ For large files use `local_path` to read the file. S3 URLs are never exposed.
323
539
 
324
540
  ## Datapack Management Tools
325
541
 
326
- ### datapack_create / datapack_list / datapack_describe
542
+ ### datapack_create / datapack_search / datapack_list / datapack_describe
327
543
 
328
544
  ```
329
- datapack_create(name="analytics_prod")
330
- datapack_list(conversation_id="<this conversation's id>") # returns datapack_id for each datapack
331
- datapack_describe(datapack_id="<uuid>", include_status=True)
545
+ datapack_create(name="analytics_prod", conversation_id="<conversation id>")
546
+ datapack_search(conversation_id="<this conversation's id>", query="analytics") # find an id by part of the name
547
+ datapack_search(conversation_id="<this conversation's id>", name="analytics_prod") # exact name
548
+ datapack_list(conversation_id="<this conversation's id>") # small accounts: every datapack in one array
549
+ datapack_describe(datapack_id="<uuid>", include_status=True, conversation_id="<conversation id>")
332
550
  ```
333
551
 
552
+ Find a datapack id with `datapack_search(query=...)`. It returns one page:
553
+ `{"datapacks": [...], "has_more": true, "next_cursor": "<token>", "total": null}`.
554
+ To get the next page, call it again with the same filters and
555
+ `cursor="<next_cursor>"`. `next_cursor` is `""` on the last page, and also
556
+ when an older server has more matches than this page but cannot continue.
557
+ Do not send an empty cursor; ask for a narrower `query` instead. Treat the
558
+ cursor as opaque. Pass `include_total=True` only when you must show "N of M".
559
+
560
+ `datapack_list` still returns one array and is fine for an account with a
561
+ handful of datapacks. For an account that can see more than 1000 datapacks
562
+ (the server default limit) it returns `{"error": "too_many_datapacks", ...}`
563
+ instead; switch to `datapack_search`. If the server has no `datapack_search`
564
+ tool (an older server), use `datapack_list`.
565
+
566
+
567
+ `datapack_describe` returns these counts:
568
+
569
+ | Field | Meaning |
570
+ |---|---|
571
+ | `memory_count` | All memories stored in the datapack |
572
+ | `collective_memory_count` | Memories promoted to shared knowledge |
573
+ | `learnings_count` | Memories awaiting a promotion decision |
574
+ | `knowledge_base_file_count` | Uploaded KB documents; `null` if the status endpoint is unreachable |
575
+ | `knowledge_chunk_count` | KB chunks across all documents (for debugging retrieval) |
576
+ | `shared_knowledge_count` | `collective_memory_count + knowledge_base_file_count`; `null` when the file count is `null` |
577
+
578
+ `knowledge_count` is a deprecated alias of `knowledge_chunk_count`. Neither `datapack_search` nor `datapack_list` computes counts; call `datapack_describe` for them.
579
+
334
580
  ### datapack_update / datapack_delete
335
581
 
336
582
  `datapack_update` renames a datapack, edits its description, and/or opts it in/out of conversation-search embedding. At least one of `name` / `description` / `conversation_search_opt_out` must be provided (or the tool returns `nothing_to_update`). The server refuses to rename `meko_default_datapack` — the error is `"meko_default_datapack cannot be renamed"`. Passing `description=""` does NOT clear an existing description. `conversation_search_opt_out=True` stops future turns from being indexed and is restricted to the datapack's owner or a maintainer. This is best-effort, not a hard guarantee — a transient database error on the live embed path's opt-out check fails open, so a turn can occasionally still get embedded for an opted-out datapack.
337
583
 
338
584
  ```
339
- datapack_update(datapack_id="<uuid>", name="renamed-datapack")
340
- datapack_update(datapack_id="<uuid>", description="new description")
341
- datapack_update(datapack_id="<uuid>", name="x", description="y")
342
- datapack_update(datapack_id="<uuid>", conversation_search_opt_out=True)
343
- datapack_delete(datapack_id="<uuid>") # Irreversible!
585
+ datapack_update(datapack_id="<uuid>", name="renamed-datapack", conversation_id="<conversation id>")
586
+ datapack_update(datapack_id="<uuid>", description="new description", conversation_id="<conversation id>")
587
+ datapack_update(datapack_id="<uuid>", name="x", description="y", conversation_id="<conversation id>")
588
+ datapack_update(datapack_id="<uuid>", conversation_search_opt_out=True, conversation_id="<conversation id>")
589
+ datapack_delete(datapack_id="<uuid>", conversation_id="<conversation id>") # Irreversible!
344
590
  ```
345
591
 
346
592
  ### Agent and knowledge-base management (NOT MCP — control-plane only)
@@ -350,4 +596,4 @@ Agent and KB lifecycle does not ship as MCP tools. If the user asks to create/li
350
596
  - REST: `POST/GET/DELETE /datapacks/:datapack_id/agents` (agents), `POST/GET/DELETE /datapacks/:datapack_id/knowledge-bases` (KB sources).
351
597
  - Or the Meko Cloud UI at `cloud.mekodata.ai` → Datapacks → agents / knowledge-bases.
352
598
 
353
- KB ingestion specifically lives in the UI today: Datapack → Actions → **Add Knowledge** (PDF/TXT/MD/JSON/MP4, 5 MB each, 10/batch). Agents querying a populated index use `knowledgebase_search` — see `tools-rag-workflow.md`.
599
+ Uploading a *file* into an existing KB is not part of that lifecycle restriction — use `knowledgebase_upload_document` (see above) rather than the UI for anything driven from MCP. Agents querying a populated index use `knowledgebase_search`, and can remove a single uploaded file with `knowledgebase_delete_document` — see `tools-rag-workflow.md`.
@@ -2,7 +2,7 @@
2
2
 
3
3
  These are current limitations of the Meko MCP tools. Know them upfront to avoid wasted tool calls.
4
4
 
5
- ## No delete tools for RAG artifacts
5
+ ## No MCP tools for index / source / pipeline lifecycle
6
6
 
7
7
  There are no MCP tools to:
8
8
  - Delete a vector index
@@ -10,13 +10,15 @@ There are no MCP tools to:
10
10
  - Clear stuck work queue entries
11
11
  - Reset a failed pipeline
12
12
 
13
- KB-source deletion happens via the Meko control plane (REST: `DELETE /datapacks/:datapack_id/knowledge-bases`, or the UI), which removes the registration from the Meko API — but does **not** touch the actual `dist_rag` index, source records, or vector data in the datapack's database.
13
+ The one exception is a single uploaded **file**: `knowledgebase_delete_document` removes that file's chunks and metadata. KB-**source** deletion (the registered source, not one file) happens via the Meko control plane (REST: `DELETE /datapacks/:datapack_id/knowledge-bases`, or the UI): it unregisters the source from the Meko API but does **not** touch the actual `dist_rag` index, source records, or vector data in the datapack's database.
14
14
 
15
15
  **Workaround:** For stuck or failed indexes, create a new index with a different name. Stale indexes remain in the database until manually cleaned up by an admin.
16
16
 
17
- ## RAG ingestion is UI-only
17
+ ## KB index/source management is UI-only
18
18
 
19
- KB ingestion (creating an index, adding sources, polling build status) is not exposed via MCP. Documents go in through the Cloud UI's **Add Knowledge** flow (Datapack → Actions → Add Knowledge) — PDF/TXT/MD/JSON/MP4 up to 5 MB each, 10 per batch.
19
+ Manually creating a vector index, adding a source to an existing one, or polling raw build status is not exposed via MCP. Use the Cloud UI for those (Datapack → Actions → Add Knowledge).
20
+
21
+ **Adding a file** is a registered MCP tool: call `knowledgebase_upload_document` directly (accepted extensions PDF/TXT/MD/JSON/CSV/XML/HTML, up to 5 MB Free / 50 MB Standard / 60 MB Pro+ per file) to get a presigned URL, then POST the bytes to it yourself; Meko registers and indexes the file once it lands, so no separate index-management call is needed. Confirm with the user first, because every datapack member can read the knowledge base. The Cloud UI's **Add Knowledge** flow (10 files per batch) remains the human-facing path for the same upload.
20
22
 
21
23
  To **query** a built index, use `knowledgebase_search` — it returns both uploaded documents and memories the user promoted from the Learnings tab.
22
24
 
@@ -32,7 +34,7 @@ It works **poorly** for:
32
34
  - Data dictionaries — only partial information extracted
33
35
  - Structured schemas — relationships between fields lost
34
36
 
35
- **Structured data is not natively supported via MCP.** The options are:
37
+ **Don't store structured data as memories.** The options are:
36
38
 
37
39
  1. **Write a single narrative summary** as a memory — one call, not row-by-row:
38
40
  ```
@@ -41,8 +43,7 @@ It works **poorly** for:
41
43
  conversation_id="<session conversation_id>",
42
44
  text="Customer Complaints dataset has fields: Complaint ID (int PK), Date Submitted (date), Product (text, e.g. Mortgage/Credit Card), Sub-product (text), Issue (text), Company Response (text), State (text, 2-letter code), ZIP Code (text)")
43
45
  ```
44
- 2. **Upload the schema doc** through the Cloud UI's **Add Knowledge** flow (Datapack → Actions → Add Knowledge). Accepts PDF/TXT/MD/JSON — convert CSV to MD or JSON first. That makes it queryable via `knowledgebase_search`.
45
- 3. **Tell the user** that structured-data storage via MCP isn't supported and let them decide how to proceed.
46
+ 2. **Upload the file itself to the knowledge base** with `knowledgebase_upload_document` — `.csv`, `.json` and the other accepted types go in as they are — and query it with `knowledgebase_search`. (The Cloud UI's **Add Knowledge** flow does the same for a person.)
46
47
 
47
48
  Never ingest CSV row-by-row into memory — each row becomes a fragmented fact with lost context.
48
49
 
@@ -56,8 +57,29 @@ The skill description is tuned to its 1024-char ceiling; broadening it further d
56
57
  2. **Server-side guidance** — the `agent_id` tool docstrings and the server's connect-time instructions name `claude_desktop` as this client's bucket, so even a skill-less tool-search call avoids the wrong-bucket (`claude_code`) write.
57
58
  3. Nothing is lost when the *user* explicitly recalls or saves — only passive capture of in-passing facts is best-effort.
58
59
 
59
- ## No semantic search over conversation content
60
+ ## memory_delete_all is agent-scoped; memory reads are not
61
+
62
+ `memory_search` and `memory_get_all` return every agent's rows for the user. `memory_delete_all` deletes only rows in the `agent_id` you pass, and an omitted `agent_id` means the `meko_agent` bucket. A `memory_search(run_id=X)` preview can therefore list rows that `memory_delete_all(run_id=X)` leaves in place. To clear rows written by several agents, delete them by id with `memory_delete_by_id`, or call `memory_delete_all` once per `agent_id` shown in the preview.
63
+
64
+ ## Viewers can read but not write
65
+
66
+ On a datapack shared with you as a viewer, every conversation and memory write returns `read_only_access` and writes nothing: `conversation_create`, `conversation_add_message`, `conversation_update`, `memory_add`, `memory_update`, `memory_promote`, `artifact_put`, and `track_token_usage`. You can still delete your own memories with `memory_delete_by_id` and `memory_delete_all`, and delete a conversation you started. Searches work as for any other role. `context_search` covers every member's conversations, but for a viewer its conversation results and `conversation_get` return `user_id: null`, so they don't say who wrote a turn. On Claude Desktop there are no capture hooks: when your own `conversation_add_message` call returns `read_only_access`, stop recording turns for this datapack and tell the user.
67
+
68
+ ## Promoted memories are read-only through MCP
69
+
70
+ `memory_update` and `memory_delete_by_id` return `memory_is_promoted` for a memory that has been promoted to shared knowledge. Edit or remove promoted content in the Cloud UI Learnings tab.
71
+
72
+ ## Conversation search covers embedded turns only
73
+
74
+ `context_search` searches past conversation turns by meaning in its `conversation` bucket. Only turns embedded into the conversation-search cache are searchable. Turns are embedded by default, except when:
75
+
76
+ - the datapack opted out with `datapack_update(datapack_id=..., conversation_search_opt_out=True, conversation_id=...)`;
77
+ - the account hit the embedding quota (`conversation_search_skipped: "quota_exceeded"`); or
78
+ - the turn was too short to carry content (the server skips trivial turns); or
79
+ - the turn was stored before conversation search was enabled.
80
+
81
+ To find a conversation by other attributes, browse with `conversation_list` and inspect candidates with `conversation_get`.
60
82
 
61
- Semantic (meaning-based) search across stored conversation content is not part of the public tool surface today. To find a past conversation, browse with `conversation_list` (by datapack) and inspect candidates with `conversation_get`.
83
+ ## Very long conversations can't be read back
62
84
 
63
- For finding past knowledge by meaning, `memory_search` remains the most reliable path — which is why storing key facts via `memory_add` alongside conversations is important.
85
+ When a conversation's trace grows too large for Langfuse, `conversation_get` and `conversation_update` return `{"error": "not_found", "detail": "Conversation <id> not found"}` or time out for that conversation, even though `conversation_add_message` and `conversation_delete` still work. Servers without the MEKO-714 fix instead return `not_found` from `conversation_add_message` on these conversations. If read-back or a write fails with `not_found` on a long conversation that you know exists, report the failure as a server-side limit on that conversation. Don't recreate the conversation under the same id or replay its messages; that makes the trace larger.
@@ -11,10 +11,10 @@
11
11
  Memory is backed by pgvector. Search is hybrid: semantic similarity, keyword matching, and a boost for memories that mention the entities named in your query (people, projects, tools). It retrieves relevant facts by meaning, not by conversation order.
12
12
 
13
13
  ```
14
- memory_add(agent_id="support_bot",
15
- text="Customer Alice (alice@acme.com) prefers email, has Pro plan.", user_id="alice_123")
14
+ memory_add(agent_id="claude_desktop", conversation_id="<id>",
15
+ text="Customer Alice (alice@acme.com) prefers email, has Pro plan.")
16
16
 
17
- memory_search(query="What plan does Alice have?", agent_id="support_bot")
17
+ memory_search(query="What plan does Alice have?", agent_id="claude_desktop", conversation_id="<id>")
18
18
  ```
19
19
 
20
20
  ## Use `conversation_create` + `conversation_add_message` when storing:
@@ -26,22 +26,26 @@ memory_search(query="What plan does Alice have?", agent_id="support_bot")
26
26
  Conversations are backed by Langfuse sessions and traces. They preserve full structure: who said what, in what order, with what reasoning.
27
27
 
28
28
  ```
29
- conversation_create(agent_id="support_bot", user_id="alice_123", title="Pricing discussion")
29
+ conversation_create(agent_id="claude_desktop", title="Pricing discussion",
30
+ datapack_id="<uuid from datapack_search>")
30
31
  -- Returns: {"id": "conv-uuid-here"}
31
32
 
32
- conversation_add_message(conversation_id="conv-uuid-here", agent_id="support_bot",
33
+ conversation_add_message(conversation_id="conv-uuid-here", agent_id="claude_desktop",
34
+ datapack_id="<uuid from datapack_search>",
33
35
  input="What are your pricing tiers?",
34
36
  output="We offer Starter ($10/mo), Pro ($50/mo), and Enterprise (custom).",
35
37
  reasoning="Retrieved pricing page data. No special discounts apply.")
36
38
  ```
37
39
 
40
+ `datapack_id` is required for both calls whenever no server-side default resolves for the caller. Omitting it in that state returns `{"error": "datapack_id_required"}` and persists nothing.
41
+
38
42
  ## Decision Matrix
39
43
 
40
44
  | Signal | Tool |
41
45
  |--------|------|
42
46
  | "remember that...", "note that...", "keep in mind..." | `memory_add` |
43
47
  | "store this conversation", "save this chat" | `conversation_create` + `conversation_add_message` |
44
- | "what do you know about X?", "recall..." | `memory_search` |
48
+ | "what do you know about X?", "recall..." | `context_search` |
45
49
  | "show me our past conversation about..." | `conversation_list` + `conversation_get` |
46
50
  | "the user prefers...", "their budget is..." | `memory_add` |
47
51
  | "save my query and your response" | `conversation_add_message` |
@@ -81,7 +85,7 @@ One `memory_search` already spans this user's memories across all agents; no per
81
85
  - **Personal memories** — written by `memory_add`. The `agent_id` records the writer but does not restrict reads; memories are scoped per-user, so any of that user's agents can read them and no other user can.
82
86
  - **Team-shared Shared Knowledge** — arrives two ways:
83
87
  1. An agent calls `memory_promote` for exact, user-confirmed memory UUIDs, or the user promotes them from the Cloud UI's Learnings tab. Promotion moves the memories into shared knowledge, strips `user_id`, preserves originating `agent_id` as provenance, and evicts the private mem0 records.
84
- 2. The user uploads a file via Datapack → Actions → **Add Knowledge** in the Cloud UI. PDF/TXT/MD/JSON/MP4 up to 5MB each.
88
+ 2. The user uploads a file via Datapack → Actions → **Add Knowledge** in the Cloud UI. PDF/TXT/MD/JSON/CSV/XML/HTML up to 5MB (Free) / 50MB (Standard) / 60MB (Pro+) each.
85
89
 
86
90
  Both show up in `knowledgebase_search`, tagged `metadata_filters.source: "memory"` vs other values so the agent can distinguish provenance in responses.
87
91
 
@@ -89,14 +93,13 @@ One `memory_search` already spans this user's memories across all agents; no per
89
93
 
90
94
  ### When the user asks "what do you know about X?"
91
95
 
92
- A full sweep is two calls (budget for it — each is 2-6 seconds):
96
+ Call `context_search`:
93
97
 
94
98
  ```
95
- memory_search(agent_id="claude_desktop", query="X", conversation_id=..., ...)
96
- knowledgebase_search(agent_id="<anything>", datapack_id="<uuid>", query="X", conversation_id=..., ...)
99
+ context_search(agent_id="claude_desktop", query="X", conversation_id=..., datapack_id="<uuid>")
97
100
  ```
98
101
 
99
- The single `memory_search` includes everything this user and their other agents wrote in the datapack.
102
+ Its memory bucket includes everything this user and their other agents wrote in the datapack. The KB bucket holds team-shared knowledge, and the conversation bucket holds matching past turns from anyone on the datapack. If the memory or KB bucket is empty, confirm with `memory_search` or `knowledgebase_search` before saying nothing is there, because `context_search` returns an empty list for a failed source.
100
103
 
101
104
  When you answer, be explicit about scope so the user knows why something is or isn't there:
102
105
 
@@ -111,7 +114,7 @@ When you answer, be explicit about scope so the user knows why something is or i
111
114
  There is no MCP-side "just put it in a database table" option — raw SQL access isn't part of the MCP surface. Workarounds:
112
115
 
113
116
  1. **Write a single narrative summary** as a memory: `"The Customer Complaints dataset has fields: Complaint ID (int), Date Submitted (date), Product (text), Sub-product (text), Issue (text)..."` — one call, not row-by-row.
114
- 2. **Suggest the user upload the file** via the Cloud UI's Add Knowledge flow if it's a document (CSV files aren't in the supported list — PDF/TXT/MD/JSON/MP4 are; for CSV, convert to MD or JSON first).
117
+ 2. **Suggest the user upload the file** via the Cloud UI's Add Knowledge flow if it's a document (PDF/TXT/MD/JSON/CSV/XML/HTML are supported).
115
118
  3. **Never ingest CSV row-by-row** into memory — each row becomes a fragmented fact with lost context.
116
119
 
117
120
  ## Memory Storage: capture the turn, don't proactively memory_add
@@ -146,6 +149,7 @@ The full transcript including:
146
149
  - **Assistant responses** — all text blocks (the `output` field)
147
150
  - **Tool calls** — tool name + input parameters (the `reasoning` field)
148
151
  - **Tool results** — output from tool executions (appended to `reasoning`)
152
+ - **Injected context** — skill bodies, background-task notifications, and subagent reports that the client writes into the transcript (appended to `reasoning` of the turn they belong to, never used as `input`)
149
153
 
150
154
  This is more than just text — tool calls and results are critical context for session replay, cross-agent sharing, and compaction.
151
155