Mirabase Data Layer
Memory for agents. And more.
One API for files, knowledge, and memory
Versioned, indexed writes. Cited context within a token budget.
One API key for context management
Files, knowledge, and memory via prompt or code
Get an API key
Start freeGive your Agent the prompt
Connect yourself to the Mirabase MCP server and run a test. 1. The API key is in the environment variable MIRABASE_API_KEY. Use its value only when configuring the request header. Do not print or echo the value, or include it in any reply or log. 2. Add an MCP server named mirabase using your client's configuration method: URL https://api.mirabase.dev/mcp, transport Streamable HTTP, request header Authorization: Bearer <value of MIRABASE_API_KEY>. Instructions: https://mirabase.io/developers/agents 3. If the new tools require a restart to take effect, ask me to restart first, and continue from step 4 after I restart. 4. Call mira.whoami to verify the connection and check this key's capabilities. 5. Call mira.files.write to write the test file /quickstart/agent-test.md with create_only set to true and this content: The launch moved to March 14. Tina owns the checklist. 6. Call mira.answer with the question: When is the launch, and who owns the checklist? Check that the answer has citations. 7. Report to me: whether the connection succeeded, the key's capabilities, the test file path, and the exact answer with its citations. Do not delete or change anything that already exists. If a step fails, stop and tell me the error code and message.
Base URLhttps://api.mirabase.dev
Read and write by path
PUT /v2/spaces/{space_id}/filesVersion every write; roll back
POST /v2/spaces/{space_id}/files/revertBranch and snapshot
POST /v2/spaces/{space_id}/branches- API reference
curl -X PUT "https://api.mirabase.dev/v2/spaces/default/files?path=/notes/hello.md" \
-H "Authorization: Bearer $MIRABASE_API_KEY" \
-H "Content-Type: text/markdown" \
--data-binary "Mirabase keeps files, knowledge and memory in one place."
import { Mirabase } from "@mirabase/sdk/developer";
const mirabase = new Mirabase(); // MIRABASE_API_KEY
const written = await mirabase.files.write(
"/notes/hello.md",
"Mirabase keeps files, knowledge and memory in one place.",
{ contentType: "text/markdown" },
);
from mirabase import Mirabase
mb = Mirabase() # MIRABASE_API_KEY
written = mb.files.write(
"/notes/hello.md",
"Mirabase keeps files, knowledge and memory in one place.",
content_type="text/markdown",
)
{
"entry": {
"id": "<id>",
"space_id": "<space_id>",
"title": "Launch notes",
"latest_version_id": "<latest_version_id>",
"metadata": {},
"created_at": "2026-11-06T00:00:00Z",
"updated_at": "2026-11-06T00:00:00Z",
"file": {
"path": "/notes/hello.md",
"size": 1,
"media_type": "<media_type>",
"etag": "<etag>"
},
"knowledge": {
"state": "readable"
},
"memory": {
"scope": "project",
"kind": "<kind>",
"pinned": false,
"exclude": false
},
"memory_exclude": false,
"access": {
"role": "owner",
"capabilities": [
"knowledge:read"
]
}
},
"version_id": "<version_id>",
"version_created": false
}
Index every write automatically
GET /v2/entries/{entry_id}/processingHybrid search with citations
POST /v2/retrieval/searchFlag duplicates, superseded content, and conflicts
flags- API reference
Write a file first
curl -X POST https://api.mirabase.dev/v2/retrieval/search \
-H "Authorization: Bearer $MIRABASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "where do files and memory live"}'
Write a file first
import { Mirabase } from "@mirabase/sdk/developer";
const mirabase = new Mirabase(); // MIRABASE_API_KEY
const hits = await mirabase.search("where do files and memory live");
Write a file first
from mirabase import Mirabase
mb = Mirabase() # MIRABASE_API_KEY
hits = mb.search("where do files and memory live")
{
"data": [
{
"entry_id": "ent_01JD2M8Z4K",
"version_id": "ver_01JD2M8Z4M",
"space_id": "col_01JD2M7QK3",
"title": "plan.md",
"text": "The launch of version 2.4 moved to Friday 21 November.",
"score": 0.82,
"citation_id": "c1",
"source_type": "file",
"path": "/notes/plan.md",
"modified_at": "2026-11-17T08:02:00Z"
}
],
"trace_id": "trc_01JD2M7R",
"partial": false
}
Distill facts from conversations
POST /v2/spaces/{space_id}/ingestReplace old values; keep history
replaced_byConfirm, correct, or forget facts
POST /v2/memories/{memory_id}/correct- API reference
curl -X POST "https://api.mirabase.dev/v2/spaces/default/ingest" \
-H "Authorization: Bearer $MIRABASE_API_KEY" \
-H "Idempotency-Key: chat-42-batch-1" \
-H "Content-Type: application/json" \
-d '{"kind": "conversation", "session_id": "chat-42", "messages": [
{"role": "user", "content": "Let us ship on Thursdays from now on.", "timestamp": 1762416000000},
{"role": "assistant", "content": "Noted: releases on Thursdays."}
]}'
import { Mirabase } from "@mirabase/sdk/developer";
const mirabase = new Mirabase(); // MIRABASE_API_KEY
const receipt = await mirabase.conversations.add(
[
{ role: "user", content: "Let us ship on Thursdays from now on.", timestamp: 1762416000000 },
{ role: "assistant", content: "Noted: releases on Thursdays." },
],
{ sessionId: "chat-42", idempotencyKey: "chat-42-batch-1" },
);
from mirabase import Mirabase
mb = Mirabase() # MIRABASE_API_KEY
receipt = mb.conversations.add(
[
{"role": "user", "content": "Let us ship on Thursdays from now on.", "timestamp": 1762416000000},
{"role": "assistant", "content": "Noted: releases on Thursdays."},
],
session_id="chat-42",
idempotency_key="chat-42-batch-1",
)
{
"entry_id": "ent_01JD2M9B2D",
"version_id": "ver_01JD2M9B2E",
"job_id": "job_01JD2M9B2F",
"knowledge": {
"state": "readable"
},
"memory_status": "confirmed",
"memory": {
"state": "pending"
},
"secrets_redacted": 0
}
Fit a token budget
budget_tokensDraw on files, knowledge, and memory
weightsCite every item
citation_id- API reference
Write a file first
curl -X POST https://api.mirabase.dev/v2/retrieval/context \
-H "Authorization: Bearer $MIRABASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"task": "Fix the failing upload test", "purpose": "coding", "tier": "standard", "budget_tokens": 4000}'
Write a file first
import { Mirabase } from "@mirabase/sdk/developer";
const mirabase = new Mirabase(); // MIRABASE_API_KEY
const pack = await mirabase.context("Fix the failing upload test", {
purpose: "coding",
tier: "standard",
budget_tokens: 4000,
});
Write a file first
from mirabase import Mirabase
mb = Mirabase() # MIRABASE_API_KEY
pack = mb.context(
"Fix the failing upload test",
purpose="coding",
tier="standard",
budget_tokens=4000,
)
{
"pack_id": "<pack_id>",
"items": [
{
"entry_id": "<entry_id>",
"version_id": "<version_id>",
"title": "Launch notes",
"text": "The launch moved to March 14.",
"citation_id": "<citation_id>",
"source": "memory"
}
],
"route": {
"purpose": "task",
"tier": "fast",
"rules_fired": [
"<rules_fired>"
],
"sources": [
{
"source": "memory",
"budget": 1,
"used": 1,
"picked": 1,
"omitted": 1,
"why": "<why>"
}
],
"unused_tokens": 1
},
"tokens_used": 1,
"budget_tokens": 1,
"tokenizer": "cl100k_base",
"omitted": {
"count": 1,
"max_score": 1
},
"scope_used": {
"space_ids": [
"<space_ids>"
]
},
"partial": false
}
Security, reliability, and speed
Security
Encrypted at rest; HTTPS only; tenant rows isolated
Scoped key per Agent; every action audit-logged
Reliability
Immutable versions, snapshots, restorable trash
Idempotent writes; 7-day backups
Speed
Production median: search about 0.64 s, context about 1.2 s
Streaming answers; token-budgeted context
