Text Graph Builder — Build Advanced AI Chatbots
What is a Text Graph?
A Text Graph in Langoedge is a programmatic AI agent workflow built on our custom graph execution engine (inspired by graph-based orchestration patterns like LangGraph). It accepts user input, executes logic through connected nodes, and generates a response — all powered by Large Language Models (LLMs).
Definition — Text Graph: A visual, node-based workflow where each node is an AI action (LLM call, API request, Python code) and each edge is a routing decision that determines the next step.
Key Concepts
Every graph is a collection of **Nodes** (actions) and **Edges** (routing logic) that operate on a shared **State** (memory).
How It Works
When you build a graph in the dashboard, Langoedge "compiles" your visual design into executable Python code behind the scenes.
Draw the Graph
JSON Compilation
State Machine Execution
Stream Results
Memory & State
Langoedge uses a structured memory system. Instead of one giant text blob, memory is divided into 15 fields (field1 through field15) plus summaries and file_contents.
The add_messages Reducer
To prevent overwriting history, Langoedge uses a custom "reducer" function. When a node returns data for a field, it is appended to the existing list rather than replacing it.
# Conceptual State Schema
state = {
"field1": [...], # Primary Chat History list
"field2": [...], # Secondary Storage list
"summaries": [...], # Thread summaries: condensed overviews of long conversations generated by summariser nodes to reduce token usage in long-running sessions
"file_contents": [...], # Uploaded document text: raw text extracted from files uploaded to the session (e.g., PDFs or DOCX), available for RAG and Python nodes
}
This means your AI agent remembers every message in the conversation — even after days of back-and-forth. The summaries and file_contents fields follow the same append-only reducer as field1–field15.
Node Types
Langoedge provides four node types for building sophisticated AI workflows.
Method Node
A standard LLM call. You provide a System Prompt, and the AI generates a response based on the input state. Use this for greeting, reasoning, summarizing, or drafting.
Retriever Tool (RAG)
Connects to vector databases to perform similarity searches against your uploaded documents. Perfect for FAQ bots and knowledge-base agents.
API Tool
Triggers external HTTP webhooks (REST APIs). Supports custom headers, authentication secrets, and JSON payloads. Connect to any service with an API.
Custom Python
Write raw Python code to transform data, run math, or implement custom logic using our protected AST evaluator. Use this when you need 100% deterministic results.
Logic & Routing (Edges)
Edges dictate where the conversation goes next. Langoedge supports three edge types.
1. Direct Edges
A simple connection from Node A to Node B. The flow proceeds in sequence.
2. Conditional Edges (Tool Conditions)
Logic-based routing. For example, a Tool Condition checks if the AI decided to use a tool. If yes, it routes to the Tool Node; otherwise, it finishes the conversation.
Use Case: "If the user asks about pricing, route to the Pricing Node. Otherwise, route to the General Q&A Node."
3. Quality Gates
A "Supervisor AI" evaluates the output of a node against specific rules. If the output fails (e.g., "be more polite"), the graph loops back for a retry. This is essential for compliance-critical workflows like legal emails or financial advice.
Text Graph Settings & Sidebar Configuration
When editing a text agent in the visual builder, the right-hand configuration panel allows you to configure essential settings (such as LLM models and core outputs) and optional settings (such as access control, secondary outputs, background execution, and memory persistence).
The settings are organized into three tabs: General, Flow, and Runtime.
Required Configurations
These settings must be configured for the chatbot/agent to function correctly and output data.
1. AI Engine (LLM Model Selection)
- Tab Location: General tab -> AI Engine
- Description: Select and configure the Large Language Model (LLM) that powers this agent (e.g., GPT-4o, GPT-4o-mini, Claude, or Gemini models) by clicking the Configure Model button. This model acts as the core reasoning engine for all LLM nodes in the workflow.
2. Final Destination (Target Node)
- Tab Location: Flow tab -> Final Destination
- Description: Specify which Node in the graph will generate the main response. The text graph executor will return the response from this specific target node back to the client application.
3. State Storage (Output Variable)
- Tab Location: Flow tab -> State Storage
- Description: Map the output of your final target node to one of the graph's State variables (such as
field1throughfield15). This determines where the final execution data is persisted in the shared conversation memory.
Optional Configurations
These settings can be adjusted to customize access control, data collection, and execution characteristics.
1. Access Control (Graph Protection Level)
- Tab Location: General tab -> Access Control
- Description: Define authorization permissions for who can view and execute your text agent:
- Public: Anyone with the link or embed code can interact with the chatbot.
- Protected: Restricted to specific authenticated or shared users.
- Private: Only the creator can access and run the agent.
2. Secondary Outputs
- Tab Location: Flow tab -> Secondary Outputs
- Description: Add supplementary outputs to capture intermediate results. You can map other nodes in your graph to specific state fields, allowing the application to extract and store auxiliary data (such as user emails, order details, or sentiment scores) during runtime execution.
3. Background Task (Execute in Background)
- Tab Location: Runtime tab -> Background Task
- Description: Toggle this setting to enable asynchronous execution. If enabled, long-running agent tool calls (such as waiting for slow API webhooks or external database writes) are decoupled from the initial client request, allowing the graph to finish processing in the background without causing HTTP client timeouts.
4. Memory Persistence (Checkpoint TTL)
- Tab Location: Runtime tab -> Memory Persistence
- Description: Specify a Time-to-Live (TTL) duration in seconds to dictate how long conversation history is kept. After this duration has passed since the last interaction, session thread state snapshots are automatically purged from the MongoDB checkpointer database to maintain security and clean up inactive sessions.
Advanced Features
Server-Sent Events (SSE)
Langoedge provides real-time token streaming. As the AI generates each token, it is pushed to the frontend instantly — no loading spinners, no timeouts. This provides a snappy, ChatGPT-like experience for your users.
API Secrets & Security
Store your API keys in the Langoedge Vault. Use the x-langoedge-secret header in your API Tools to authenticate requests without exposing keys to the LLM or the frontend.
Background Execution
Enable background mode for long-running agents. Your agent can say "I'll wait for your email" and actually wake up hours later when the email arrives — powered by persistent session checkpoints.
Example: Building a Refund Bot
Here's how you'd build an e-commerce refund bot:
- Check Order (LLM Node) — Extracts the order ID from the user's message.
- Process Refund (API Tool) — Calls your internal billing API with secure vault credentials.
- Confirm (LLM Node) — Formats a polite confirmation message.