Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Contexts & Graphs

Context IDs and graph IDs scope knowledge within the wisdom graph, keeping related information grouped and isolated where needed.

Graph IDs

A graph is a top-level workspace. Each graph is fully isolated — knowledge in one graph cannot be retrieved from another.

Use separate graphs for:

  • Different projects
  • Different teams
  • Different agents
  • Production vs. staging environments

Pass graph_id when initializing the client or on each API call. The default value is "default".

Context IDs

Context IDs group related knowledge within a graph. They follow a type:name format:

skill:react_best_practices
session:20250319_ab3f
project:locusgraph_docs
task:onboarding_flow

The type prefix (before the colon) lets you query all contexts of a given type. For example, retrieve all skill: contexts to see everything the agent has learned across skills.

Format Rules

Context IDs are normalized automatically: lowercased, spaces replaced with underscores, truncated to 256 characters.

RuleDetail
Formattype:name
Valid charactersa-z, 0-9, _, -, :
Max length256 characters
CaseLowercased on admission
SpacesConverted to _

These are all valid:

skill:error_handling
session:2025-03-19_morning
project:my-api
user:preferences

These are invalid:

skill:React Best Practices   → normalized to skill:react_best_practices
MY_SKILL:Testing             → normalized to my_skill:testing

Context Types

The type prefix serves as a namespace. Common types:

TypeUse Case
skillLearned capabilities and best practices
sessionConversation or interaction boundaries
projectProject-scoped knowledge
taskTask-specific context
userPer-user preferences and history

You can create any type — these are conventions, not enforced categories.

Scoping in Practice

When storing an event, pass context_id to attach it to a context:

{
  "event_kind": "fact",
  "source": "agent",
  "context_id": "skill:react_best_practices",
  "payload": { "topic": "hooks", "value": "prefer useReducer for complex state" }
}

When retrieving, filter by context to narrow results:

{
  "query": "state management",
  "context_id": "skill:react_best_practices",
  "limit": 10
}

Next

Memory Links
Connect loci with typed relationships.
MCP Overview
Use LocusGraph with the Model Context Protocol.