Client Libraries · Python & JavaScript
One install. Eight verbs.
Typed clients for Python and JavaScript that turn the MemoryIntelligence API into eight verbs you already know: capture, ask, get, list, verify, explain, forget, and upload. Results come back as small typed objects, not raw envelopes. The wire format stays out of your way.
What you get back: a UMO
Every call returns a Unified Memory Object: your content, turned into meaning your agent can trust. Not raw text but the entities, relationships, topics, and tone inside it, sealed with a receipt verify() can check. That is why you can cite a memory, not just retrieve it. More on UMOs →
The eight verbs
The same surface in both languages. Each maps to one call against the public API.
| Method | What it does | Endpoint |
|---|---|---|
capture | Turn content into a structured memory | POST /v1/process |
ask | Find memories by meaning | POST /v1/memories/query |
get | Retrieve one memory by id | GET /v1/memories/{id} |
list | List your memories | GET /v1/memories |
verify | Prove a memory is real and unaltered | GET /v1/memories/{id}/proof |
explain | See what was extracted and why it matched | GET /v1/memories/{id}/explain |
forget | Delete a memory, with a receipt | DELETE /v1/memories/{id} |
upload | Capture a media file | POST /v1/upload |
MI_API_KEY from the environment via from_env() / fromEnv().Authenticate
Both clients read your key from MI_API_KEY. Grab one from the developer portal (free during beta), then set it once. Keep it server-side; it grants full account access.
MemoryIntelligence(api_key=...) in Python, or new MemoryIntelligence({ apiKey }) in JavaScript. Never hard-code a key in browser or committed code.Python
Requires Python 3.10 or newer. Depends on httpx alone. View on PyPI →
capture() returns a Memory (note.id, note.quality_score), ask() a list of Match (hit.score, hit.summary), verify() a Proof. Each keeps a .raw dict for any field we did not surface. Errors share one family: catch MIError, or the specific AuthenticationError, NotFoundError, or RateLimitError.JavaScript & TypeScript
ESM, runs in Node and edge runtimes, fully typed. View on npm →
fromEnv(); capture returns Memory, ask returns Match[], verify returns Proof. Errors extend SDKError. Every method returns a Promise. MI is a shorter alias for the same class.The rest of the verbs
Same pattern for the other five. Python shown; JavaScript is identical in camelCase.
mi.batch([...]) captures many in one call. One signature differs across languages: in Python mi.upload("meeting.mp3") takes a file path, but in JavaScript upload takes a Blob/File plus a filename — await mi.upload(fileBlob, "meeting.mp3").Handling errors
One exception family. Catch the base, or branch on the specific ones.
SDKError: AuthenticationError, RateLimitError, ValidationError, APIError.Prefer raw HTTP, or another language?
Every method above is a single call against the public REST API. See the API Reference for request and response shapes with any HTTP client, or give an assistant memory with the MCP server.