/meko-agent-skills:meko-mcp-toolsfrom meko-agent-skills
Guides AI agents using Meko MCP tools for memory, knowledge persistence, and datapack management. Covers 32 tools with behavioral contracts for search, recall, and error handling.
Ships in meko-agent-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
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 32 MCP tools available in production.
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.
Apply these rules before the longer guidance below. They are service-contract safeguards, not suggestions.
Inspect the response envelope before its contents:
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."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.results array proves a legitimate empty search.memory_get_all before claiming a complete listingmemory_get_all returns one page of rows (20 by default; page_size up to 100) plus total, page, page_size, and total_pages. To list everything, repeat the call with page=2, 3, ... up to total_pages, keeping every other argument the same. Claim a complete listing only after you have fetched every page and the rows you hold match total; rows written while you page can shift later pages. promoted=true lists a different set (promoted memories, with its own total), not the next page. It takes no limit or offset. To find one fact, use memory_search or memory_get_by_id instead of paging. A server older than this paging rejects page and page_size; there, call it without them and say the result is the newest rows, not a complete listing.
Retrieve up to about 25 candidates for recall, preserve relevance order, and pass at most the top 10 useful evidence items to final reasoning. Never paste all 25–30 results into the reader by default. Raise the reader window only after measuring misses outside the top 10. When dated claims conflict, resolve recency only among claims about the same entity and field; do not sort the whole result set by date.
If no candidate supports an answer, abstain: say the retrieved evidence does not cover it. Never fill the slot with a guess, and when the task offers fixed options, choose the one that means "not enough information" rather than defaulting to any particular option.
content_hash, then read back important bytes. A missing hash means the upload is unconfirmed.datapack_id as the write. Checking the default datapack after writing to a pinned one proves nothing.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.agent_id — multi-agent identityUse the SessionStart-injected agent_id verbatim. It normally has shape <client>:<repo-basename>. Use meko_agent only for deliberately cross-project writes; empty write IDs also route there.
Read scoping varies by tool:
memory_search / memory_get_all — scoped to (datapack_id, user_id); agent_id does not filter results. Do not fan out reads by agent.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.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.conversation_list — user/datapack scoped; agent_id is trace attribution only.knowledgebase_search — datapack scoped; agent_id is ignored.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.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.
Use Meko for durable facts that must survive sessions, be found by meaning, or be shared across agents. Keep source code, exact artifacts, canonical specifications, and whole documents in their normal file or artifact stores; use exact lookup when identity is known. Do not create an ad-hoc local "agent memory" file as a substitute for Meko.
On Claude Code, memory reaches Meko two ways:
memory_add (the narrow path) — only for the cases extraction can't reach (see "When to call memory_add" below).For meaning-based recall, call memory_search. For an exact known filename, key, hash, or complete document, use the corresponding direct file or artifact lookup. If a Meko call fails, report the failure; do not silently replace durable shared memory with a private local note.
Subagents do not receive SessionStart context. Every spawn prompt must include:
Meko context (inherited from parent session):
- agent_id: "<parent's agent_id, verbatim>"
- conversation_id: "<parent's conversation_id>"
- Use these verbatim for all Meko MCP calls.
Reuse the inherited conversation unless the parent or user explicitly requests a fresh scope. Always reuse the inherited agent ID.
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.
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.
On Claude Code, hooks capture user turns and the server extracts durable memories. Do not duplicate facts the user states with memory_add.
Recall first; save only what capture cannot reach; never re-store a just-stated fact.
| Signal in conversation | What to do |
|---|---|
| User states a fact about themselves, their team, tools, or preferences | Nothing — automatic capture + extraction stores it. Just answer. |
| 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. |
| User explicitly says "remember this" / "save this to memory" | memory_add (verbatim). This is the clearest explicit-save case. |
| A durable fact appears only in assistant output or a tool result | memory_add; automatic extraction reads the user turn. |
| 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. |
| User asks "what do we (as a team) know about X?" or about uploaded documents | knowledgebase_search (returns uploaded docs + promoted memories). |
| User asks to share private memories | Follow the exact-ID memory_promote confirmation workflow below. |
| 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. |
| User wants a file kept in Meko but didn't say how | KB (knowledgebase_upload_document) if its content should be searchable later — docs, manuals, policies, notes people will ask about. Artifact (artifact_put) to keep it exactly as-is and fetch it back whole — a generated report, a result CSV. If it is not clear whether the user needs semantic search or whole-file retrieval, ask. |
| 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. A request to make the file available to the team is not that yes; ask anyway. If you have the file's bytes — already on disk, or generated mid-conversation — and a shell, check that you can reach S3 first: run curl -sS -o /dev/null -m 10 -w '%{http_code}' https://s3.amazonaws.com; in Windows PowerShell, run curl.exe with NUL in place of /dev/null. A 2xx or 3xx status means yes (S3's root normally answers 307). 000, a connection, DNS or proxy error, or any other status, such as a proxy's 403 or 407, means no. A pass shows outbound HTTPS to S3 works, not that the presigned bucket host does, so if the POST still fails, report it and stop. If it passes, call knowledgebase_upload_document. A sandboxed session may have the file but no outbound network; if the check fails, don't call it, since an unused URL holds storage quota for up to 15 minutes. 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. |
Use it only for an explicit save request, an output/tool-derived durable fact, or a correction whose stale predecessor must be replaced. Store one focused fact verbatim; for corrections, update/delete the stale record.
Background, PreCompact, and SessionEnd hooks capture the conversation automatically. Do not create a separate capture cron.
Use the injected conversation_id and agent_id verbatim and inspect any preloaded memories. If injection is absent, do not invent values; ask for the missing identity or create a conversation only when the applicable workflow permits it.
When Meko is available and the user may have stored relevant preferences, search for them before deleting, overwriting, or restructuring user content:
memory_search(query="destructive <action type> preferences feedback",
agent_id=<your agent_id>, conversation_id=<session_conversation_id>)
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.
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.
tools-memory-vs-conversation.md.reasoning, tool results as follow-up reasoning entries. These are essential for session replay and compaction context.conversation_add_message fails, log the error and continue. Do not retry more than once.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:
conversation_get and conversation_update return {"error": "not_found", "detail": "Conversation <id> not found"}, or the call times out.conversation_add_message returns the same not_found.When this happens on the conversation you've been using all session, accept the error and keep working:
context_search, the memory_* tools, and knowledgebase_search. They don't load the conversation trace.A not_found for a conversation you just created, or one this session never wrote to, has other causes; see tools-troubleshooting.md.
Use only the required parameters. Do not guess optional parameters.
In the examples below, <your-agent-id> means the value the SessionStart hook injected into additionalContext — for Claude Code, something like claude_code:meko-mcp-server. Not the literal string "<your-agent-id>".
Only for the three narrow cases in "When to call memory_add" above — not for facts the user stated in conversation (those are captured automatically). The example below is an explicit "remember this" save:
memory_add(
text="Remember: deploy scripts must be run from the repo root, never a subdir",
agent_id="<your-agent-id>",
conversation_id="<session_conversation_id>")
Required parameters: text, conversation_id. On writes, conversation_id must be a real UUID (from conversation_create or the SessionStart hook) — writes attached to a nil/empty conversation are orphaned in Langfuse traces. NEVER pass "current" or other non-UUID values. agent_id is technically optional — empty/missing routes the write into the meko_agent common bucket — but for project-scoped facts pass the SessionStart-injected value verbatim.
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.
context_search(
query="auth migration decisions",
agent_id="<your-agent-id>",
conversation_id="<session_conversation_id>",
datapack_id="<pinned datapack UUID, if any>")
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": {...}}.
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.null only when that source wasn't queried: force_source excluded it, or the server couldn't build a query vector for it.user_id. Don't present a hit as this user's own history.limit bounds the memory and KB buckets only; the conversation bucket returns up to 10 hits plus a thread of whole turns.force_source to "memory", "knowledge_base", or "conversation" only when you already know the one source you need.memory_search or knowledgebase_search directly when you need run_id filtering, the memory similarity floor, or exact document IDs for knowledgebase_delete_document.memory_search(
query="user role",
agent_id="<your-agent-id>",
conversation_id="<session_conversation_id>")
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.
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".
Evidence going into reasoning follows operating contract 3 (retrieve ≤ ~25, pass ≤ ~10).
Follow operating contract 2: one page per call, page=1..total_pages for a full listing, and no completeness claim until the rows you hold match total.
knowledgebase_search(
query="...",
agent_id="<anything — ignored>",
conversation_id="<session_conversation_id>",
datapack_id="<datapack UUID>",
limit=10)
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.
For recalling working memories — especially recently-changed facts — prefer memory_search; the knowledge base is the team's publish/archive surface.
memory_promote is destructive and non-idempotent: it makes selected content visible to the datapack, moves the memories into shared knowledge, and evicts the private records. There is no MCP rollback.
memory_search or memory_get_all to obtain exact memory UUIDs from the id field. Never pass any other identifier.memory_promote.conversation_id, exact memory_ids, intended agent_id, and intended datapack_id. If a legacy deployment exposes scope, use the minimum write scope; do not escalate to admin.knowledgebase_search. Do not claim rollback is possible.The Cloud UI's Learnings tab remains an alternative user-driven path.
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.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.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.
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.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.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.On the first Meko tool call in a fresh session (no prior Meko tool call since process start), and whenever the user explicitly asks "is Meko working?" or "test Meko connection", run a canary round-trip before proceeding with their actual request. This is the user-visible proof that the MCP transport, auth, and datapack routing are wired correctly end-to-end — a silent failure at install time will otherwise only surface much later, when real memories go missing.
What it does. Write a canary memory with the shape below, capture the id returned by memory_add, then verify with memory_get_by_id — a direct pgvector row lookup. If the row is returned, delete it (default) and tell the user "Meko connection OK". If any step fails, tell the user exactly which step failed — do not swallow the error. Do not retry: routing errors need to surface, not be papered over. (We use memory_get_by_id rather than memory_search deliberately: mem0 does not index metadata and is inconsistent about indexing the memory text for very short strings, so a search-based canary false-negatives against the real service.)
Canary memory shape. This is the spec; keep the fields stable so support can grep for them.
agent_id: the session's agent_id (from additionalContext); not a constantconversation_id: the session's conversation_id (from additionalContext). If the hook failed and you truly have no conversation_id, call conversation_create first and use the returned id — do not use a nil UUID, it orphans the canary trace.text: "Meko connection test: <client> @ <installer-version> — <ISO timestamp>. Safe to delete."metadata (JSON): {"type": "connection-test", "marker": "<uuid>", "client": "claude-code" | "claude-desktop" | "cursor", "installer_version": "<x.y.z>", "installed_at": "<ISO>"}Gating. The canary runs at most once per session. Persist a one-line-per-session marker (JSON { "last_canary_at": "<ISO>", "result": "ok" | "failed", "marker": "<uuid>" }) under ~/.claude/meko-capture/canary-<agent_id-slugified>.json — mirroring the watermark-file convention the capture hook already uses. On session start, check the file's mtime; if it was written during this process's uptime, skip. On success, rewrite the file. When the user explicitly asks to test the connection, ignore the gate and run anyway.
Keeping the canary for support. By default the canary is deleted after read-back. If the user passes --keep-canary (or equivalent) or is debugging an issue with support, leave it in place — the metadata.type: "connection-test" label makes it safe to identify and purge later.
Reporting. This is user-visible — the whole point is to give the user concrete proof. On success: "Meko connection OK (canary round-trip succeeded)". On failure, name the failing step and include the raw error: "Meko canary failed at memory_add: <error>. Likely causes: wrong datapack, expired API key, server unreachable."
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.
| File | What it covers |
|---|---|
tools-overview.md | Complete catalog of all 32 tools available in production, with decision tree |
tools-selflearning-workflow.md | Finding weak searches, fixing them with existing tools, and checking the fix with the Self-learning tools |
tools-cookbook.md | Per-tool examples with correct parameters, responses, and error cases |
tools-memory-vs-conversation.md | When to use memory tools vs conversation tools |
tools-datapack-workflow.md | Datapack lifecycle and datapack_id routing |
tools-rag-workflow.md | End-to-end RAG pipeline flow |
tools-amp-workflow.md | AMP (behind SHOW_PG_AMP): provision a Postgres cluster + endpoint, fork, resize, tear down, connect |
tools-agent-id-conventions.md | Naming rules and constraints for agent_id |
tools-conversation-dedup.md | Seed-based trace deduplication |
tools-troubleshooting.md | Error recovery, retry strategies, stuck pipeline diagnosis |
tools-known-limitations.md | Lifetime quotas, memory_get_all paging, run_id scoping, missing capabilities |
references/_sections.md (opens in a new tab)references/tools-agent-id-conventions.md (opens in a new tab)references/tools-amp-workflow.md (opens in a new tab)references/tools-conversation-dedup.md (opens in a new tab)references/tools-conversation-reasoning.md (opens in a new tab)references/tools-cookbook.md (opens in a new tab)references/tools-datapack-workflow.md (opens in a new tab)references/tools-known-limitations.md (opens in a new tab)references/tools-memory-vs-conversation.md (opens in a new tab)references/tools-overview.md (opens in a new tab)references/tools-rag-workflow.md (opens in a new tab)references/tools-selflearning-workflow.md (opens in a new tab)references/tools-troubleshooting.md (opens in a new tab)references/tools-user-id-conventions.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
mcp-tools, memory-management, knowledge-base, agent-behavior, datapack
npx claudepluginhub yugabyte/meko-skills --plugin meko-agent-skills4 skills in this plugin
/meko-mcp-tools-desktopBehavioral guide for Meko MCP tools on desktop Claude. READ IT BEFORE calling any meko tool — it sets the required agent_id and workflow; calling a meko tool without it produces wrong-bucket writes. Use whenever the user mentions memory, Meko, datapacks, knowledge base, or conversations, or asks to remember/save/store anything. ALSO trigger (even with no tool or Meko keyword) when: (a) the user states ANY durable fact about themselves — name, role, team, tools, stack, preferences, conventions — INCLUDING facts dropped inside a task/technical question ("I use pnpm", "I'm evaluating X"); or (b) the user asks a RECALL question — "what do you know about me", "who am I", "what was the last thing I told you" — then search Meko (memory_search) first and never claim memory is unavailable without checking. On Desktop the agent_id is ALWAYS "claude_desktop" (or "meko_agent" for cross-project identity) — NEVER "claude_code"./meko-select-datapackLists the user's Meko datapacks, shows authorization, supports search and pagination, and pins one as the active datapack for the current project. Triggers when the user says things like "switch datapack", "use the Acme datapack", "list my datapacks", "which datapack am I on", "pin Acme", or any request to change or inspect the active datapack. Also trigger before the first Meko MCP write of a session if no datapack pin exists and the user has more than one datapack./meko-select-datapack-desktopLists the user's Meko datapacks, shows authorization, supports search and pagination, and pins one as the active datapack on Claude Desktop. Triggers when the user says things like "switch datapack", "use the Acme datapack", "list my datapacks", "which datapack am I on", "pin Acme", or any request to change or inspect the active datapack. Persistence is via memory_add (Desktop has no SessionStart hook), so the pin survives across sessions until the user clears it.Other plugins' skills for the same job