
Overview
The Ask graph question block queries one or more Writer Knowledge Graphs to find relevant information and generate answers based on the stored data. Use it to create AI applications that can reference and retrieve information from your uploaded documents and structured data. You can specify the question, the list of Knowledge Graphs to search, whether to use streaming or subqueries, and a state variable to store the answer in. The block searches through the Knowledge Graphs and returns a relevant response.Common use cases
- Building question-answering systems based on company documents
- Creating AI assistants that reference specific knowledge bases
- Creating compliance verification tools that check against policy documents
- Building research assistants that analyze academic papers or reports
How it works
- Question: Enter the natural language question you want to ask about the stored data.
- Graph Ids: Specify one or more Knowledge Graphs to query from a list of available Graphs.
- Link Variable: The name of the variable that stores the answer in the agent’s state.
- Use streaming: Choose whether to stream the answer as it is generated. If you choose
yes
, the answer will be streamed to the UI as it is generated. If you chooseno
, the answer will be generated and then returned to the agent once it is complete. - Use subqueries: Enable to allow the LLM to ask follow-up questions to the Knowledge Graph for improved answers.
Examples
Employee policy assistant
This example shows a complete workflow where employees can ask questions about company policies and receive accurate, up-to-date information. Interface:- Text input → Employee submits a question and the text input stores it in a state variable called
question
- Button → Employee clicks a button to submit the question to the agent
- Text → Employee sees the answer stored in the
policy_answer
state variable in a text block
- UI Trigger → Employee submits policy question through form
- Ask graph question → Searches company knowledge base
- Text generation → Formats the answer for the employee with additional context
- Set state → Stores response for display
- Graph Ids:
["Company Policies", "Employee Handbook"]
- Question:
@{question}
(set from a text input in the UI) - Link Variable:
policy_answer
- Use streaming:
yes
- Use subqueries:
yes

Fields
Name | Type | Control | Default | Description | Options | Validation |
---|---|---|---|---|---|---|
Question | Text | - | - | The natural language question to ask. | - | - |
Use streaming | Boolean | - | yes | - | - | - |
Link Variable | Binding | - | - | Set the variable here and use it across your agent. | - | - |
Graph Ids | Graph Ids | - | [] | IDs of the graphs to query. | - | - |
Use subqueries | Boolean | - | yes | Enables LLM to ask follow-up questions to the knowledge graph. This improves answers, but may be slower. | - | - |
End states
Below are the possible end states of the block call.Name | Field | Type | Description |
---|---|---|---|
Success | - | success | Successfully streamed the answer. |
Error | - | error | If the function raises an Exception. |
Link Variable
field. Access the output by referencing the state variable you defined, or use the @{result}
variable in the next block.