knowledge
kg.find_entity
Find Entity in Knowledge Graph
Effects: read
Find an entity by name in the Knowledge Graph.
USE WHEN user mentions a person, project, company by name and you need:
- To resolve a name to entity_id for subsequent queries
- 'Кто работает над X?' → find X first
- 'Расскажи про Y' → find Y first
RETURNS entity_id for use in kg.get_relationships or kg.explore.
ALWAYS use this as the FIRST step in KG query chains.
Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
entity_type | string | no | Filter by entity type: - 'person': People, contacts - 'project': Projects, tasks - 'organization': Companies, teams - 'event': Meetings, deadlines - 'topic': Discussion topics - 'location': Places, addresses - 'document': Files, documents OMIT to include all entity types. (one of person, project, organization, event, topic, location, document) |
limit | integer | no | Maximum results to return (1-10). Default: 5 (default 5; min 1.0; max 10.0) |
name | string | yes | Entity name to search for. Can be in any language (Russian, English, etc.) - transliteration is automatic. |
kg.get_relationships
Get Entity Relationships
Effects: read
Get relationships for a specific entity from Knowledge Graph.
USE WHEN:
- 'Кто работает над X?' - filter by works_on
- 'С кем общался Y?' - filter by discussed_with
- 'Кто из компании Z?' - filter by member_of
- 'Что связано с W?' - no filter, get all
REQUIRES: entity_id from previous kg.find_entity step.
Use: {{step_N.entity_id}} where N is the find_entity step number.
Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
direction | string | no | Relationship direction: - 'outgoing': Entity → Others - 'incoming': Others → Entity - 'both': All relationships (default) (one of incoming, outgoing, both; default both) |
entity_id | string | yes | Entity ID from kg.find_entity step. Use {{step_N.entity_id}} reference. |
limit | integer | no | Maximum relationships to return (1-50). Default: 20 (default 20; min 1.0; max 50.0) |
relation_types | array | no | Filter by relationship types (optional): People: works_on, works_for, member_of, manages, knows, client_of, provides_service Communication: discussed_with, participated_in, mentioned_in Org/Project: developed_by, funded_by, partnered_with, integrates_with, depends_on, part_of Document: issued_by, issued_to, signed_by, authored_by Other: uses, located_in, about, follows, owns, related_to |
knowledge.query
Query Knowledge
Effects: read
Answer questions using knowledge base (uploaded documents, handbooks, files).
Use for QUESTIONS that need an answer synthesized from documents or messages.
Returns an evidence pack with source citations, KG entities, and extracted numbers.
Modes:
- 'auto' (default): Smart routing — works for most questions
- 'rag': Semantic search across documents & messages
- 'entity': Entity-centric queries (e.g., 'Tell me about [entity]')
- 'relationship': Two-entity queries (e.g., 'How is [entity A] related to [entity B]?')
Examples:
- 'What did we discuss about the budget?' → knowledge.query
- 'Tell me about [entity]' → knowledge.query mode=entity
- 'How is [A] related to [B]?' → knowledge.query mode=relationship
NOT for finding/listing files, threads, or links — use search.files / search.threads / search.links for that.
Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
date_from | string | no | Filter messages from this date (ISO format: YYYY-MM-DD). Use for time-based queries like 'this week', 'last month'. |
date_to | string | no | Filter messages until this date (ISO format: YYYY-MM-DD). |
file_ids | array | no | Specific file IDs to search within (for pinned files). Numeric ids, e.g. [502513]; numeric strings are accepted. |
include_relationships | boolean | no | Include KG relationships in answer (default: true for entity mode) (default True) |
max_sources | integer | no | Maximum number of sources to consider (1-10) (default 5; min 1.0; max 10.0) |
needs_aggregation | boolean | no | True if query asks for totals/sums/counts. |
question | string | yes | The question to answer from user's knowledge base. Required even for entity queries. (min 1.0) |
thread_id | string | no | Limit search to a specific thread/chat |