All docs

Guide · AI agents

Build your first AI agent

An AI (generative) agent answers your customers in its own words, using your documents and a few rules you set. This guide builds one from start to finish: a knowledge base, the six-step setup, a good system prompt, testing, and going live.

  • Plan every plan
  • Time about 20 minutes
  • Code none needed

1What you're building

A generative agent uses an AI model to read each message and write a reply. It suits open questions you can’t script in advance: “Do you fix carbon frames?”, “Can I bring my bike in on Saturday?”, “What’s the difference between your two service plans?”

The example is a support assistant for Lumen Bike Repair, a made-up repair shop. It answers from the shop’s price list and FAQ, stays on the subject of the shop, and passes the visitor to a person when they ask for one.

Four things decide how good it is

Knowledge base

Your documents: price lists, FAQs, policies. The agent searches them for every question and answers from what it finds.

System prompt

Standing instructions: who the agent is, what it helps with, how it should sound, and what it must never do.

Model

The AI that writes the replies. Every model in the list works well for support; faster ones reply sooner.

Testing

Chat with it yourself before customers do. Most fixes are a sentence added to the prompt or a document added to the knowledge base.

Good to know

Replies are written by AI, so an agent can occasionally get something wrong. A knowledge base, Stay in scope and Only answer from this knowledge base keep it close to your own facts. For tasks that must follow an exact approved script, like payments or account changes, build a flow agent instead.

2Prepare your knowledge (optional, recommended)

You can skip this and add documents later, but agents answer much better with them. Gather two or three documents first: a price list, an FAQ, your opening hours and contact details.

  1. Open Knowledge Bases in the sidebar and click New knowledge base.
  2. Give it a name, for example Lumen help centre, and create it.
  3. Drop your files into the upload area. It takes PDF, DOCX, TXT and MD files of up to 25 MB each. To use your website instead, click Add from a URL instead: add one page with Add URL, or a whole site with Crawl site.
  4. Wait until each document shows as ready. Flexaura reads it and splits it into searchable pieces.
Tip

Short, plain documents beat long ones. A one-page “Prices and turnaround times” answers price questions far more reliably than a 40-page brochure.

3Create the agent

Click + New agent in the dashboard, choose Generative (“AI writes every reply”), then Create generative agent. A six-step wizard opens. Use Back and Next at the bottom to move between steps. You can also start from Templates in the sidebar, which opens the same wizard with a template already picked.

Basics: give it an identity

  1. Agent name (required): what your team sees in the dashboard, for example Lumen support.
  2. Persona name: the name customers see in the chat, for example Lumen Bike Repair. Leave it blank to use the agent name.
  3. Description: a note for your team about what this agent does.
  4. Avatar: upload a PNG, JPEG, WebP or GIF of up to 5 MB, or pick a colour.

4Write a good system prompt

The prompt is where most of an agent’s quality comes from. A good one is short and specific, and covers four things: who the agent is, what it helps with, how it sounds, and its limits. Here’s Lumen’s. Copy it and change the details to your own business.

You are the assistant for Lumen Bike Repair, a bicycle repair shop in Leeds.

You help customers with:
- repair and servicing questions, prices and turnaround times
- opening hours, booking a drop-off, and where to find us
- whether we can work on a particular bike or part

How you talk:
- Friendly and plain-spoken, like a helpful mechanic at the counter.
- Keep answers to two or three sentences unless the customer asks for detail.
- Quote prices only from the price list. Never estimate a price that isn't listed.

Limits:
- If you're not sure, or the question needs someone to look at the bike, say so and offer to pass the customer to the team.
- Never promise a repair date; say "usually" and give the typical turnaround.
- Don't give medical, legal or safety-critical advice beyond "please have it checked in the shop".
  • Be concrete. “Keep answers to two or three sentences” works better than “be concise”.
  • Say what to do when unsure. An agent with a clear way out guesses less.
  • Put facts in the knowledge base, not the prompt. Prices and hours change; a document is easier to update.

5Add tools (optional, Pro and above)

Tools let the agent do more than reply. Open the agent’s menu on the Agents page and choose Workflow, then turn on the ones you want:

ToolWhat it lets the agent do
Search the knowledge baseRun its own extra searches when the documents it already has don't answer the question.
Remember detailsKeep details the visitor shares, like a name, email or order number, for the rest of the conversation.
Hand off to a humanPass the conversation to your team when the visitor asks for a person or the agent can't help. The agent stops replying and the conversation waits in your inbox.
Resolve conversationsMark the conversation resolved once the visitor's request is handled.
Offer reply buttonsShow clickable answers under a question, like Repairs, Prices or Opening hours. Web chat and the Playground show them; email stays plain text.

For Lumen, turn on Hand off to a human and Offer reply buttons. To let the agent look things up in your own systems, such as an order status, add a custom tool under Settings → Tools and attach it here.

6Test and improve

  1. Open the agent’s menu and choose Playground. It’s the same chat as the wizard’s test, on its own page.
  2. Try what real customers will ask: common questions, a vague one (“my bike is making a noise”), something off-topic, and “can I talk to someone?”.
  3. Use Clear chat to start a fresh conversation after a change.
  4. Every conversation also appears under Conversations. Open one to read it, or click Take over to reply yourself. Your replies appear in the chat as “Support agent”.

To change anything later, open the agent’s menu, choose Edit, make your change in the wizard and click Save changes. A published agent picks up the change straight away.

7Put it on your website

EmbedBest forHow
JavaScriptMost websites, including WordPress, Wix and Shopify themesPaste the snippet just before </body>. A chat bubble appears in the corner.
ReactSites built with React or Next.jsInstall the @flexaura/react package and add the component the snippet shows.
iFrameShowing the chat inside a page, such as a help pagePaste the iframe where the chat should appear.
Changing the look later

The iframe picks up colour and welcome-message changes by itself. The JavaScript and React snippets include those settings, so copy them again after changing them. Changes to the prompt, model or knowledge need no new code.

8When something's off

You noticeTry this
It answers questions it shouldn'tTurn on Stay in scope (Personality), and list what it helps with in the prompt.
It makes up a price or policyAdd the document to the knowledge base and turn on Only answer from this knowledge base.
It can't find something that's in your documentsCheck the document finished processing. Split long files into shorter, clearly titled ones.
Replies are too longMove Verbosity towards Concise, or say “two or three sentences” in the prompt.
It sounds stiff, or too chattyAdjust Formality and Personality, or describe the voice in the prompt.
It never hands off to a personTurn on Hand off to a human on the Workflow page.
No reply buttons appearTurn on Offer reply buttons. Buttons show in web chat and the Playground, not in email.
Email or Workflow tools are greyed outThey’re on Pro and above. See Settings → Billing & plan.

9Generative or flow agent?

The + New agent window offers both. Pick by the job:

GenerativeDeterministic (flow)
RepliesWritten by AI, in its own wordsExactly the text you wrote
Best forSupport, FAQs, sales chat, open questionsPayments, claims, forms, regulated tasks
You set upA prompt, a model and documentsA flow of steps on a canvas
Handles the unexpectedWell: it reads any questionOnly what the flow covers; everything else goes to the fallback
PlanEvery planPro and above

The companion guide Build your first flow agent walks through the deterministic kind, and Build your first hybrid agent combines the two.

Lumen Bike Repair is a made-up business used as an example.