Buraq
Guides›Build an AI Agent
Start
User guide · 4 steps · ~10 min

Build an AI agent that knows your business — and can act on it.

An AI Agent in Buraq is four pieces wired together: a Knowledge Base (what it knows), Functions (what it can do), a Prompt Builder config (how it behaves), and the AI Agent node inside a WhatsApp bot. This guide walks through all four — from creating the KB to deploying the bot live.

💡 Heads up: AI Studio lives behind the magic-wand icon in the sidebar. The Bot Builder is the network/branches icon.

The four pieces that make an AI Agent

You don't have to use all four — a Knowledge-Base-only agent works fine for Q&A. Functions are only needed when the agent has to do things (look up an order, hit an API). The Prompt Builder config glues everything together.

1 · Knowledge Base

URLs, text, and files — chunked and embedded so the agent can ground its answers.

2 · Functions (optional)

JavaScript or HTTP calls the agent can trigger when it needs to take action.

3 · Prompt Builder config

The persona + model + temperature + paths + which functions to expose.

4 · AI Agent node

Lives in the Bot Builder. Picks one Prompt Builder config + one Knowledge Base.

1
Step 1

Create a Knowledge Base

The Knowledge Base is what your agent knows. It's a collection of data sources — web pages, raw text, or files — that get chunked, embedded, and stored in a vector index. At answer time, the agent retrieves the most relevant chunks and grounds its reply in them.

1.1 Open Knowledge Base & create one

Dashboard → AI Studio → Knowledge Base

From the sidebar, hover the magic-wand AI Studio icon to reveal its sub-menu, then click Knowledge Base. You'll land on a list of your existing KBs.

Click the blue + Knowledge base button in the top-right — Buraq immediately creates a new "Untitled" KB and opens its detail page. The new KB starts empty; click + Add data source (center or top-right) to begin feeding it content.

!
Screenshots for this step are pending. The files 01-kb-list.jpg and 02-empty-kb.jpg came in as icons instead of the actual KB list and empty-KB screens — please re-upload them and I'll wire them in.
1.2 Add a data source

Three source types — URL, Text, or File

The Add data source modal opens with three cards. Pick whichever matches what you have:

  • URL — scan content from a domain or a list of URLs
  • Text — paste a text input directly
  • File — upload txt / pdf / docx (up to 5 MB)
Add data source · modal
Add data source modal with URL, Text, and File options
1.2a URL source — Domain

One root URL, automatic crawl

Give Buraq one root URL — it will crawl and ingest every page on that domain. Add an optional Exclude URL's list to skip pages you don't want, and set Refresh frequency to control how often Buraq re-crawls (default: Never).

Import URL(s) · Domain
Import URLs modal with Domain tab selected
1.2b URL source — Webpages

Paste a specific list of URLs

Switch to the Webpages tab to paste a list of specific URLs (one per line). Use this when you want only a subset of a domain, or pages from multiple domains.

Import URL(s) · Webpages
Import URLs modal with Webpages tab and URL list textarea
1.2c Text source

Paste short policies, FAQ snippets, anything copy-pasted

Import text · modal
Import text modal with content textarea
1.2d File source

Drag a .txt / .pdf / .docx in

Drag a file onto the dropzone or click to browse. Supported formats: .txt, .pdf, .docx. File size cap is 5 MB.

Import file(s) · modal
Import files modal with drag-and-drop area
1.3 — 1.4 Train & rename

Click train, then give the KB a descriptive name

Click train to ingest the source. Buraq crawls / parses / chunks the content, generates embeddings, and stores them. You can add multiple sources to the same KB.

Click the "Untitled" title on the KB detail page to rename it. Pick something descriptive ("Acme Returns Policy v2", "Riyadh Store Hours") so you can pick it cleanly from a dropdown later.

i
Training is async. Big domains can take a few minutes to finish crawling. The KB row in the list shows progress and a "feedback %" once it's live.
2
Step 2 · optional

Create a Function

Skip this step if your agent only needs to answer from the Knowledge Base.

Functions let the agent do things — look up an order by number, fetch the weather, post to Slack, ping any API. The agent decides at runtime whether to call a function, based on what the user asks.

2.1 Open Function Call

Dashboard → AI Studio → Function Call

The Functions screen lists every function in your workspace, with a search field and a + Create function button in the top-right.

app.buraq.ai/ai-studio/functions
Functions list with multiple existing functions and Create function button
2.2 Build the function

Two blocks: Prompt Instructions + Function Handler

The function editor has two main blocks:

  • Prompt Instructions — a short natural-language description of what this function does. Example: "Get the current weather in a given location." This is what the agent uses to decide when to call the function.
  • Function Handler — the actual implementation. Two tabs: JavaScript (write a body that returns a value, sync or via fetch; arguments come in as args.<name>) and HTTP Request (a visual form for METHOD + URL + Headers + Body).

Top-right has Beautify and Test Code actions, plus Save & Run function. Rename the function (top-left "Untitled") to something the agent can grok — get_weather, get_order_status, etc.

Function editor · JavaScript handler
Function editor with prompt instructions and JavaScript code area

Example — weather lookup in JavaScript:

