Knowledge Graph
Build temporal, provenance-linked knowledge with entities, relationships, current truth, and retained history. Query what was valid at a point in time without losing superseded eras.
Availability by operation
The plan catalog includes Knowledge Graph from Starter. Basic graph reads are also available on lower tiers where the deployment's read gate permits them (default: Free). Manual graph writes, deletion and inference require Pro or higher. These are different capabilities, not one universal graph tier. Check the live error and plan catalog for your operation.
01. Key Concepts
- Entities. Named objects like people, companies, concepts, or topics extracted from your data.
- Relationships. Typed connections between entities like "works_at", "mentions", "related_to", with validity and recorded-time provenance.
- Traversal. Query across relationships to discover multi-hop connections and patterns at the current time or a supplied timestamp.
02. Automatic Entity Extraction
When you add memories or documents, Hebbrix automatically:
- Extracts named entities (people, organizations, locations, concepts)
- Creates relationships with source-memory and temporal provenance
- Links entities to source memories for provenance tracking
- Merges duplicate entities
03. Endpoints
04. Code Examples
Explore Entities
Python
import requests
# GET /v1/knowledge-graph/entities: list entities with their inline
# relationships already attached (capped at 25 per entity).
r = requests.get(
"https://api.hebbrix.com/v1/knowledge-graph/entities",
headers={"Authorization": "Bearer <your-api-key>"},
params={"entity_type": "PERSON", "limit": 20},
)
data = r.json()
for entity in data["entities"]:
rels = entity.get("relationships", [])
print(f"{entity['name']} ({entity['type']}): {len(rels)} relationships")
for rel in rels:
arrow = "-->" if rel["direction"] == "outgoing" else "<--"
print(f" {arrow} {rel['target']} [{rel['type']}]")Inspect a Single Entity
Python (Entity Details)
import requests
# GET /v1/knowledge-graph/entities/{entity_name}
# The path accepts the stable entity_id returned by create, or a legacy name.
# The response bundles relationships and the memory_ids that mention the entity.
r = requests.get(
"https://api.hebbrix.com/v1/knowledge-graph/entities/Acme%20Corp",
headers={"Authorization": "Bearer <your-api-key>"},
)
body = r.json()
print(body["details"]) # raw entity row from Neo4j
print(body["relationships"]) # full relationship list (no cap)
print(body["source_memories"]) # list of memory_ids that mention itCreate a Relationship
Python (Relationships)
import requests
# POST /v1/knowledge-graph/relationships: use the short field names
# (source / target / type). The legacy long names
# (source_entity / target_entity / relationship_type) are still accepted.
r = requests.post(
"https://api.hebbrix.com/v1/knowledge-graph/relationships",
headers={"Authorization": "Bearer <your-api-key>"},
json={
"source": "John Doe",
"target": "Acme Corp",
"type": "WORKS_AT",
},
)
print(r.json()) # {"status": "created", "relationship": {...}}05. cURL Example
POST
/v1/knowledge-graph/querycurl -X POST "https://api.hebbrix.com/v1/knowledge-graph/query" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"timestamp": "2026-03-30T00:00:00",
"relation_type": "MENTIONS",
"collection_id": "col_abc123",
"limit": 10
}'06. Common Entity Types
personorganizationlocationconceptobjecteventtimetoolother