Skip to main content

Building Chatflows in Calabi AI Builder

Enterprise

Calabi AI Builder is a visual, low-code environment for constructing LLM-powered conversational applications. A chatflow is a directed graph of nodes that defines how a user's message moves through language models, memory stores, and data retrieval steps to produce a response. This page covers the canvas, every node type, how to connect nodes, and how to deploy a finished chatflow as a production API endpoint.


Canvas Overview

When you open a chatflow in Calabi AI Builder, you see the canvas — a drag-and-drop workspace where nodes are connected by edges representing the data flow.

UI ElementDescription
CanvasThe main workspace. Pan by holding Space+drag. Zoom with Ctrl+Scroll.
Node PaletteLeft panel. Contains all available node types organized by category.
Configuration DrawerRight panel. Appears when a node is selected; shows all editable fields.
Chat PanelBottom panel. Opens a test chat interface to interact with the chatflow live.
ToolbarTop bar. Contains Save, Clear, Import/Export JSON, and the API Endpoint button.
Run PreviewDisplays intermediate outputs at each node during a test chat, for debugging.

Node Types

LLM Nodes

LLM nodes are the reasoning core of a chatflow. They take a formatted prompt and return a generated response.

NodeModel FamiliesDescription
ChatOpenAIGPT-4o, GPT-4 Turbo, GPT-3.5OpenAI chat completion models with streaming support.
ChatAnthropicClaude 3.5 Sonnet, Claude 3 OpusAnthropic Claude models, strong at long-context tasks.
Chat (Local Models)Llama 3, Mistral, Phi-3, GemmaLocal models served by Calabi Local Models within the cluster.
ChatBedrockClaude on Bedrock, Titan, LlamaAWS Bedrock-hosted models for customers with Bedrock access.
ChatAzureOpenAIGPT-4o on AzureAzure OpenAI Service endpoint for enterprise Azure customers.

Key LLM node settings:

SettingDescription
TemperatureControls randomness (0 = deterministic, 1 = creative). Default: 0.7
Max TokensMaximum tokens in the response.
System PromptInstructions prepended to every conversation.
StreamingEnable token-by-token streaming for real-time UI updates.
Top PNucleus sampling parameter. Default: 1.

Memory Nodes

Memory nodes give the chatflow access to conversation history, enabling multi-turn interactions.

NodeStorage BackendDescription
Buffer MemoryIn-process (ephemeral)Stores the full conversation history in memory. Resets on service restart.
Buffer Window MemoryIn-processStores only the last N message pairs (configurable window).
Redis MemoryRedisPersists conversation history in Redis, keyed by session ID. Survives restarts.
Postgres MemorydatabaseStores conversation history in the Calabi metadata database.
Zep MemoryZep serverLong-term memory with automatic summarization of older messages.
Motorhead MemoryMotorheadAPI-based managed memory service.

Best practice: Use Redis Memory for production chatflows — it survives pod restarts and supports horizontal scaling of the AI Builder service.

Tool Nodes

Tool nodes extend the LLM with specific capabilities. The LLM can choose to "call" a tool when it determines the user's question requires it.

NodeDescription
Calabi Catalogue ToolAllows the LLM to search Calabi Catalogue for asset metadata.
CalabiIQ SQL ToolAllows the LLM to execute SQL queries against the data warehouse.
CalculatorPerforms arithmetic operations (useful when the LLM would otherwise hallucinate calculations).
Web BrowserFetches and summarizes content from URLs.
Serper SearchPerforms Google web searches via the Serper API.
HTTP Request ToolCalls a custom REST API with LLM-generated parameters.
Custom ToolDefine your own tool with a name, description, and function schema; the LLM decides when to call it.

Data Retrieval Nodes (RAG)

Data retrieval nodes connect the chatflow to external documents and databases for Retrieval Augmented Generation (RAG).

NodeDescription
Vector Store RetrieverQueries a vector store with a similarity search and returns the top-K chunks.
Document StoreManages a collection of indexed documents (backed by a vector store).
Conversational Retrieval QAA complete RAG chain: retrieves context, injects it into the prompt, and generates an answer.

Prompt Nodes

Prompt nodes format the input to the LLM, combining the user's message with retrieved context and system instructions.

