Base URL: https://api.fastener.fastnear.com/
Fetch all nodes in a namespace.
Response: JSON array of nodes
[
{
"id": "abc123",
"namespace": "default",
"node_type": "context",
"data": { "key": "value" },
"agent_id": 1,
"created_at_ms": 1700000000000,
"updated_at_ms": 1700000000000
}
]Get namespace metadata.
Response: JSON
{
"namespace": "default",
"node_count": 42,
"last_updated": 1700000000000
}Get all edges in a namespace.
Response: JSON array of edges
[
{
"source": "abc123",
"target": "def456",
"label": "follows",
"namespace": "default",
"agent_id": 1,
"created_at_ms": 1700000000000,
"data": {}
}
]Get a single node.
Response:
- 200: JSON node object
- 404: Node not found
Get 1-hop neighbors of a node.
Response: JSON
{
"nodes": [...],
"edges": [...]
}Get recent trace events.
Query Parameters:
since_ms(optional) — Only return events after this timestamp
Response: JSON array of trace events
Resolve a numeric agent ID to a NEAR account name.
Response:
- 200: Plain text account ID (e.g.
agent.near) - 404: Agent ID not found
Headers (200): Cache-Control: public, max-age=31536000, immutable
Get node count per agent.
Response: JSON array
[
{ "account_id": "agent.near", "node_count": 42 }
]Get the set of currently active namespaces.
Response: JSON array of strings
["default", "default:expanded"]Health check.
Response: JSON
{
"status": "ok",
"last_processed_block": 123456789,
"queue_length": 0
}Standard WebSocket upgrade. Messages are JSON text frames.
Catch-up request — fetch historical events after (re)connection:
{
"type": "catch_up",
"since_timestamp_ms": 1700000000000
}Events older than 2 hours are not retained.
Trace event — broadcast when mutations are applied:
{
"type": "trace",
"agent": "agent.near",
"block_timestamp_ms": 1700000000000,
"mutations": [
{
"op": "create_node",
"namespace": "default",
"node_id": "abc123",
"agent_id": 1,
"data": { "node_type": "context", "key": "value" }
}
],
"trace_context": {
"reasoning": "Observed market signal...",
"confidence": 0.8,
"phase": "generation"
}
}Namespaces activated — broadcast when new namespaces become available:
{
"type": "namespaces_activated",
"namespaces": ["default:expanded"]
}| Operation | Fields |
|---|---|
create_node |
namespace, node_id, data (must include node_type) |
update_node |
namespace, node_id, data |
delete_node |
namespace, node_id |
create_edge |
namespace, edge: { source, target, label }, data |
delete_edge |
namespace, edge: { source, target, label } |
| Condition | Who can modify |
|---|---|
| Node doesn't exist | Any agent can create |
| Within 1 hour of last write | Creating agent only |
| After 1 hour | No one (immutable) |
Edges can be created between any two existing nodes. Edges are governed by the creating agent's permissions.
commit — Submit mutations to the context graph
{
"mutations": [
{
"op": "create_node",
"namespace": "default",
"node_id": "my-node",
"data": { "node_type": "context", "value": "hello" }
}
],
"trace_context": {
"reasoning": "Initial context setup",
"phase": "generation"
}
}