API Reference
Knowledge Graph

Knowledge Graph

GET

/v1/graph

Access your knowledge graph — the automatically extracted entities and relationships from your memories.

Query Parameters

ParameterTypeRequiredDescription
entitystringNoFilter by specific entity
typestringNoFilter by entity type (person, company, concept, etc.)
depthnumberNoRelationship depth (default: 1, max: 3)
limitnumberNoMax 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

TypeDescriptionExamples
personIndividual peopleJohn Smith, Jane Doe
companyOrganizationsAcme Corp, Google
productProducts or servicesiPhone, AWS
conceptIdeas or topicsMachine Learning, Marketing
eventEvents or meetingsQ4 Review, Launch Party
locationPlacesSan Francisco, Building A
dateSpecific datesJanuary 15, Q1 2024

Relationship Types

RelationshipDescription
WORKS_ATPerson works at company
MENTIONSDocument mentions entity
RELATED_TOGeneral relationship
PART_OFHierarchical relationship
INVOLVED_INParticipation in event
LOCATED_INPhysical 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"
}