Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 106 additions & 0 deletions docs/contracts/openapi-3.25.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,112 @@
"summary": " Snapshot"
}
},
"/snapshot/graph": {
"get": {
"description": "Focus view of the knowledge graph around one entity (1-hop star).\n\nPowers the brain-visual KG panel: the focal entity plus its direct\nneighbours, with edge ``confidence`` / ``status`` / ``contradicted`` /\n``stability`` (decay) / ``evidence_count`` so the panel can encode the\nsignals that make the KG richer than a plain link graph. Expand-on-click\nre-roots on a neighbour.\n\nQuery params: ``entity`` (UUID, required), ``project`` (required unless the\n``X-Project-Id`` header is set), ``limit`` (default 40, max 200). The\n``?project=`` query mirrors ``GET /snapshot`` so the dashboard can call it\nthe same way; API clients may use the ``X-Project-Id`` header instead.\nResponse: ``{root, nodes, edges, node_count, edge_count}``.",
"operationId": "_snapshot_graph_snapshot_graph_get",
"parameters": [
{
"$ref": "#/components/parameters/XProjectId"
},
{
"$ref": "#/components/parameters/XAgentId"
},
{
"$ref": "#/components/parameters/XTappsAgent"
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {}
}
},
"description": "Successful Response"
},
"401": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
},
"description": "Missing/malformed Authorization header."
},
"403": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
},
"description": "Invalid token."
}
},
"security": [
{
"bearerAuth": []
}
],
"summary": " Snapshot Graph"
}
},
"/snapshot/graph/health": {
"get": {
"description": "KG-graph health for a project: orphan entities, stale/superseded and\ncontradicted edge ratios \u2014 the graph rot the memory-store scorecard\n(freshness/staleness/GC) does not cover.\n\nQuery param ``project`` (or ``X-Project-Id`` header) required. Response:\n``{entities_active, orphan_entities, orphan_ratio, edges_*, stale_ratio,\ncontradicted_ratio, status, recommendations}``.",
"operationId": "_snapshot_graph_health_snapshot_graph_health_get",
"parameters": [
{
"$ref": "#/components/parameters/XProjectId"
},
{
"$ref": "#/components/parameters/XAgentId"
},
{
"$ref": "#/components/parameters/XTappsAgent"
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {}
}
},
"description": "Successful Response"
},
"401": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
},
"description": "Missing/malformed Authorization header."
},
"403": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
},
"description": "Invalid token."
}
},
"security": [
{
"bearerAuth": []
}
],
"summary": " Snapshot Graph Health"
}
},
"/v1/experience": {
"post": {
"description": "Record an experience event with optional KG side-effects.\n\nREST counterpart of the ``brain_record_event`` MCP tool. All writes\n(event row + optional memory + entity + edge + evidence) happen in one\nPostgres transaction.\n\nRequest headers:\n - ``X-Project-Id`` (required): project identifier.\n - ``X-Agent-Id`` (optional, default ``\"unknown\"``): agent identifier.\n\nRequest body (JSON):\n ``{ \"event_type\": str, \"subject_key\"?: str, \"utility_score\"?: float,\n \"payload\"?: dict, \"entities\"?: [EntitySpec], \"edges\"?: [EdgeSpec],\n \"evidence\"?: [EvidenceSpec], \"memory_key\"?: str,\n \"memory_value\"?: str, \"memory_tier\"?: str,\n \"session_id\"?: str, \"workflow_run_id\"?: str }``\n\nResponse: ``{ \"event_id\": str, \"memory_key\": str|null,\n\"entity_ids\": [str], \"edge_ids\": [str], \"evidence_ids\": [str] }``",
Expand Down
106 changes: 106 additions & 0 deletions docs/contracts/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,112 @@
"summary": " Snapshot"
}
},
"/snapshot/graph": {
"get": {
"description": "Focus view of the knowledge graph around one entity (1-hop star).\n\nPowers the brain-visual KG panel: the focal entity plus its direct\nneighbours, with edge ``confidence`` / ``status`` / ``contradicted`` /\n``stability`` (decay) / ``evidence_count`` so the panel can encode the\nsignals that make the KG richer than a plain link graph. Expand-on-click\nre-roots on a neighbour.\n\nQuery params: ``entity`` (UUID, required), ``project`` (required unless the\n``X-Project-Id`` header is set), ``limit`` (default 40, max 200). The\n``?project=`` query mirrors ``GET /snapshot`` so the dashboard can call it\nthe same way; API clients may use the ``X-Project-Id`` header instead.\nResponse: ``{root, nodes, edges, node_count, edge_count}``.",
"operationId": "_snapshot_graph_snapshot_graph_get",
"parameters": [
{
"$ref": "#/components/parameters/XProjectId"
},
{
"$ref": "#/components/parameters/XAgentId"
},
{
"$ref": "#/components/parameters/XTappsAgent"
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {}
}
},
"description": "Successful Response"
},
"401": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
},
"description": "Missing/malformed Authorization header."
},
"403": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
},
"description": "Invalid token."
}
},
"security": [
{
"bearerAuth": []
}
],
"summary": " Snapshot Graph"
}
},
"/snapshot/graph/health": {
"get": {
"description": "KG-graph health for a project: orphan entities, stale/superseded and\ncontradicted edge ratios \u2014 the graph rot the memory-store scorecard\n(freshness/staleness/GC) does not cover.\n\nQuery param ``project`` (or ``X-Project-Id`` header) required. Response:\n``{entities_active, orphan_entities, orphan_ratio, edges_*, stale_ratio,\ncontradicted_ratio, status, recommendations}``.",
"operationId": "_snapshot_graph_health_snapshot_graph_health_get",
"parameters": [
{
"$ref": "#/components/parameters/XProjectId"
},
{
"$ref": "#/components/parameters/XAgentId"
},
{
"$ref": "#/components/parameters/XTappsAgent"
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {}
}
},
"description": "Successful Response"
},
"401": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
},
"description": "Missing/malformed Authorization header."
},
"403": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
},
"description": "Invalid token."
}
},
"security": [
{
"bearerAuth": []
}
],
"summary": " Snapshot Graph Health"
}
},
"/v1/experience": {
"post": {
"description": "Record an experience event with optional KG side-effects.\n\nREST counterpart of the ``brain_record_event`` MCP tool. All writes\n(event row + optional memory + entity + edge + evidence) happen in one\nPostgres transaction.\n\nRequest headers:\n - ``X-Project-Id`` (required): project identifier.\n - ``X-Agent-Id`` (optional, default ``\"unknown\"``): agent identifier.\n\nRequest body (JSON):\n ``{ \"event_type\": str, \"subject_key\"?: str, \"utility_score\"?: float,\n \"payload\"?: dict, \"entities\"?: [EntitySpec], \"edges\"?: [EdgeSpec],\n \"evidence\"?: [EvidenceSpec], \"memory_key\"?: str,\n \"memory_value\"?: str, \"memory_tier\"?: str,\n \"session_id\"?: str, \"workflow_run_id\"?: str }``\n\nResponse: ``{ \"event_id\": str, \"memory_key\": str|null,\n\"entity_ids\": [str], \"edge_ids\": [str], \"evidence_ids\": [str] }``",
Expand Down
Loading
Loading