Use casesWorks with
Call Context Engine's memory from your own code
Your own code reaches Context Engine over plain HTTP: make a key under Connect an AI tool, Your own code, then POST JSON to /tool/<name> on app.contextengine.com with the key as a bearer token, for example /tool/write to save a memory and /tool/find to search.
What it does
Scripts, back-end jobs and agents you build yourself can use the same memory as your team and its AI tools. There is no SDK to install and no special protocol: each action is one address, a JSON body in and a JSON answer out.
Make the first call
- In the app, open AI tools, then Connect an AI tool, and choose Your own code. Pick its engines, each at Can read or Can read and save.
- Press Create my key. The key is shown once, inside first calls in curl, Python and TypeScript. Copy it then: only a hash is stored.
- Put the key in an environment variable, such as
CE_KEY, where your code runs. - Run the first call it shows. It sends
POST https://app.contextengine.com/tool/writewith the headerAuthorization: Bearer $CE_KEYand a JSON body naming the engine, the type and a title; the example saves a decision with its reason. It saves a memory, and both status steps turn green. A note needs less:{"engine": "acme", "type": "note", "title": "First note"}.
Read and search
POST /tool/find with {"q": "what did we decide about the release"} searches by meaning across every engine the key reaches; add "engine" to ask one. Each result names its engine. POST /tool/get opens one memory by its ref.
Rules worth knowing
Every write names its engine. A decision needs a rationale in fields, and a meeting needs occurred_at and attendees; POST /tool/describe lists every type’s fields. A title already used in that engine is refused, so edit the existing memory with /tool/edit instead. Pass an idem value to make a retry safe: the same value never writes twice.
Taking access away
Each key is listed on AI tools. Revoke it and anything still using it gets a 401 from then on, while every other key keeps working.
Questions
Which key should my code use?
A key of its own. A personal key acts as you and reaches the engines you choose. An engine key belongs to one engine and what it writes shows as Engine key. Either can be revoked on its own, which the engine's original API key cannot: replacing that one stops every script using it.
What can my code call with a key?
find, get, activity, write, edit, describe, help and brief, each as POST /tool/<name> with the arguments as the request body. https://app.contextengine.com/openapi.json has their exact arguments, and the same tools are reachable over MCP at /mcp.
Can my code create engines too?
Yes, with an account key. The /account/mcp/<action> paths list, create, stop and start engines, invite people and make a narrow key for one engine. They take an account key, not an engine key.