kg
Manage and query an entity-relationship knowledge graph for structured facts. Search modes include hybrid, semantic, and keyword to discover relationships between concepts, tools, and patterns.
Instructions
Entity-relationship graph for structured facts. Use for entities with relationships - concepts, tools, people, patterns. Check here before semantic_search. For free-form text/learnings, use memory instead. Hybrid search (70% semantic + 30% keyword). Limits: 10K entities, 100 obs/entity. Audit log for destructive ops. Actions: create_entities, create_relations, add_observations, delete_entities, delete_relations, search, neighbors, stats, read, prune, remove_observation, update_entity, rename_entity, merge_entities, batch. IMPORTANT: Always specify entity_type when creating entities - omitting it defaults to 'unknown' which pollutes the graph. Knowledge graph is stored as JSONL.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | Search mode: hybrid (default, 70% semantic + 30% keyword), semantic (embeddings only), keyword (substring only) | |
| depth | No | ||
| limit | No | ||
| names | No | ||
| query | No | ||
| action | Yes | ||
| target | No | Entity to merge into (will be kept) | |
| dry_run | No | Prune: if true, just report candidates (default true) | |
| updates | No | Fields to update: entity_type, description, aliases, parent_type | |
| entities | No | ||
| new_name | No | New entity name for rename_entity | |
| old_name | No | Current entity name for rename_entity | |
| relations | No | ||
| operations | No | List of operations for batch action. Each op needs 'op' key: {op: 'add_observations', entity_name: 'X', observations: [...]}, {op: 'create_relations', relations: [{from, to, relation_type}]}, {op: 'create_entities', entities: [...]}, {op: 'delete_entities', names: [...]} | |
| preprocess | No | Expand synonyms in search query (default True) | |
| entity_name | No | ||
| observation | No | Single observation text for remove_observation | |
| max_age_days | No | Prune: only entities older than this (default 30) | |
| observations | No | ||
| source_entity | No | Entity to merge from (will be deleted) | |
| min_similarity | No | Minimum semantic similarity threshold (default 0.25) | |
| min_connections | No | Prune: only entities with <= this many connections (default 0) |