How to build an AI agent: five steps from task to go-live
Building an AI agent is less a question of technology than of planning. Settle the task, knowledge and permissions properly and most of the work is done. This guide takes you from idea to pilot in five steps and shows where approval by a person belongs.
Assistant without code, actions via n8n workflows; self-hosted with the Community Edition.
Key points
- Start with
one clear task that comes up often and has a result you can check. Broad all-purpose agents usually fail on too many special cases. - The agent gets its knowledge from
your sources, with references , and only the tools and permissions the task needs. - Write actions start
with approval only . Our rule of thumb: test at least 20 real cases before the agent is allowed to do more on its own.
What you need to build AI agents.
An AI agent consists of a language model, a goal, knowledge, tools and limits. The AI agents guide explains what each building block does. There are three ways to build one. They differ mainly in how much you develop yourself and how much control you keep.
| Route | How it works | Good for | What to watch |
|---|---|---|---|
| No-code workflow tool | Assemble workflows visually; the language model decides at certain points | Business teams, quick pilots | Where do data and model run? Who maintains the workflows? |
| Custom development | Build the agent with a programming library and a model’s API | Developer teams, special cases | Effort for operation, testing and security |
| RAGSuite as knowledge plus an n8n workflow | Set up knowledge and an assistant with sources in the browser; an n8n workflow queries RAGSuite and carries out the action | Teams that need knowledge with sources | Keep actions deliberately small and approved |
How to build an AI agent in five steps.
The order matters. If you start with the model or the tool, you often build an agent that can do a lot but solves no task reliably.
Choose the task
Frequent, rule-based, with a result you can check. Write down what “done” means and which cases the agent will not handle.
Connect knowledge
Only the sources that belong to the task: policies, manuals, product data. The agent should answer with references.
Set tools and permissions
Which systems may the agent read, where may it create drafts, what needs approval? A technical account of its own instead of a personal one.
Write instructions and limits
Goal, tone, format and what happens when information is missing. Plus a cap on steps and cost per run.
Test and approve
At least 20 real cases, including difficult ones. Then a pilot in which every action is approved. Only then more autonomy.
Connect knowledge: the agent answers from your sources.
Without knowledge of its own, a language model answers from its training. For your return periods or contract clauses that is too vague. So connect the documents that belong to the task, and require the reference in every result.
In RAGSuite you upload files or connect sources such as SharePoint, Confluence, Google Drive, Notion and Slack via connectors. Through the MCP server, other AI tools can query this knowledge too and get passages with sources back. Both are included in the Community Edition.
Tools and permissions: read, draft, act.
Mistakes become most costly when an agent acts with too many permissions. OWASP calls this “excessive agency”. So grant permissions in levels, and move up a level only after a successful pilot.
| Level | What the agent may do | Example | When it makes sense |
|---|---|---|---|
| 1 · Read | Query and summarise data | Look up order status | Always the start |
| 2 · Draft | Create drafts that a person sends | Reply email as a draft | After testing with real cases |
| 3 · Act with approval | Prepare an action that a person confirms | Book a credit note after confirmation | In the pilot and for anything involving money, contracts or people |
| 4 · Act without approval | Carry out the action itself, with a log for review | Assign a ticket to a category | Only for small, reversible steps |
Always treat content from emails, files and web pages as data, never as instructions. OWASP lists hidden commands of this kind (prompt injection) as the number one risk for LLM applications.
Building AI agents for free and locally: what works?
The software for an agent can be free. The RAGSuite Community Edition is licensed under Apache 2.0 and includes connectors, MCP server and client, the n8n integration, webhooks and the REST API. Open language models run locally, for example with Ollama.
Even so, only the licence is free. A local agent for several users needs suitable hardware, someone has to handle updates and backups, and the task, permissions and tests take working time. If you do not want to run a server yourself, use the RAGSuite Engine, hosted in Germany.
Test, approve, operate.
An agent that impresses in a demo is not yet ready for everyday work. Test with real cases, including incomplete and contradictory ones. Record how often the result is right and how often a person has to correct it.
Collect test cases
At least 20 real cases from the inbox or ticket system, with the expected result.
Check results
Is the result right, is the source right, did the agent keep to its limits?
Pilot with approval
Four weeks in real operation, with every action confirmed by a person.
Review the log
Review errors, corrections and cost. Only then decide on more autonomy.
Is your agent ready for the pilot?
Tick what is done. Nothing is stored.
Questions about building AI agents.
Can I build an AI agent without programming?
Yes, for many tasks. Workflow tools with a visual interface connect the language model, knowledge and actions with a few clicks. With RAGSuite you set up knowledge and an assistant with sources in the browser. An n8n workflow queries RAGSuite and carries out the action. You only need to code when a system has no ready-made interface.
Can I build AI agents for free?
The software can be free. The RAGSuite Community Edition is licensed under Apache 2.0, and open models run locally, for example with Ollama. There are still costs: for hardware or model usage, for operation and for the working time it takes to set up the task, permissions and tests properly.
How long does it take to build an AI agent?
A first prototype for a clearly defined task often takes a few days. The steps around it take longer: preparing knowledge, settling permissions, testing with real cases, involving data protection and the works council. For a pilot with approval for every action, plan in weeks rather than days.
Which language model suits an AI agent?
For agents, what matters most is how reliably a model calls tools and follows instructions. Test two or three models with your real cases before you decide. For simple, frequent steps a smaller model is often enough. In RAGSuite you choose the model per project, including local models via Ollama.
Can an AI agent run locally without the cloud?
Yes. If the language model, knowledge and tools run on your own servers, the data does not leave your network. The RAGSuite Community Edition can be self-hosted. With a local model, for example via Ollama, and local sources it also runs without internet once installed. Sources in cloud services stay where they are stored.
Your first agent, set up properly.
Mihaela goes through the task, knowledge and permissions with you and plans a pilot in which every action is approved.