Skip to main content

Memory & RAG Tools

The 60db MCP Server exposes the full Memory/RAG layer to MCP clients like Claude Desktop. These tools let an AI assistant persist user memories, ingest knowledge base documents (91+ formats with built-in OCR), run hybrid semantic recall, and assemble LLM-ready context for retrieval-augmented generation.
All memory tools are pay-as-you-go from the workspace wallet. Every billable response surfaces the new balance, the charge amount, and the transaction ID in the formatted output so the agent can reason about cost. See the pricing reference for rates and refund policy.

Tool summary

Ingest a memory

Store a single fact, preference, or conversation snippet:
Parameters:
  • text (required) — content to store, max 100,000 characters
  • title (optional) — display title
  • collection (optional) — target collection ID (defaults to personal)
  • typeuser, knowledge, or hive (default: user)
  • infer — if true, the memory service extracts structured facts via LLM
Cost: $0.0001 per 1,000 characters.

Upload a document

The most powerful memory tool — give the agent a file path and 60db handles format detection, OCR, chunking, and ingestion:
Parameters:
  • file_path (required) — absolute path on the agent’s local filesystem
  • collection (optional) — target collection
  • typeuser | knowledge | hive (default: knowledge — right choice for docs)
  • title (optional) — display title, defaults to filename
  • chunk_size (optional) — characters per chunk (200–8000, default 1500)
  • chunk_overlap (optional) — character overlap between chunks (default 200)
Supported formats: PDF, DOCX, DOC, ODT, RTF, TXT, MD, HTML, EPUB, XLSX, XLS, CSV, ODS, PPTX, PPT, ODP, EML, MSG, PNG, JPG, TIFF, BMP, and 70+ more. OCR is applied automatically to scanned PDFs and images. Max file size: 200 MB. Max chunks per document: 100. Cost (two-stage):
  • Extract fee: $0.003 per MB (pre-charged)
  • Ingest fee: $0.0001 per 1,000 extracted characters (post-charged)
Both fees are automatically refunded on any failure.

Search memories

Hybrid semantic + keyword recall with optional cross-encoder reranking, across user memories AND knowledge documents in one call:
Parameters:
  • query (required) — search text, max 2,000 chars
  • collection (optional) — collection to search
  • modefast (dense retrieval, ~100-200ms) or thinking (wider pool + cross-encoder rerank, ~200-400ms)
  • max_results — 1–50, default 10
  • alpha — 0 (keyword only) to 1 (semantic only), default 0.8
  • recency_bias — weight for newer memories (0–1), default 0
  • graph_context — include knowledge-graph relationships
Advanced reranker knobs (optional, override server defaults):
  • rerank_top_k — max candidates the cross-encoder reranks (1-500)
  • rerank_timeout_ms — hard timeout for rerank call (50-5000ms)
  • min_rerank_score — drop results below this score (0-1)
  • fetch_multiplier — in thinking mode, fetch N x max_results candidates (1-10)
When the reranker is active, each result includes a rerank_score (cross-encoder confidence, 0-1) alongside the regular score (dense similarity). The rerank score is the more reliable ranking signal. Tuning by query type: Cost: flat $0.0003 per query regardless of parameters.

Assemble context (RAG)

Purpose-built for retrieval-augmented generation. Returns a prompt_ready string you can prepend directly to an LLM system message:
Graceful degradation — if the memory layer is unreachable, the tool returns an empty prompt_ready string and the charge is automatically refunded so the chat flow keeps working. Cost: flat $0.0005 per query.

Collections

List everything the caller can see:
Create a team/knowledge/hive collection (admin/owner only):
Personal collections are auto-created per user on first use and cannot be created via this tool. Both are unbilled.

Monitor spend

Track usage and wallet balance without affecting the wallet:
Returns net spend, operation count, refund count, and a per-service-type breakdown, plus the billing owner’s current wallet balance. Always free, works even when the wallet is empty. Periods: current_month (default), last_30_days, all_time.

Handling insufficient credits

When the wallet runs out, billable tools return an error with INSUFFICIENT_CREDITS structure. Agents should:
  1. Catch the 402 case
  2. Call sixtydb_memory_get_usage to show the shortfall to the user
  3. Prompt the user to top up via the 60db dashboard (link: /app/billing)
  4. Retry the original operation once the wallet is funded

Billing transparency in every response

Every billable tool response includes a Billing footer in the formatted output:
The JSON response format also embeds a billing: { balance, charged, txId } object for programmatic consumers.