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.gaps_answer
Answer Knowledge Gap
Effects: write
Answer a question from knowledge.gaps_list. Your title and answer are published as a knowledge article the asking agents will find next time; nothing is sent to the customer. Answering again replaces the previous answer.
Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
answer | string | yes | The answer text (max 4000 characters), published with the title |
gap_id | integer | yes | Gap id |
question | string | yes | The article title, in your own words (max 200 characters). It is published to the knowledge base the agents read, so do not copy the customer's wording from knowledge.gaps_list. |
knowledge.gaps_list
List Knowledge Gaps
Effects: read
List the questions agents could not answer from the knowledge base, merged by meaning and ordered by how often they were asked. Answer one with knowledge.gaps_answer.
Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
agent_id | integer | no | Only gaps this agent ran into |
limit | integer | no | 1-200, default 20 (default 20) |
status | string | no | open (default), answered or dismissed (default open) |
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). Only ids returned by files.search or listed in the [ATTACHMENTS] block of THIS run; an id you have not seen in this workspace matches nothing and the search comes back empty. Leave it out to search the agent's collections. Numeric ids; 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 |