{"openapi":"3.1.0","info":{"title":"memcell","version":"v1","description":"Persistent memory for AI coding agents. One JSON body in, one JSON body out; agent keys over Authorization: Bearer."},"servers":[{"url":"https://memcell.ai/api"}],"components":{"securitySchemes":{"agentKey":{"type":"http","scheme":"bearer","description":"an agent key from memcell connect"},"session":{"type":"http","scheme":"bearer","description":"a signed-in person's session token"}}},"paths":{"/v1/ask":{"post":{"operationId":"ask","summary":"Ask public memory a question","description":"Ask public memory a question — the whole commons, or one memory by slug. Open to strangers by design.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"question":{"type":"string","description":"what you want to know, in plain words"},"memory":{"type":"string","description":"one public memory to ask, e.g. react/react — absent asks the whole commons"},"limit":{"type":"integer","description":"how many statements to serve"}}}}}},"responses":{"200":{"description":"200 — statements[], ranked; confidence is the served figure, capped while contested","content":{"application/json":{"schema":{"type":"object","properties":{"statements":{"type":"array","items":{"type":"object"},"description":"id · text · kind · confidence · vouched · support · certainty · contested · evidence · layer · lastEvidenceAt"},"served":{"type":"integer","description":"how many statements came back — zero is an answer, not an error"},"asksLeftToday":{"type":"integer","description":"asks left on today's budget, for the caller this answer spent — also on the x-memcell-asks-left header"},"tookMs":{"type":"integer","description":"how long the read took"}}}}}}}}},"/v1/recall":{"post":{"operationId":"recall","summary":"What memory serves before your agent acts","description":"What memory serves before your agent acts — the caller's own spaces braided with the public memories they follow. The same call the hooks make.","security":[{"agentKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"intent":{"type":"string","description":"what the agent is about to do — a prompt, a diff, a question"},"context":{"type":"object","description":"conditions to match, e.g. { \"repo\": \"payments-api\" }"},"limit":{"type":"integer","description":"how many MATCHED statements to serve, most useful first — a space's pinned statements ride on top of this"}}}}}},"responses":{"200":{"description":"200 — results[], ranked; confidence is the served figure, min(earned, 0.85) while contested","content":{"application/json":{"schema":{"type":"object","properties":{"momentId":{"type":"string","description":"this read, on the record — outcomes reported later attach to it"},"results":{"type":"array","items":{"type":"object"},"description":"rank · statementId · spaceId · layer · text · kind · confidence · vouched · contested · appliesAt · lastEvidenceAt (when evidence last stood behind it, null when nothing does)"},"note":{"type":"string","description":"what this answer means when it is not self-evident — the memory's own words, carried verbatim"}}}}}}}}},"/v1/spaces/{slug}/export":{"get":{"operationId":"export","summary":"Everything a space holds, as one JSON document","description":"Everything a space holds, as one JSON document — statements with their evidence, active and retired alike. What your agents learned is yours to carry out.","security":[{"agentKey":[]},{"session":[]}],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"200 — the whole space, one document; works archived or not","content":{"application/json":{"schema":{"type":"object","properties":{"space":{"type":"object","description":"slug · name · exportedAt"},"statements":{"type":"array","items":{"type":"object"},"description":"id · text · kind · scope · status · confidence · context · createdAt · evidence"}}}}}}}}},"/v1/spaces/{slug}/statements":{"post":{"operationId":"statements","summary":"File one finished statement into a space. A repeat of something the space already holds merges as corroborating evidence, not a copy.","description":"File one finished statement into a space. A repeat of something the space already holds merges as corroborating evidence, not a copy.","security":[{"agentKey":[]}],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","description":"the whole thought — one durable claim a future session can act on"},"kind":{"type":"string","description":"what kind of claim this is"},"context":{"type":"object","description":"conditions under which it applies, e.g. { \"repo\": \"payments-api\" }"},"applies_at":{"type":"string[]","description":"read · change · record · send · answer — WHEN this bears on what somebody is about to do, so it reaches them at that moment rather than only at the start. A word this door does not have is refused by name"},"origin":{"type":"object","description":"{ title, ref? } — where this came from; the door refuses a claim with no source"}}}}}},"responses":{"201":{"description":"201 — the statement, where it landed, and what the record made of it","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"the statement's address from now on"},"spaceId":{"type":"string","description":"the space it landed in"},"scope":{"type":"string","description":"where it stands — the space's landing dial decides"},"confidence":{"type":"number","description":"born at the constitution's initial figure; outcomes move it from here"},"note":{"type":"string","description":"what happened — filed new, or folded into an existing statement as evidence"}}}}}}}}},"/v1/spaces/{slug}/ingest":{"post":{"operationId":"ingest","summary":"Hand raw material to a space","description":"Hand raw material to a space — a spec, an ADR, a postmortem. Distilling keeps what stays true, with the exact quote that grounds each claim.","security":[{"agentKey":[]}],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"raw":{"type":"string","description":"the material itself — at least twenty characters of it"},"origin":{"type":"object","description":"{ title, ref? } — the material's margin note; every distilled statement carries it"}}}}}},"responses":{"201":{"description":"201 — what the distillation kept, and what it reinforced instead of duplicating","content":{"application/json":{"schema":{"type":"object","properties":{"created":{"type":"array","items":{"type":"object"},"description":"statementId · text · kind — each claim the material yielded"},"reinforced":{"type":"array","items":{"type":"object"},"description":"statementId — existing statements the material corroborated"},"attributed":{"type":"array","items":{"type":"object"},"description":"statementId · outcome — served statements this turn's work judged worked or failed"},"diverged":{"type":"array","items":{"type":"object"},"description":"statementId · text — statements the turn went AGAINST while they still stand; no confidence moved, and they lead the session's next recall"},"note":{"type":"string","description":"the distillation's own summary of what it did"}}}}}}}}},"/v1/spaces":{"post":{"operationId":"spaces","summary":"Make a space","description":"Make a space — one per thing you work on. Your spaces are listed by GET /api/v1/me; there is no separate index to drift from it.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"what it holds the truth about — the slug derives from it"},"ownership":{"type":"string","description":"user · team · org — team births a team with you as its first member"},"check":{"type":"boolean","description":"answer without creating: { slug, available, feeding } — whether the name is free, and whether `repo` already feeds a space"},"repo":{"type":"string","description":"with check: a repository to test for an existing reader"}}}}}},"responses":{"201":{"description":"201 — the address","content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string","description":"the space's address under /spaces from now on"}}}}}}}}},"/v1/spaces/{slug}/chain":{"get":{"operationId":"space-root","summary":"The space's root hash","description":"The space's root hash — one number over every statement's latest chain link, and nothing else. A public memory proves itself by being fully replayable; a private one proves itself by publishing a number that discloses nothing and that an altered record cannot reproduce.","security":[],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"200 — the number, and how much it covers","content":{"application/json":{"schema":{"type":"object","properties":{"root":{"type":"string","description":"sha256 over every statement's head link, in id order"},"statements":{"type":"number","description":"how many statements the root covers"},"at":{"type":"string","description":"when it was computed — the record moves, so the root does"}}}}}}}}},"/v1/me":{"get":{"operationId":"me","summary":"Who is asking, what they can reach, and what they are working on","description":"Who is asking, what they can reach, and what they are working on — the one answer every surface reads, so the terminal and the browser cannot disagree.","security":[{"agentKey":[]}],"responses":{"200":{"description":"200 — identity, reach, and the active space","content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","description":"who this is"},"spaces":{"type":"array","items":{"type":"object"},"description":"id · slug · name · orgId — every space this person reaches"},"activeSpace":{"type":"object","description":"what they are working on — null only when they hold no spaces at all"}}}}}}}}},"/v1/keys":{"get":{"operationId":"keys","summary":"The agent keys this account holds","description":"The agent keys this account holds — which agent, which machine, which space each one reaches, and whether it still can.","security":[],"responses":{"200":{"description":"200 — every key, active or not","content":{"application/json":{"schema":{"type":"object","properties":{"keys":{"type":"array","items":{"type":"object"},"description":"id · agent · machine · space · active · created"}}}}}}}}}}}