API
Store and query memory over HTTP from your own code.
Everything the app does goes through the same HTTP API, at https://api.trellismem.com/api/v1/. This page covers the three calls most integrations need.
Authentication
Send an API key in the X-Api-Key header. Create keys on the API keys page of the app.
export TRELLISMEM_API_URL="https://api.trellismem.com"
export TRELLISMEM_API_KEY="your-api-key"
A key acts as the person who created it. It reaches the datasets that person can read or write, and no others.
Recall
Ask a question. trellismem picks a search strategy, runs it over the datasets you can read, and returns the answer.
curl -X POST "$TRELLISMEM_API_URL/api/v1/recall" \
-H "X-Api-Key: $TRELLISMEM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "What did we promise Acme about the renewal?"}'
| Field | Meaning |
|---|---|
query |
The question. Required. |
datasets |
Dataset names to search. Leave out to search everything you can read. |
searchType |
Pin a strategy, for example GRAPH_COMPLETION or CHUNKS. Leave out to let trellismem choose. |
Naming the dataset is faster and more precise when you know where the answer lives:
curl -X POST "$TRELLISMEM_API_URL/api/v1/recall" \
-H "X-Api-Key: $TRELLISMEM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "Who owns the billing service?", "datasets": ["engineering"]}'
Remember
Add knowledge. This call takes form data, so it can carry files.
Upload a file into a dataset:
curl -X POST "$TRELLISMEM_API_URL/api/v1/remember" \
-H "X-Api-Key: $TRELLISMEM_API_KEY" \
-F "[email protected]" \
-F "datasetName=engineering"
Or send text directly:
curl -X POST "$TRELLISMEM_API_URL/api/v1/remember" \
-H "X-Api-Key: $TRELLISMEM_API_KEY" \
-F "raw_data=The billing service is owned by the payments team." \
-F "datasetName=engineering"
| Field | Meaning |
|---|---|
data |
One or more files. Repeat the field for several. |
raw_data |
Text to remember, or a web address to fetch. Repeat the field for several. |
datasetName |
The dataset to add to. It is created if it does not exist. |
node_set |
A category for everything in this call. Repeat the field for several. |
Forget
Remove a dataset and everything in it:
curl -X POST "$TRELLISMEM_API_URL/api/v1/forget" \
-H "X-Api-Key: $TRELLISMEM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"dataset": "engineering"}'
Add dataId next to the dataset to remove a single document from it. Deleting cannot be undone.
Field names
JSON bodies accept both camelCase and snake_case field names.
Full reference
The complete OpenAPI schema is at https://api.trellismem.com/openapi.json. Load it into any OpenAPI viewer or client generator to see every route and field.