Knowledge Graph
GET
/v1/graphAccess your knowledge graph — the automatically extracted entities and relationships from your memories.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
entity | string | No | Filter by specific entity |
type | string | No | Filter by entity type (person, company, concept, etc.) |
depth | number | No | Relationship depth (default: 1, max: 3) |
limit | number | No | Max nodes to return (default: 50) |
How It Works
Hypersave automatically extracts entities and relationships from your saved content:
- Entities: People, companies, products, concepts, locations, etc.
- Relationships: How entities are connected (works at, mentions, relates to, etc.)
- Properties: Additional metadata about entities
Examples
Get Full Graph
curl https://api.hypersave.io/v1/graph \
-H "Authorization: Bearer YOUR_API_KEY"Filter by Entity Type
curl "https://api.hypersave.io/v1/graph?type=person&limit=20" \
-H "Authorization: Bearer YOUR_API_KEY"Explore Entity Relationships
Get all relationships for a specific entity:
curl "https://api.hypersave.io/v1/graph?entity=John%20Smith&depth=2" \
-H "Authorization: Bearer YOUR_API_KEY"Response
{
"success": true,
"nodes": [
{
"id": "entity_abc123",
"name": "John Smith",
"type": "person",
"properties": {
"title": "CEO",
"company": "Acme Corp"
},
"mentionCount": 15
},
{
"id": "entity_xyz789",
"name": "Acme Corp",
"type": "company",
"properties": {
"industry": "Technology"
},
"mentionCount": 23
},
{
"id": "entity_def456",
"name": "Product Launch",
"type": "event",
"properties": {
"date": "2024-03-15"
},
"mentionCount": 8
}
],
"edges": [
{
"source": "entity_abc123",
"target": "entity_xyz789",
"relationship": "CEO_OF",
"strength": 0.95
},
{
"source": "entity_abc123",
"target": "entity_def456",
"relationship": "INVOLVED_IN",
"strength": 0.78
}
],
"stats": {
"totalNodes": 156,
"totalEdges": 234,
"types": {
"person": 45,
"company": 23,
"concept": 67,
"event": 21
}
}
}Entity Types
| Type | Description | Examples |
|---|---|---|
person | Individual people | John Smith, Jane Doe |
company | Organizations | Acme Corp, Google |
product | Products or services | iPhone, AWS |
concept | Ideas or topics | Machine Learning, Marketing |
event | Events or meetings | Q4 Review, Launch Party |
location | Places | San Francisco, Building A |
date | Specific dates | January 15, Q1 2024 |
Relationship Types
| Relationship | Description |
|---|---|
WORKS_AT | Person works at company |
MENTIONS | Document mentions entity |
RELATED_TO | General relationship |
PART_OF | Hierarchical relationship |
INVOLVED_IN | Participation in event |
LOCATED_IN | Physical location |
The knowledge graph is automatically updated as you save new content. Entities and relationships are extracted using AI.
Error Responses
Invalid Entity Type
{
"success": false,
"error": "VALIDATION_ERROR",
"message": "Invalid entity type: unknown"
}Depth Too Large
{
"success": false,
"error": "VALIDATION_ERROR",
"message": "Depth cannot exceed 3"
}