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.
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.
- Open Knowledge Bases in the sidebar and click New knowledge base.
- Give it a name, for example Lumen help centre, and create it.
- 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.
- Wait until each document shows as ready. Flexaura reads it and splits it into searchable pieces.
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
- Agent name (required): what your team sees in the dashboard, for example Lumen support.
- Persona name: the name customers see in the chat, for example Lumen Bike Repair. Leave it blank to use the agent name.
- Description: a note for your team about what this agent does.
- Avatar: upload a PNG, JPEG, WebP or GIF of up to 5 MB, or pick a colour.
Personality: how it thinks and speaks
- Under Start from a template, pick the closest match. There are nine: Customer Support, Sales, HR Assistant, Technical Support, FAQ Bot, Lead Qualifier, Feedback Collector, Onboarding Guide and Internal IT Helpdesk, plus Custom to start blank. For Lumen, pick Customer Support.
- Edit the System prompt to describe your business. The template is a starting point; section 4 shows a finished one you can adapt.
- Set the three sliders: Formality (Casual to Professional), Verbosity (Concise to Detailed) and Personality (Neutral to Friendly).
- Leave Stay in scope on. The agent then declines questions that have nothing to do with its job, instead of answering anything it happens to know. Turn it off only for a general-purpose assistant.
Model and memory
- Choose an LLM provider: Anthropic (Claude), OpenAI (GPT), Google (Gemini) or Groq (very fast). Custom / Local is marked Coming soon.
- Choose a Model. If you’re unsure, keep the one already selected.
- Leave Temperature and Max tokens as they are to begin with. A lower temperature gives steadier, more predictable answers; max tokens caps how long a reply can be.
Pick Conversation memory:
- Ephemeral: a fresh start every visit. Good for quick questions.
- Persistent: the conversation carries on when the same visitor comes back.
- Optionally turn on Fallback model: if your chosen provider is having problems, Flexaura tries a second one instead of failing the conversation.
On paid plans you can use your own key with a provider under Settings → LLM keys (BYOK). You don’t need one to get started.
Knowledge: connect your documents
- Under Attach a knowledge base, choose the one you made in section 2. No knowledge base yet? Create new opens the Knowledge Bases page in a new tab, and your progress in the wizard is kept.
- Consider turning on Only answer from this knowledge base. A question your documents don’t cover then gets an honest “I don’t have that information” instead of a guess from general knowledge. It’s the safest choice for prices, policies and opening times.
- Use Manage documents for this knowledge base to add or remove files later.
This step is optional. With No knowledge base, the agent answers from the AI model’s general knowledge, with nothing tying its answers to your own documents.
Channels: where customers can reach it
- Web chat is the chat bubble on your website. Set its Position, Primary colour and Welcome message, for example Hi! Ask me about repairs, prices or opening hours.
- Email lets the agent answer messages sent to your support address. It’s on Pro and above, and needs an Email config set up under Email Configs first.
- SMS, WhatsApp and Voice are marked Coming soon.
Clicking Next on this step saves the agent. It isn’t visible to customers yet: that happens when you publish on the last step.
Publish: test, then go live
- Test your agent first. The chat on this step talks to the real agent, exactly as your customers will. Ask it a few of your most common questions, and one it shouldn’t answer.
- Not happy? Click Back to change the prompt or the knowledge, then come back and test again.
- Click Publish agent and confirm. Publishing makes the agent reachable on every channel you turned on.
- Copy the embed code shown: JavaScript, React or iFrame. Section 7 explains which to use.
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:
| Tool | What it lets the agent do |
|---|---|
| Search the knowledge base | Run its own extra searches when the documents it already has don't answer the question. |
| Remember details | Keep details the visitor shares, like a name, email or order number, for the rest of the conversation. |
| Hand off to a human | Pass 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 conversations | Mark the conversation resolved once the visitor's request is handled. |
| Offer reply buttons | Show 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
- Open the agent’s menu and choose Playground. It’s the same chat as the wizard’s test, on its own page.
- 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?”.
- Use Clear chat to start a fresh conversation after a change.
- 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
| Embed | Best for | How |
|---|---|---|
| JavaScript | Most websites, including WordPress, Wix and Shopify themes | Paste the snippet just before </body>. A chat bubble appears in the corner. |
| React | Sites built with React or Next.js | Install the @flexaura/react package and add the component the snippet shows. |
| iFrame | Showing the chat inside a page, such as a help page | Paste the iframe where the chat should appear. |
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 notice | Try this |
|---|---|
| It answers questions it shouldn't | Turn on Stay in scope (Personality), and list what it helps with in the prompt. |
| It makes up a price or policy | Add the document to the knowledge base and turn on Only answer from this knowledge base. |
| It can't find something that's in your documents | Check the document finished processing. Split long files into shorter, clearly titled ones. |
| Replies are too long | Move Verbosity towards Concise, or say “two or three sentences” in the prompt. |
| It sounds stiff, or too chatty | Adjust Formality and Personality, or describe the voice in the prompt. |
| It never hands off to a person | Turn on Hand off to a human on the Workflow page. |
| No reply buttons appear | Turn on Offer reply buttons. Buttons show in web chat and the Playground, not in email. |
| Email or Workflow tools are greyed out | They’re on Pro and above. See Settings → Billing & plan. |
9Generative or flow agent?
The + New agent window offers both. Pick by the job:
| Generative | Deterministic (flow) | |
|---|---|---|
| Replies | Written by AI, in its own words | Exactly the text you wrote |
| Best for | Support, FAQs, sales chat, open questions | Payments, claims, forms, regulated tasks |
| You set up | A prompt, a model and documents | A flow of steps on a canvas |
| Handles the unexpected | Well: it reads any question | Only what the flow covers; everything else goes to the fallback |
| Plan | Every plan | Pro and above |
The companion guide Build your first flow agent walks through the deterministic kind, and Build your first hybrid agent combines the two.