title: Trace Agent API version: 1.0 date: 2026-10-24 author: Core Team status: Active
Manage face traces, temporal knowledge graphs, and trace-related operations.
Trace Agent API provides endpoints for: - Trace Management: List, query, and analyze face traces - Face Retrieval: Get faces from traces, representative faces - Thumbnails: Generate and retrieve trace thumbnails - TKG Operations: Build, query, and manage Temporal Knowledge Graphs - Co-occurrence: Analyze identity co-occurrence in videos
POST /api/v1/file/:file_uuid/tracesAuth: Required
Scope: file-level
List all traces for a file, sorted by various criteria.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
file_uuid |
string | Yes | — | File UUID (path parameter) |
# List traces for a file
curl -s -X POST "$API/api/v1/file/$FILE_UUID/traces" \
-H "X-API-Key: $KEY" \
-H "Content-Type: application/json" \
-d '{}'
{
"traces": [
{
"trace_id": 1,
"face_count": 50,
"first_frame": 100,
"last_frame": 1500,
"identity_uuid": "a9a90105-..."
}
]
}
GET /api/v1/file/:file_uuid/trace/:trace_id/facesAuth: Required
Scope: file-level
Get all faces for a specific trace.
| Field | Type | Required | Description |
|---|---|---|---|
file_uuid |
string | Yes | File UUID |
trace_id |
number | Yes | Trace ID |
# Get faces for trace 1
curl -s "$API/api/v1/file/$FILE_UUID/trace/1/faces" \
-H "X-API-Key: $KEY"
GET /api/v1/file/:file_uuid/trace/:trace_id/representative-faceAuth: Required
Scope: file-level
Get the representative (best quality) face for a trace.
# Get representative face
curl -s "$API/api/v1/file/$FILE_UUID/trace/1/representative-face" \
-H "X-API-Key: $KEY"
GET /api/v1/file/:file_uuid/trace/:trace_id/thumbnailAuth: Required
Scope: file-level
Get thumbnail for a trace.
# Get trace thumbnail
curl -s "$API/api/v1/file/$FILE_UUID/trace/1/thumbnail" \
-H "X-API-Key: $KEY"
GET /api/v1/file/:file_uuid/stranger/:stranger_id/representative-faceAuth: Required
Scope: file-level
Get representative face for a stranger (unidentified person).
# Get stranger representative face
curl -s "$API/api/v1/file/$FILE_UUID/stranger/1/representative-face" \
-H "X-API-Key: $KEY"
GET /api/v1/file/:file_uuid/stranger/:stranger_id/thumbnailAuth: Required
Scope: file-level
Get thumbnail for a stranger.
# Get stranger thumbnail
curl -s "$API/api/v1/file/$FILE_UUID/stranger/1/thumbnail" \
-H "X-API-Key: $KEY"
GET /api/v1/file/:file_uuid/identities/:identity_uuid_a/co-occur-with/:identity_uuid_bAuth: Required
Scope: file-level
Get co-occurrence information between two identities in a file.
| Field | Type | Required | Description |
|---|---|---|---|
file_uuid |
string | Yes | File UUID |
identity_uuid_a |
string | Yes | First identity UUID |
identity_uuid_b |
string | Yes | Second identity UUID |
# Check co-occurrence
curl -s "$API/api/v1/file/$FILE_UUID/identities/$IDENTITY_UUID_A/co-occur-with/$IDENTITY_UUID_B" \
-H "X-API-Key: $KEY"
POST /api/v1/file/:file_uuid/tkg/rebuildAuth: Required
Scope: file-level
Rebuild Temporal Knowledge Graph for a file.
# Rebuild TKG
curl -s -X POST "$API/api/v1/file/$FILE_UUID/tkg/rebuild" \
-H "X-API-Key: $KEY"
GET /api/v1/file/:file_uuid/tkgAuth: Required
Scope: file-level
Get TKG operations for a file.
# Get TKG operations
curl -s "$API/api/v1/file/$FILE_UUID/tkg" \
-H "X-API-Key: $KEY"
DELETE /api/v1/file/:file_uuid/tkgAuth: Required
Scope: file-level
Delete TKG for a file.
# Delete TKG
curl -s -X DELETE "$API/api/v1/file/$FILE_UUID/tkg" \
-H "X-API-Key: $KEY"
POST /api/v1/file/:file_uuid/rule2Auth: Required
Scope: file-level
Ingest Rule 2 for TKG.
# Ingest Rule 2
curl -s -X POST "$API/api/v1/file/$FILE_UUID/rule2" \
-H "X-API-Key: $KEY" \
-H "Content-Type: application/json" \
-d '{}'
GET /api/v1/file/:file_uuid/representative-frameAuth: Required
Scope: file-level
Get representative frame for a file.
# Get representative frame
curl -s "$API/api/v1/file/$FILE_UUID/representative-frame" \
-H "X-API-Key: $KEY"
POST /api/v1/file/:file_uuid/tkg/nodesAuth: Required
Scope: file-level
Query TKG nodes.
# Query TKG nodes
curl -s -X POST "$API/api/v1/file/$FILE_UUID/tkg/nodes" \
-H "X-API-Key: $KEY" \
-H "Content-Type: application/json" \
-d '{}'
POST /api/v1/file/:file_uuid/tkg/edgesAuth: Required
Scope: file-level
Query TKG edges.
# Query TKG edges
curl -s -X POST "$API/api/v1/file/$FILE_UUID/tkg/edges" \
-H "X-API-Key: $KEY" \
-H "Content-Type: application/json" \
-d '{}'
File: /Users/accusys/momentry_core/src/api/trace_agent_api.rs (2918 lines)
Data Structures:
- Trace - Face trace object
- Face - Single face detection
- TKG - Temporal Knowledge Graph
- Stranger - Unidentified person
Database Tables:
- face_detections - Face detection records
- traces - Trace metadata
- tkg_nodes - TKG nodes
- tkg_edges - TKG edges
Symptoms: 404 error when accessing trace
Solution: Check if trace exists in database or re-process the file
Symptoms: TKG rebuild returns error
Solution: Check file processing status and logs
| Version | Date | Changes |
|---|---|---|
| 1.0 | 2026-10-24 | Initial documentation (summary) |
Note: This is a summary documentation. Full endpoint details require additional work.