Context
Get session context
Section titled “Get session context”POST /api/v1/contextContent-Type: application/jsonReturns ranked, contextually relevant nodes for a session. Designed for use at the start of a work session — surfaces what you already know about a subject before you start writing or coding.
Request body
Section titled “Request body”{ "topic": "knowledge graph architecture", "working_directory": "/Users/user/projects/loombrain", "limit": 20}| Field | Type | Required | Description |
|-------|------|----------|-------------|
| topic | string | Yes | The topic or question to retrieve context for |
| para_item_id | string | No | Explicit PARA item ID to scope results to |
| working_directory | string | No | File system path used for automatic PARA item detection |
| limit | number | No | Number of nodes to return (1–50, default 20) |
Response
Section titled “Response”{ "nodes": [ { "id": "node_123", "title": "Node title", "score": 15, "reasons": ["Primary tag", "Semantic match"] } ], "matched_para_item": { "id": "para_abc", "label": "LoomBrain v2", "category": "projects" }}matched_para_item is present only when a PARA item was resolved — either because para_item_id was supplied, or because auto-detection succeeded. It is null otherwise.
Auto-detection
Section titled “Auto-detection”When working_directory is provided and para_item_id is not, the endpoint attempts to infer the relevant PARA item from the path:
- Extracts the last directory component (e.g.,
loombrainfrom/Users/user/projects/loombrain). - Normalizes the name — lowercases, strips common TLDs, removes hyphens/underscores.
- Fuzzy-matches the normalized name against all active PARA item slugs and labels.
- If a match is found, scopes the context retrieval to that item automatically.
Graph health
Section titled “Graph health”GET /api/v1/graph-healthReturns knowledge graph statistics:
{ "total_nodes": 156, "validated_nodes": 120, "total_captures": 200, "pending_captures": 3, "total_links": 450, "stale_nodes": 12}Link suggestions
Section titled “Link suggestions”GET /api/v1/links/suggestions?text=your+search+text| Parameter | Type | Description |
|-----------|------|-------------|
| text | string | Text to find link suggestions for (max 10,000 chars) |
Returns suggested nodes that could be linked based on content similarity:
{ "suggestions": [ { "node_id": "abc123", "title": "Related concept", "score": 0.85 } ]}