choose_your_knowledge_base_agent.json


Overview

The choose_your_knowledge_base_agent.json file defines a conversational agent workflow designed to enable users to select a knowledge base from a dropdown menu and then query that knowledge base exclusively to generate responses. This file is structured as a DSL (Domain-Specific Language) JSON specification for an "Agent" canvas type, describing components, their parameters, interactions, and flow in a knowledge retrieval system.

The primary purpose is to provide an interactive agent that retrieves information strictly from a user-selected knowledge base, ensuring accurate, transparent, and rapid answers without content fabrication or inference beyond the documented materials.


Detailed Explanation

Top-Level Structure


Components

The core functionality is implemented as interconnected components in the dsl.components section.

1. Begin Component (begin)


2. Agent Component (Agent:BraveParksJoke)


3. Message Component (Message:HotMelonsObey)


4. Tool Component (Tool:TangyWolvesDream)


Globals

These globals provide shared context for components and are referenced in prompts and processing.


Graph Structure and Workflow

The graph defines nodes and their connections, representing workflow order:

The user starts in begin, selects knowledge base, submits a query → Agent processes with retrieval → Message outputs the answer.


Important Implementation Details


Interaction with Other System Parts


Usage Scenario

  1. User accesses the agent interface.

  2. The agent prompts with "Hi! I'm your retrieval assistant. What do you want to ask?" and a dropdown to select a knowledge base.

  3. User selects a knowledge base (e.g., "knowledge base 1") and enters a question.

  4. The Agent component receives the query, invokes the Retrieval tool to fetch documents from the selected knowledge base.

  5. Agent generates a response strictly based on retrieved content.

  6. The Message component displays the answer to the user.


Visual Diagram

flowchart TD
    Begin["Begin\n- Dropdown: Knowledge Base\n- Prologue Greeting"]
    Agent["Agent:BraveParksJoke\n- Receives query & knowledge base\n- Runs Retrieval Tool\n- Enforces strict QA rules"]
    Tool["Tool:TangyWolvesDream\n- Auxiliary task/tool (optional)"]
    Message["Message:HotMelonsObey\n- Displays Agent's response"]

    Begin --> Agent
    Agent --> Tool
    Agent --> Message

Summary

The choose_your_knowledge_base_agent.json file defines a specialized conversational agent workflow that ensures users select a knowledge base explicitly and receive answers generated solely from that knowledge base’s documents. It uses a retrieval-augmented language model approach with strict system prompt rules to prioritize accuracy, transparency, and rapid responses without hallucination. The workflow is modular, allowing clear extension points and integration with existing knowledge base infrastructure and language models.