build_knowledge
Store multiple facts and relations in a single batch call
Store multiple entity facts and relations in a single call, reducing round-trips compared to separate remember_fact and relate_entities calls. Facts are processed first (creating entities as needed), then relations are created between them.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
facts | array | OPTIONAL | [] | Facts to store (max 50) |
facts[].entityName | string | REQUIRED | - | Entity name (1-200 chars) |
facts[].entityType | enum | REQUIRED | - | Type: person, concept, project, preference, fact, location, organization |
facts[].observation | string | REQUIRED | - | Fact to remember (1-2000 chars) |
facts[].source | enum | OPTIONAL | conversation | Source: conversation, note, document, manual |
relations | array | OPTIONAL | [] | Relations to create (max 50) |
relations[].fromEntity | string | REQUIRED | - | Source entity name |
relations[].relation | string | REQUIRED | - | Relationship type (1-100 chars) |
relations[].toEntity | string | REQUIRED | - | Target entity name |
relations[].fromEntityType | enum | OPTIONAL | - | Type of source entity |
relations[].toEntityType | enum | OPTIONAL | - | Type of target entity |
Example Request
Response
Compact Mode (Default)
When COMPACT_RESPONSES=true (default):
Verbose Mode
When COMPACT_RESPONSES=false:
Use Cases
Building a project knowledge graph
Recording meeting notes
Relations only
Duplicate Detection
Facts that are semantically similar to existing observations on the same entity are detected as duplicates and not stored again. The response includes a count of duplicates.
Errors
| Error | Cause | Fix |
|---|---|---|
| No facts or relations provided | Both arrays empty or missing | Provide at least one fact or relation |
| Embedding service not configured | Missing OPENAI_API_KEY or Ollama config | Set OPENAI_API_KEY or configure OLLAMA_BASE_URL |
| Database not configured | Missing Supabase credentials | Set SUPABASE_URL and SUPABASE_SERVICE_KEY |
| Memory not enabled | ENABLE_MEMORY feature flag is false | Set ENABLE_MEMORY=true |
| Array exceeds max size | More than 50 facts or 50 relations | Split into multiple calls |
Related Tools
remember_fact- Store a single fact (usebuild_knowledgefor batch operations)relate_entities- Create a single relation (usebuild_knowledgefor batch operations)query_memory- Search memories (mode="search") or get entity context (mode="entity")