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_flowThe 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.
| Rule | Detail |
|---|---|
| Format | type:name |
| Valid characters | a-z, 0-9, _, -, : |
| Max length | 256 characters |
| Case | Lowercased on admission |
| Spaces | Converted to _ |
These are all valid:
skill:error_handling
session:2025-03-19_morning
project:my-api
user:preferencesThese are invalid:
skill:React Best Practices → normalized to skill:react_best_practices
MY_SKILL:Testing → normalized to my_skill:testingContext Types
The type prefix serves as a namespace. Common types:
| Type | Use Case |
|---|---|
skill | Learned capabilities and best practices |
session | Conversation or interaction boundaries |
project | Project-scoped knowledge |
task | Task-specific context |
user | Per-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
}