technical_docs_qa.json
Overview
This JSON file defines a Document Question-and-Answer (QA) system based on a connected knowledge base, primarily designed for Customer Support scenarios. The system receives user queries and retrieves relevant document content to provide accurate and verifiable answers.
The core purpose is to enable users to ask technical or product-related questions and get precise responses drawn strictly from the connected documentation repository, avoiding AI hallucinations or unsupported content generation.
Detailed Explanation
High-Level Structure
The file contains a structured representation of the QA system as a graph of components, along with configuration parameters, prompts, and global variables.
Key sections:
Metadata: General info about the system (id, title, description, canvas_type).
DSL (Domain-Specific Language): Defines components, their parameters, connections (workflow graph), global variables, and history.
Avatar: Base64-encoded image representing the system visually.
Components
The system workflow is composed of three main components:
Component Name | Role | Description |
|---|---|---|
Begin | Workflow entry point | Initiates the QA process |
Agent:StalePandasDream | Docs QA Agent - core processing agent | Processes user queries using LLM and retrieval tools to generate answers |
Message:BrownPugsStick | Message output component | Outputs the agent's response to the user |
Component Details
1. Begin
Type:
BeginPurpose: Entry node to start the workflow.
Parameters: None.
Upstream: None (start node).
Downstream: Connects to
Agent:StalePandasDream.
2. Agent:StalePandasDream (Docs QA Agent)
Type:
AgentDescription: Core component that handles user queries by leveraging a large language model (LLM) and a Retrieval tool to search a technical documentation knowledge base.
Purpose:
Analyze user input.
Retrieve relevant document sections based on query similarity.
Generate accurate and source-transparent answers.
Key Parameters:
Parameter | Description |
|---|---|
Specifies the language model: "deepseek-chat@DeepSeek" | |
Up to 3 retry attempts on errors | |
| Limits conversation rounds to 5 |
Maximum token length for responses: 256 | |
Retains last 12 messages in history | |
| Controls randomness in LLM output: 0.1 (low randomness) |
Penalty to reduce repetition: 0.7 | |
Penalty encouraging new topics: 0.4 | |
User prompt template: "The user query is {sys.query}" | |
System prompt defining the agent's behavior, constraints, and response guidelines | |
Integrates a | |
| Contains output content string |
System Prompt Highlights:
Role: Docs QA Agent restricted to knowledge base content.
Principles: No hallucinations, transparency about sources, accuracy priority.
Response style: Quote documentation, cite sources, admit when info unavailable.
Response format: Markdown with clear "Answer" section.
Tools Used:
Retrieval Tool:
Searches technical document knowledge bases.
Parameters include keyword similarity weight (0.7), similarity threshold (0.2), top_k (1024), top_n (8).
Does not use knowledge graph (
use_kg: false).Returns formalized_content string for agent use.
Upstream:
beginDownstream:
Message:BrownPugsStick
3. Message:BrownPugsStick
Type:
MessagePurpose: Outputs the content generated by the Docs QA Agent to the user.
Parameters:
content: Populated dynamically from the agent's output ({Agent:StalePandasDream@content}).
Upstream:
Agent:StalePandasDreamDownstream: None (terminal output node)
Globals
Variable | Purpose | Initial Value |
|---|---|---|
| Tracks the number of conversation turns | 0 |
Stores attached files or documents (empty list) | [] | |
Current user query string | "" | |
ID of the current user | "" |
Workflow Description
Begin: The workflow is triggered by a user query.
Docs QA Agent: Receives the query, uses the deepseek-chat LLM combined with the
Retrievaltool to:Search the connected knowledge base for relevant document content.
Generate an answer strictly based on retrieved documents.
Follow strict guidelines to avoid hallucination and ensure accuracy.
Message Component: Displays the agent's answer back to the user.
Implementation Details and Algorithms
Retrieval-Based Q&A:
The agent employs a retrieval-augmented generation approach.
The Retrieval tool scores knowledge base documents using keyword similarity (weight 0.7).
Top relevant documents (up to 8) with similarity above 0.2 are fetched.
The LLM generates answers constrained by the system prompt to avoid fabrications.
Prompt Engineering:
The system prompt explicitly instructs the agent on behavior and response formatting to enforce strict reliance on the knowledge base.
Error Handling:
The agent has parameters like max_retries and delay_after_error to handle transient issues gracefully.
Conversation Management:
Maintains limited message history (window size 12) and conversation rounds (max 5) to balance context and performance.
Interaction With Other System Parts
Knowledge Base: The system depends on an external technical documentation knowledge base connected via the Retrieval tool.
User Interface: The
Messagecomponent outputs the agent's responses, intended to be rendered in a chat or support interface.Language Model Service: Uses the deepseek-chat@DeepSeek LLM backend for natural language understanding and answer generation.
Global Variables: Coordinates conversation state and user context across the session.
Usage Examples
Example User Query and Response Flow
User Input: "How do I reset my device to factory settings?"
Process:
The query is set in sys.query.
Beginnode triggers the agent.The agent calls the Retrieval tool to search for "reset device factory settings."
Relevant document snippets are retrieved.
The LLM generates an answer quoting the documentation, e.g.:
## Answer
According to the documentation, to reset your device to factory settings, navigate to Settings > System > Reset Options and select "Erase all data (factory reset)".
Please ensure you back up your data before proceeding.
The Message component outputs this text to the user interface.
If no relevant information is found, the agent responds with:
## Answer
I cannot find this information in the current knowledge base. You might want to ask about device setup or troubleshooting steps.
Visual Diagram
flowchart TD
Begin[Begin Node]
Agent[Docs QA Agent<br/><sub>(Agent:StalePandasDream)</sub>]
Retrieval[Retrieval Tool<br/><sub>Knowledge Base Search</sub>]
Message[Message Output<br/><sub>(Message:BrownPugsStick)</sub>]
Begin --> Agent
Agent --> Retrieval
Agent --> Message
Begin triggers the Agent.
Agent queries the Retrieval Tool for relevant documents.
Agent composes answer based on retrieval results.
Message outputs the final response.
Summary
technical_docs_qa.json configures a knowledge-base-driven document Q&A system.
The core processing is done by the Docs QA Agent using an LLM and a Retrieval tool.
It strictly adheres to retrieved document content to ensure trustworthy answers.
The workflow is linear and optimized for customer support use cases.
The system is designed for accuracy, transparency, and avoidance of AI hallucinations.
Outputs are user-facing messages directly derived from knowledge base content.
This detailed documentation should help developers, system integrators, and support engineers understand and maintain the Document QA system encoded in this file.