Documentation Index
Fetch the complete documentation index at: https://docs.memoclaw.com/llms.txt
Use this file to discover all available pages before exploring further.
Price: FREE
Relations let you create explicit links between memories. Use them to build knowledge graphs, track contradictions, or group related facts.
Relation Types
| Type | Description |
|---|
related_to | General relationship between related memories |
derived_from | Memory was derived/synthesized from another (e.g. consolidation) |
contradicts | Memories that conflict (useful for tracking corrections) |
supersedes | New memory replaces old one |
supports | Memory provides supporting evidence for another |
POST /v1/memories/:id/relations
Create a relationship from one memory to another.
Path Parameters
Request Body
Target memory UUID to link to.
One of: related_to, derived_from, contradicts, supersedes, supports.
Optional metadata for the relationship.
Example
curl -X POST https://api.memoclaw.com/v1/memories/550e8400-e29b-41d4-a716-446655440001/relations \
-H "Content-Type: application/json" \
-d '{
"target_id": "550e8400-e29b-41d4-a716-446655440002",
"relation_type": "supersedes",
"metadata": {
"reason": "User corrected their timezone preference"
}
}'
{
"id": "rel-123e4567-e89b-12d3-a456-426614174000",
"source_id": "550e8400-e29b-41d4-a716-446655440001",
"target_id": "550e8400-e29b-41d4-a716-446655440002",
"relation_type": "supersedes",
"metadata": {
"reason": "User corrected their timezone preference"
},
"created_at": "2024-02-11T10:45:00Z"
}
GET /v1/memories/:id/relations
List all relationships for a memory (both incoming and outgoing).
Path Parameters
Example
curl https://api.memoclaw.com/v1/memories/550e8400-e29b-41d4-a716-446655440001/relations
{
"relations": [
{
"id": "rel-123e4567-e89b-12d3-a456-426614174000",
"source_id": "550e8400-e29b-41d4-a716-446655440001",
"target_id": "550e8400-e29b-41d4-a716-446655440002",
"relation_type": "supersedes",
"direction": "outgoing",
"created_at": "2024-02-11T10:45:00Z"
},
{
"id": "rel-223e4567-e89b-12d3-a456-426614174001",
"source_id": "550e8400-e29b-41d4-a716-446655440005",
"target_id": "550e8400-e29b-41d4-a716-446655440001",
"relation_type": "supports",
"direction": "incoming",
"created_at": "2024-02-10T08:30:00Z"
}
]
}
DELETE /v1/memories/:id/relations/:relationId
Remove a relationship.
Path Parameters
Example
curl -X DELETE https://api.memoclaw.com/v1/memories/550e8400-e29b-41d4-a716-446655440001/relations/rel-123e4567-e89b-12d3-a456-426614174000