const API_KEY = "<YOUR API KEY HERE>";
const url = `https://api.openweathermap.org/data/2.5/weather?q=${args.location}&appid=${API_KEY}`;

return fetch(url)
  .then((response) => response.json())
  .then((data) => {
    const kelvinTemp  = data.main.temp;
    const celsiusTemp = kelvinTemp - 273.15;
    return {
      location:    args.location,
      temperature: celsiusTemp.toFixed(2),
    };
  })
  .catch((error) => {
    // Always fail safe so the agent can still respond
    console.error("Error fetching weather data:", error);
    return {};
  });
3
Step 3

Create a Prompt Builder config

This is where the agent's personality and skills are defined. A Prompt Builder config bundles the system prompt, model, temperature, paths, and which functions to expose to the agent — into one named, reusable profile.

3.1 Open Prompt Builder

Dashboard → AI Studio → Prompt Builder

Three-pane layout:

  • Saved Configs (left) — every agent config in your workspace.
  • AI Prompt Builder (center) — a conversational designer. Type a natural description into the bottom input ("Customer support bot for e-commerce, handles returns and tracking"), and Buraq generates the System Prompt, Paths, and suggested Functions for you.
  • Config Preview (right) — the editable fields that make up the config.
app.buraq.ai/ai-studio/prompt-builder
Prompt Builder empty state with three-pane layout
3.2 A filled config

Example — Elixir Store Assistant

Here's what a finished config looks like — name, description, model, temperature, system prompt, and one path:

Prompt Builder · Elixir Store Assistant
Prompt Builder with Elixir Store Assistant config selected
FieldWhat it does
NameFriendly label — this is what appears in the AI Agent node dropdown.
DescriptionOne-liner shown in the picker.
ModelThe LLM to use — e.g. openai/gpt-4o.
Temperature0 = deterministic, 1 = creative. 0.2–0.5 is usually right for support agents.
System PromptThe agent's persona + top-level instructions.
Developer PromptHidden hints, formatting rules, escape hatches.
PathsNamed "intents" — the agent picks which path applies to each message.
FunctionsAttach the Function Call functions the agent is allowed to invoke.
3.3 Save

Click "Save Config" — bottom-right

The config now appears in the Saved Configs sidebar, and it's ready to be picked from the AI Agent node dropdown in Step 4.

4
Step 4

Wire it into a bot via the AI Agent node

Last step: open the Bot Builder and drop the AI Agent into a flow.

4.1 Add the AI Agent node

Dashboard → Bot Builder → open or create an inbound bot

On the workflow canvas, click a + handle on any existing node to open the Node Picker. Search for AI Agent (under the AI category — the red icon). Click to add it.

Bot Builder · canvas with AI Agent node
Bot workflow with Collect Input, GoogleSheets, and AI_agent nodes connected
4.2 Configure the node

Pick the config + pick the KB

Click the new node — a configuration panel slides in from the right. Six fields to set:

AI Agent · config panel
AI Agent node config panel with all fields shown
FieldWhat to set
Ai Agent dropdownThe Prompt Builder config you saved in Step 3.
Knowledge baseThe KB you built in Step 1. Required — even if you only use Functions.
ChunksHow many KB chunks to retrieve per question (1–10). Higher = more context, more tokens.
Answer sourceToggle ON to append the source URL / file to the reply.
Execute agent only onceON for one-shot agents — no follow-up turns.
Collect feedbackON by default — appends 👍 / 👎 buttons; powers the feedback % on the KB list.
4.3 — 4.4 Connect & deploy

Wire the edges, then Deploy

Connect the incoming edge from whatever node hands off to the agent — usually a Collect Input node so the user's message is what the agent answers. Connect the outgoing edge to whatever comes next (a Talk to Human fallback, a Send Message confirmation, or end of flow).

Click the top-right Deploy button to publish the workflow live.

Preview

What the customer sees on WhatsApp

Once deployed, this is how a conversation flows when a customer asks a question that hits your KB:

i
If Answer source is on, the reply ends with the source URL or filename. If Collect feedback is on (default), you get the 👍 / 👎 buttons shown above — these power the KB feedback %.
✓
Wrap up

Quick checklist & troubleshooting

Common problems

SymptomLikely cause / fix
Node shows "This field cannot be empty" in redKnowledge base not selected — required even if you only use Functions.
Agent replies "I don't know" to everythingKB sources still indexing, or the chunks slider is too low. Bump to 3–5 and retry.
Function never gets calledThe function's Prompt Instructions are too vague — rewrite them to be specific about when to call it.
Wrong tone / off-topic repliesSystem Prompt is too short. Add explicit do/don't rules in the Developer Prompt.
Answers feel genericLower Temperature toward 0.2 for factual, raise toward 0.8 for creative.
Re-training a Domain source didn't pick up new pagesRefresh frequency is "Never". Change it to Daily/Weekly, or trigger a manual re-train.

Agent live? Now make it smarter.

Watch the conversations in the Unified inbox. Where the agent stumbles, add a new Path or sharpen the System Prompt. Where it gets stuck, attach a Function so it can actually do the thing the customer is asking for.