You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(api): support bulk memory associations (#198)
## Summary
- Add backwards-compatible batch support to POST /associate via an
associations array capped at 500 items
- Batch-write valid associations with FalkorDB UNWIND grouped by
relationship type and return per-index partial-success results
- Update the MCP bridge, tests, and docs for bulk associate_memories
behavior
Closes#196.
## Tests
- make test
- make lint
- source .venv/bin/activate && black --check automem/api/memory.py
tests/support/fake_graph.py tests/test_api_endpoints.py
- npm test --prefix mcp-sse-server
## API / Config
- Existing single-association request/response shape remains supported
- Batch responses return 201 when all items succeed and 207 when any
item fails
- No config changes
- Batch requests return `201` when every item succeeds and `207` when one or more items fail validation or reference missing memories.
45
48
-`type` accepts only the 11 authorable semantic relationship types. System-generated labels such as `SIMILAR_TO`, `PRECEDED_BY`, and `DISCOVERED` are readable/filterable but cannot be created via this endpoint.
Copy file name to clipboardExpand all lines: docs/MCP_SSE.md
+27-1Lines changed: 27 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -155,7 +155,33 @@ The MCP bridge exposes these MCP tools:
155
155
156
156
## Recall Ordering
157
157
158
-
`associate_memories` accepts only the 11 authorable semantic relationship types. Auto-generated labels such as `SIMILAR_TO`, `PRECEDED_BY`, and `DISCOVERED` remain readable on recall surfaces but are not exposed as authoring choices in the MCP schema.
158
+
`associate_memories` accepts either a single association:
159
+
160
+
```json
161
+
{
162
+
"memory1_id": "...",
163
+
"memory2_id": "...",
164
+
"type": "RELATES_TO",
165
+
"strength": 0.9
166
+
}
167
+
```
168
+
169
+
or a batch of up to 500 associations:
170
+
171
+
```json
172
+
{
173
+
"associations": [
174
+
{
175
+
"memory1_id": "...",
176
+
"memory2_id": "...",
177
+
"type": "RELATES_TO",
178
+
"strength": 0.9
179
+
}
180
+
]
181
+
}
182
+
```
183
+
184
+
Batch calls return a concise summary and item-indexed failures when only some associations succeed. `associate_memories` accepts only the 11 authorable semantic relationship types. Auto-generated labels such as `SIMILAR_TO`, `PRECEDED_BY`, and `DISCOVERED` remain readable on recall surfaces but are not exposed as authoring choices in the MCP schema.
159
185
160
186
`recall_memory` defaults to relevance ranking (`sort: "score"`). For chronological recaps (e.g. “what happened since X”), set:
0 commit comments