Skip to main content

Knowledge Graph

Memsolus automatically extracts entities — people, organizations, places, and concepts — from your memories and maps the relationships between them. The result is a navigable Knowledge Graph that lets you explore connections, not just search for text.

What Is the Knowledge Graph?

Every time a memory is processed, Memsolus identifies named entities mentioned in the content and records how they relate to each other. Over time, as more memories accumulate, the graph grows richer with connections.

For example, if a user mentions "I work with Jane at Acme Corp on the backend team," the graph records:

  • Entity: Jane (type: Person)
  • Entity: Acme Corp (type: Organization)
  • Relationship: Jane WORKS_AT Acme Corp

Entity Types

TypeExamples
PERSONColleagues, contacts, public figures
ORGANIZATIONCompanies, teams, institutions
PLACECities, offices, countries
THINGTools, frameworks, products, concepts

What You Can Do With the Graph

Search for entities

Find entities related to a topic or name:

const entities = await client.graph.search({
query: 'backend framework',
userId: 'user_123',
});
curl "https://api.memsolus.com/v1/knowledge/graph/entities?query=backend+framework&user_id=user_123" \
-H "X-Api-Key: msk_live_..."

Get an entity and its relationships

const entity = await client.graph.getEntity('ent_abc123');

console.log(entity.relationships);
// [
// { type: 'WORKS_WITH', target: { name: 'Jane', type: 'PERSON' }, weight: 0.9 },
// { type: 'USED_BY', target: { name: 'Acme Corp', type: 'ORGANIZATION' }, weight: 0.7 }
// ]

Traverse the graph

Walk the graph from a starting entity to discover connected nodes:

const connections = await client.graph.traverse({
entityId: 'ent_abc123',
depth: 2,
});

Ask a natural language question

const answer = await client.graph.query({
query: 'Who does the user work with at Acme Corp?',
userId: 'user_123',
});

console.log(answer.text);
// "The user works with Jane and Carlos at Acme Corp."
console.log(answer.entities);
// [{ name: 'Jane', type: 'PERSON' }, { name: 'Carlos', type: 'PERSON' }]

Relationships

Each relationship between two entities has:

FieldDescription
typeThe kind of relationship (e.g., WORKS_WITH, USES, MANAGES)
weightConfidence score from 0 to 1 — higher means stronger evidence
descriptionOptional human-readable description of the relationship

Relationship weights are updated as more memories reinforce or weaken the connection.


Use Cases

  • Understand who a user works with — query the graph for professional relationships
  • Discover what tools a user uses — find entity connections between users and tools
  • Enrich conversation context — attach relevant graph context before starting an AI session
  • Audit what the system knows — explore entities and relationships for a given user