Skip to content

Connections API

Base URL: http://localhost:4545/api/v1

Connections are the typed edges in Remem’s relationship graph. Auto-discovery creates related_to edges automatically whenever a memory is stored (comparing the new embedding against existing memories, above auto_discovery_threshold). Use this API to create, list, traverse, and delete connections explicitly, with any of the 8 supported relationship types.

All endpoints below require auth once REMEM_API_KEY is set — see Authentication.

POST /connections
{
"source_id": "mem_abc",
"target_id": "mem_def",
"relationship_type": "caused_by",
"strength": 0.8
}
FieldTypeDefaultNotes
source_idUUIDrequired
target_idUUIDrequired
relationship_typestringrelated_toone of related_to, caused_by, part_of, references, contradicts, supports, similar_to, derived_from
strengthfloat 0–1none

Response: 200 OK

{
"source_id": "mem_abc",
"connection": {
"target_id": "mem_def",
"relationship_type": "caused_by",
"strength": 0.8,
"created_at": "2026-07-01T12:00:00Z"
}
}
GET /connections?limit=50&offset=0

limit defaults to 50, max 500. offset defaults to 0.

Response: 200 OK

{
"connections": [
{
"source_id": "mem_abc",
"connection": {
"target_id": "mem_def",
"relationship_type": "caused_by",
"strength": 0.8,
"created_at": "2026-07-01T12:00:00Z"
}
}
],
"total": 1,
"limit": 50,
"offset": 0
}
GET /memories/{id}/related?depth=1&relationship_types=&limit=20

Walks the connection graph outward from a given memory.

Query paramDefaultNotes
depth1max 5
limit20max 100
relationship_typesnonecomma-separated filter, e.g. caused_by,supports

Response: 200 OK

{
"memory_id": "mem_abc",
"related": [
{
"memory": { "id": "mem_def", "content": "..." },
"connection": {
"target_id": "mem_def",
"relationship_type": "caused_by",
"strength": 0.8,
"created_at": "2026-07-01T12:00:00Z"
}
}
]
}
Terminal window
curl "http://localhost:4545/api/v1/memories/mem_abc/related?depth=2" \
-H "Authorization: Bearer $REMEM_API_KEY"
DELETE /connections/{source_id}/{target_id}

Response: 200 OK, or 404 Not Found if the connection doesn’t exist.