NodeDescription
Chat Prompt TemplateA template with {input} and {context} placeholders that structures the LLM input.
Prompt TemplateA simpler single-string template for non-chat completion models.

Utility Nodes

NodeDescription
LLM ChainCombines a Prompt Template + LLM into a single step.
Conversational ChainAn LLM Chain with built-in memory.
Text SplitterSplits large documents into chunks for embedding. Multiple strategies: recursive character, token-based, markdown-aware.
Output ParserParses the LLM's output into a structured format (JSON, list, custom schema).

Connecting Nodes

Every node has input handles (on the left) and output handles (on the right). The handle label indicates the expected data type (e.g., LLM, Memory, VectorStore, Document).

  1. Hover over an output handle to see its type.
  2. Click and drag from the output handle to a compatible input handle on another node.
  3. Compatible handles are highlighted in green; incompatible ones are greyed out.
  4. Release to create the connection.

Type enforcement: Calabi AI Builder enforces type compatibility — you cannot connect a Memory node's output directly to an LLM node's input handle; it must go to the memory handle.


Sample RAG Chatflow

The following diagram shows a complete Retrieval Augmented Generation chatflow that answers questions about company HR policies.

Node-by-node explanation:

  1. PDF Loader — Loads hr_policy.pdf from the document store. Runs only during the indexing phase.
  2. Text Splitter — Splits the PDF into 1,000-character chunks with 200-character overlap to preserve context across chunk boundaries.
  3. OpenAI Embeddings — Converts each chunk into a 1,536-dimension embedding vector using text-embedding-3-small.
  4. Postgres Vector Store — Stores chunks and their vectors in the Calabi metadata database via the pgvector extension.
  5. Vector Store Retriever — At query time, embeds the user's question and retrieves the 4 most similar chunks.
  6. Chat Prompt Template — Formats the prompt with the retrieved chunks as {context} and the user's message as {input}.
  7. ChatOpenAI — Generates the final answer using GPT-4o at low temperature (0.2) for factual consistency.
  8. Redis Memory — Maintains conversation history so follow-up questions reference prior answers.
  9. Response — Streamed back to the user.

Connecting to Data Sources

Calabi AI Builder can pull documents from multiple sources for indexing:

SourceNodeSupported Formats
Local file uploadDocument StorePDF, DOCX, TXT, CSV, XLSX
S3 bucketS3 File LoaderPDF, TXT, CSV, DOCX
Web URLWeb Scraper LoaderHTML pages
Calabi CatalogueCatalogue Document LoaderAsset descriptions, glossary terms
NotionNotion LoaderNotion pages and databases
ConfluenceConfluence LoaderConfluence spaces and pages

Testing a Chatflow

  1. After connecting all nodes, click Save in the toolbar.
  2. Click Test Chatflow — the Chat Panel opens at the bottom of the screen.
  3. Type a test message and press Enter.
  4. The response streams in. Click any node in the canvas to inspect its intermediate input/output for that message.
  5. Use the Session ID field in the Chat Panel to simulate different users by entering different IDs.

The test panel shows:

  • The user message
  • Retrieved document chunks (for RAG chatflows)
  • The formatted prompt sent to the LLM
  • Token usage (input tokens, output tokens, cost estimate)
  • Response time

Deploying as an API Endpoint

Once your chatflow is tested and ready:

  1. Click API Endpoint in the top toolbar.
  2. Copy the endpoint URL:
    https://<your-calabi-domain>/api/v1/prediction/<chatflow-id>
  3. Obtain an API key: SettingsAPI Keys+ Create API Key.
  4. Make requests using the following format:
curl -X POST \
"https://<your-calabi-domain>/api/v1/prediction/<chatflow-id>" \
-H "Authorization: Bearer <your-api-key>" \
-H "Content-Type: application/json" \
-d '{
"question": "What is the maternity leave policy?",
"overrideConfig": {
"sessionId": "user-456"
}
}'

Response format:

{
"text": "The maternity leave policy provides 16 weeks of fully paid leave...",
"sourceDocuments": [
{
"pageContent": "Section 4.2 — Maternity Leave...",
"metadata": { "source": "hr_policy.pdf", "page": 12 }
}
]
}

The sourceDocuments array includes the document chunks used to generate the answer — essential for RAG transparency and auditability.