Skip to main content
Mem[v] automatically builds knowledge graphs from your content, connecting entities through relationships and enabling graph-aware semantic search for AI agents.

What is a Knowledge Graph?

A knowledge graph is a network of entities and relationships automatically extracted from memories: From memories:
  • “Sarah Chen is the CTO at Acme Corp”
  • “Acme Corp uses Kubernetes for deployments”
Graph representation:
Sarah Chen → role → CTO
Sarah Chen → works_at → Acme Corp
Acme Corp → uses → Kubernetes

Triplet structure

Knowledge is stored as Subject → Predicate → Object:
User → prefers → Dark mode
Database → runs_on → PostgreSQL
API → authenticates_via → JWT tokens
Team → uses → GitHub Actions

Automatic entity extraction

Mem[v] identifies and extracts:
  • People: Names, roles, relationships
  • Organizations: Companies, teams, departments
  • Technologies: Tools, frameworks, platforms
  • Locations: Cities, offices, regions
  • Topics: Concepts, subjects, categories
When you search, results include connected entities: Query: “Sarah Chen” Returns:
  • Direct memories about Sarah
  • Her role (CTO)
  • Company (Acme Corp)
  • Technologies she uses (Kubernetes)
  • Teams she manages
  • Projects she leads

Common use cases

Team knowledge

# Find who knows about a technology
results = client.graph.query(
    space_id="company",
    entity="Kubernetes",
    relationship="expert_in"
)

for triplet in results.triplets:
    print(f"{triplet.subject}{triplet.predicate}{triplet.object}")

Product dependencies

Map system architecture:
Frontend App
├── depends_on → Backend API
│   ├── depends_on → PostgreSQL
│   └── depends_on → Redis
└── uses → React
    └── requires → Node.js

Customer insights

Understand customer relationships:
Acme Corp
├── uses → Enterprise Plan
├── located_in → San Francisco
├── contact → Sarah Chen
│   └── role → VP Engineering
└── industry → Technology

Automatic graph building

Graphs build automatically as you add memories:
client.memories.add(
    space_id="space_123",
    content="Sarah Chen is the CTO at Acme Corp and specializes in cloud architecture"
)

# Graph automatically contains:
# Sarah Chen → works_at → Acme Corp
# Sarah Chen → role → CTO
# Sarah Chen → specializes_in → Cloud Architecture

Query the graph

# Get all relationships for an entity
results = client.graph.query(
    space_id="space_123",
    entity="Sarah Chen"
)

for triplet in results.triplets:
    print(f"{triplet.subject} {triplet.predicate} {triplet.object}")

Cross-content graphs

Graphs connect information across all content types: Video: “Sarah is leading the Kubernetes migration” → Sarah Chen → leads → Kubernetes Migration PDF: “Kubernetes migration depends on new infrastructure” → Kubernetes Migration → depends_on → New Infrastructure Chat: “New infrastructure will use AWS EKS” → New Infrastructure → uses → AWS EKS Combined graph:
Sarah Chen
└── leads → Kubernetes Migration
    └── depends_on → New Infrastructure
        └── uses → AWS EKS

Relationship types

Automatically detected relationships:
  • Professional: works_at, reports_to, manages, collaborates_with
  • Technical: uses, depends_on, integrates_with, built_with
  • Conceptual: related_to, part_of, category_of, type_of
  • Temporal: preceded_by, followed_by, during, after
  • Preference: prefers, likes, requires

Best practices

  • Include rich context in memories for better entity extraction
  • Use consistent entity names across content
  • Add structured metadata for clearer relationships
  • Leverage graph queries to enrich AI context

Privacy and isolation

Knowledge graphs respect Space boundaries:
  • Each Space has an independent graph
  • Entities never connect across spaces
  • Ensures data privacy and separation

Next steps

Memories

Add memories to build graphs

Search

Graph-aware semantic search

SDK: Graph

Query knowledge graphs