Not by the Headlines: What Building AI Agents Really Looks Like
AI agents are everywhere in the headlines, but what does it actually take to build one that works reliably beyond a demo?

Book a demo
See what an AI agent could do for your finance team.
30-minute call with an AI agent expert.
See Your AI Agent in ActionNo commitment · Clutch-verified reviews
In a seminar hosted by SoftUni, our Head of Development, Lyubomir Dimitrov, takes a closer look at what happens behind the scenes when building and implementing AI agents in real business environments. Drawing on over 10 years of software engineering experience and more than 100 implemented AI agent and automation projects, Lyubo shares the challenges that rarely make it into the headlines, from accuracy, security and compliance to the everyday problems that come up once an agent goes into production.
Rather than another theoretical introduction or a step-by-step tutorial, this is an honest look at what works, what breaks, why it happens and what developers can learn from getting things right (and sometimes wrong).
If you're curious about what building AI agents really looks like beyond the hype, you're in the right place! See the full transcript below or if you’re a Bulgarian speaker, follow the link to watch the seminar: https://www.youtube.com/watch?v=eOF-h6DcfxA
Full transcript below has been compiled using AI tools. Please excuse any minor errors.
01 Introduction, Speaker, and Program (00:00–05:02)
Hello everyone who came to watch the seminar tonight. My name is Lyubomir Dimitrov, and I am a Lead Developer at Capto. Today we will talk about AI agents, but not the way they are written about in headlines and theory—rather, what actually happens in practice, what the most common problems are, and how you can solve them. As the title of the slide says: "Not by the headlines - what building agents really looks like." We will show you what goes on behind the scenes with us.
These are the seven main chapters we will go through tonight, and at the end, there will be an opportunity to ask questions and share what made the biggest impression on you. We start with who we are and what we do. Then, what an AI agent is, because we cannot skip this short theoretical part. After that, we will reach the most pressing question: whether to buy, hire, or build your own AI agent. I will show you what we do at Capto, we will look at "the engine and the car," and we will reach the core chapter—theory versus reality. Finally, I will share what I have learned over the past few years from implementing over 100 agents and automations.
The world of AI agents is full of flawless demos, pilots, and headlines about revolutionary results. Building an AI agent safely and keeping it in production—where accuracy, security, and compliance matter—looks entirely different from headlines and social media posts.
A few words about myself. I am Lyubomir Dimitrov, Lead Developer at Capto, with over 10 years of experience in software engineering. With my team, we have implemented over 100 AI agents and automation projects, mostly for finance departments. I lead the technical direction and development teams. I spend a large part of my time directly with clients, translating their business needs into something that works reliably within their systems. Our focus is to take AI agents beyond the demo and perfect use cases and show what actually happens in daily use.
And a few words about Capto. We make custom AI agents and automations for finance teams and build them on top of the client's systems and processes. That means we don't sell a ready-made tool, but adapt to the specifics and needs of the specific client, working in three simple steps: analysis; building and deployment; maintenance and development.
Let's clarify what this seminar is and isn't. You won't see a tutorial here on how to build an AI agent—the internet is full of such materials. Nor will I present a demo of yet another magical tool. Unfortunately, we haven't reinvented the wheel, and I won't be making promises about boosting productivity. Our goal today is to show you behind the scenes of real projects. What happens and how, what works, what breaks and why, how to fix and improve it, and what we learned from the many projects we have implemented.
My goal is to tell things from a practical rather than a theoretical perspective. But first, we need to understand what an AI agent actually is in order to delve into the essence of the problems.
02 What is an AI agent (05:02–10:47)
The simplest definition: An AI agent is an LLM that can reason, use tools, and take actions toward a given goal, often in a loop. Here we emphasize the word "actions."
The agent needs a brain, meaning a language model, and there are two main types. The first are Large Language Models (LLMs), which everyone talks about. You have most likely heard of OpenAI, Claude, Gemini, and the rest. These are huge models with billions of parameters, characterized by complex reasoning and broad knowledge. They are usually in the cloud and accessed via API, paying in the form of tokens—both input and output tokens are billed. I will return to this later. The downside is that your data leaves your infrastructure and can potentially be used to train subsequent models.
On the other hand are Small Language Models (SLMs). From several hundred million to around 20 billion parameters, without a strict boundary. They can run locally at the client's premises. They require an initial investment in physical infrastructure, but in the long run, they are cheaper and faster. They work with clearly defined tasks and often perform on par with large models. Their weak point is that they are not meant for a wide range of tasks, and you will likely need to fine-tune them.
In reality, the two types of models are not competition. They do not replace each other; they complement one another. In real projects, they are often combined: a small model for routine work and a large one for more difficult decisions.
There are three things that are often confused:
- LLM prompt — simply a chat without memory. You ask a question, get an answer, and that's it.
- Chatbot — remembers the conversation context and responds, but does not take action.
- AI agent — besides having a conversation and remembering context, it connects to your systems and executes tasks, meaning it takes action.
At the core of every agent is a loop. The agent perceives, plans, acts, and observes. An example from the agents we've implemented for finance departments—the agent receives an invoice (perceives). It decides that it needs to compare it with a purchase order (plans). It searches for the purchase order in the ERP system (acts). It sees that the amounts do not match or that something else happened (observes) and based on all this, decides what to do next.
Agents are not magic. Behind them lies an architecture combining three capabilities:
- Retrieval — connection to your systems.
- Tools / skills — abilities to execute various tasks like generating invoices and reports, sending emails, creating meetings, etc.
- Memory — helps the agent learn and improve over time from corrections.
The breakthrough is that the agent orchestrates all of this by understanding context, making decisions, and communicating completely naturally. This allows us to move from AI that suggests to AI that acts, or as we like to say, we give hands to the brain.
03 Buy, hire, or build an AI agent (10:47–20:13)
And here comes the question: should we buy, hire, or build such an AI agent? Everyone is free to choose. The options are many, but they boil down to three main categories.
Category 1: Hiring (subscription). Many of you pay subscriptions for AI tools and know how easy it is to start. The downside is that the tool is the same for everyone—it is not tailored to your needs; you have to adapt to it. Another major downside: you only have access as long as you pay the monthly license. Once you cancel, you lose access.
Category 2: DIY with Gen AI platforms — Copilot, ChatGPT, Claude, Grok, Cursor, and similar. The advantage is that they are very flexible and accessible: it's extremely easy to build an application and even launch it. But you still pay to build it, you don't fully own it, and you depend on the platform and tokens. And when something breaks, the question arises: who maintains it, who is responsible for it, who will audit it, and who will monitor its correct operation.
Category 3: Build something you truly own. The advantages are that it fits your processes and systems, and the intellectual property remains with you. The downside is that it requires expertise and time—but, honestly, that's why we exist. There is no universal answer, but it's important to know that you always have a choice.
The prompt is the most important thing. If you decide to build your own AI agent, you must know that what the AI will actually do, how it will do it, and what problems you will encounter in the future depend on the prompt. Today we all have access to the same AI tools—anyone can open a chat, write their first prompt, and generate a platform.
Before that, however, you must consider what exactly you want to create and how. This is where process architecture, business rules and exceptions, security and access, and audits and backups are established. AI cannot create something you haven't told it to. It might accidentally do so if you tell it to follow best practices, but in most cases, it does precisely what you told it to.
What sets us apart from anyone else with access to the same AI, and from so-called "vibe coders"? The architecture of the entire process; business rules and what the client really wants; security and data flow; guardrails and backups; auditor requirements; company data. And the final step, which for me is the most important and determines whether you will build an adequate application, website, or platform: prompt engineering.
With proper prompt engineering, you can get the maximum out of the tools you have access to and pay for. You cannot just write "don't make mistakes" and expect a perfect result. I am a programmer myself and I wish things were that easy, but reality is not like that—prompts must be thought through very carefully.
The five steps of a properly built agent. If you build an AI agent correctly—the way we do it in practice (this is a simplified example)—it is divided into five main steps:
- Business data — invoices, contracts, ERP data, bank statements, emails, messages, personal documents—any sensitive information you want to automate.
- Filtering — a large portion of the information is not needed by the AI. By removing sensitive data, you protect yourself: you cannot fully trust that external AI providers do not use data for training, even if you checked a box. The safest way is simply not to send them such information.
- The AI model — receives only the necessary data, processes it, and makes a decision.
- Validation — we check the result because we cannot trust it blindly: we all know models hallucinate and make mistakes.
- Result — recorded in the ERP, database, or other software.
Thus, data stays within the company, and only what you decided is sent to the AI—nothing reaches it by accident.
Types of agents. The list is long; here are the main ones:
- Single-task — the simplest ones, with a single clearly defined task.
- Tool-using — work with systems and APIs.
- Multi-agent — several agents collaborating.
- Semi-autonomous — act with little or no human supervision.
There are ready-made frameworks for building them, but a custom architecture can also be used.
04 Our approach: pragmatism and cost (20:13–28:49)
The question is no longer whether to use artificial intelligence, but which one. Let me show you what we chose at Capto and why.
We believe in custom-built solutions—not a ready-made tool and not a one-size-fits-all platform. The client owns the solution and accumulates their own IP instead of paying monthly licenses. The solution is embedded into the workflow—for example, the client communicates with the agent via email just as they would with a colleague. Processes are covered end-to-end and all unique systems are connected. You have audit and security within the company's standards, and we maintain it when needed.
Pragmatism. This is the approach we feel is missing from the market. Usually, people—whether professionally, for a home project, for a client, or a friend—start dreaming up and inventing everything AI could possibly do instead of them. This heavily complicates things and is not always worth it, as you will see later.
Therefore, we advise:
- First, automate a small task with clearly defined logic.
- Gradually scale it up and add AI only where rules fall short and more complex solutions are needed.
- Only then reach autonomous execution of tasks, and sometimes entire processes end-to-end.
I want to emphasize something very important: we do not use AI at all costs, and we advise you not to do so either. Simplify the process you want to automate. Automate it first, and only then think about where AI will deliver the greatest return and make the most sense. This way, risk is calculated—we know what can go wrong and what to do then—and the cost is predictable.
The cost of tokens. As I mentioned at the beginning, when you use AI via API, you are billed for input and output tokens. When you use AI only where necessary, you reduce both input and output, and consequently token consumption—and the application becomes cheaper.
I personally believe AI will become more expensive. Today we pay a subsidized price—large AI providers are not yet profitable. For example, OpenAI is expected to lose around 14 billion this year alone. We also noticed that Mistral, a French language model company, removed free API access from its free tier. This leads us to think that companies will gradually raise prices because it's time for them to become profitable, too.
That is why it matters how many tokens a process requires and how much it costs you daily and monthly. The less dependent you are on AI, the more predictable the cost. This is exactly what we saw in a real project—a KYC process, which I will talk about later: what broke, how, and how we fixed it.
What an agent looks like. An AI agent has skills. Whether built into Claude or OpenAI, or built by yourself, the principle is the same. You have an LLM that reads emails (if your process is such), understands free text and attachments, and returns a result. You can use an SLM for document classification or an LLM again for decisions when there are exceptions and specific actions must be taken.
An agent has many other skills, but they are automated—there is no artificial intelligence there and consequently no token consumption. Thus, you can have a complex AI agent whose skills are not all AI-based. This reduces maintenance and usage costs.
We have most frequently implemented such solutions for monthly and annual reports, invoice reconciliation, payment confirmations, and taxes.
How much time will we save? We are often asked how much time they will save with AI, how much it will cost, and whether it's worth it. The answer is: it depends. We cannot say how much time a given agent will save because everyone's needs are different, systems are different, and things are very dynamic—there are no standard numbers. The truth, however, is that productivity and efficiency grow, and human errors decrease because routine tasks are executed the exact same way every time.
And something we are proud of: not a single client of ours has laid off an employee because of our agent. Claims like "AI agents will replace humans" were not confirmed in our practice. Teams are not shrinking—on the contrary, they take on much more work, including things they previously simply didn't have the capacity for.
05 The engine and the car (28:49–33:22)
Let's talk about the engine and the car. Here is what one of our agents looks like at a high level. Notice that this is not a chatbot, but a process:
- Trigger — input data enters here.
- Orchestration — a decision is made which AI connects to which system.
- Models — extract, classify, and reason.
- Integrations — connection with various tools.
- Verification — everything passes through validation, and exceptions reach a human.
Throughout the entire time, we have state, an audit trail, and monitoring so that we can trace what happened and why at any moment if there is an error.
Behind this architecture lie several conscious decisions. For each of them, there is an easier alternative, but we rejected it:
- Workflows with AI steps instead of a fully autonomous agent. This keeps the process predictable, auditable, and costs under control.
- Filtering before AI instead of sending all data directly to the model. As you remember from the red dots diagram, sensitive data stays in the company. As a bonus, we also pay for far fewer tokens.
- Numbers are calculated with code to avoid hallucinations.
- A small model where sufficient, instead of a large model for everything.
- Directly in the client's systems, rather than in additional platforms. This keeps data and decisions within the client's infrastructure.
What happens when something goes wrong? We have state—every step is recorded. We have context—the model receives only what is necessary, not the entire history. Errors are logged, retries and fallbacks are performed, and when necessary, the agent escalates to a human.
The model is the engine. It is not the car—the car is the entire solution around it: architecture, rules, checks. The car is driven by the human. They decide where to go, when to hit the brakes, and when to step on the gas.
And just like with cars, we choose an engine according to our needs: faster, slower, more reliable, more economical. There are different models for every purpose—or, in the metaphor, different engines. The biggest engine is not always the most suitable. As you can see, fuel prices have jumped right now—the biggest engine costs much more to run than a smaller, reliable one. It's the same with AI providers: the prices of small models are extremely accessible, while the largest models cost quite a bit. You have to consider whether you really need all that capacity.
06 Theory vs. reality and the KYC case study (33:22–41:58)
Now we reach the part why I am here today: what happens when the car hits the real road. This is the core of today's conversation—things that can go wrong and will go wrong, and how we solved some of them. Things you don't see in a demo, a YouTube clip, an article, or a LinkedIn post.
Real-world challenges:
- Unpredictability — asking the same question twice and getting two different answers. How do you test something like that?
- Evaluation — how do you measure if an agent is good? Is 95% accuracy good, or are we aiming for 100%?
- Tools and loops — wrong tool calls, agents getting stuck in loops, or being overconfident and outputting false information.
- Speed and cost — every token costs time and money.
- Context and memory — the context window is limited, while documents are not. I will show you how we handled this in practice.
- External changes — system updates, new processes, new team members.
- Expectations — what people think the agent can do versus what it can actually do.
- Trust — a single visible error can halt the entire deployment.
The KYC case study
This is the problem that made the biggest impression on me personally. Early on, it was a good challenge to test the limit of AI and find out in time before it was too late. That's why I chose to show you the KYC process.
KYC stands for "know your customer." It is typically used in banks: when you apply for a loan, the bank collects your documents—ID card and others. It extracts the data and checks you in a system: whether and to whom you owe money, what your income is, whether you can afford a loan and what the risk is—and based on that, decides how to proceed.
The task. In our case, the client provided us with a Google Drive where each company had a folder containing the personal data of all partners (the process was more complex because it involved corporate entities). We worked, of course, with their permission. They agreed with this structure, had an agreement with an AI provider, and had organized things so there was no risk of data leakage. The idea was to submit all documents to the AI via API, and the AI would perform OCR, extract key data, and write it to storage.
The problem. Reality turned out quite different. Test cases were few and yielded perfect results. However, real photos from end users were taken with a phone: low quality, cropped, shot in the dark, blurry. When people have to photograph many documents at home, they often neglect this step, and without an interface to guide and correct them, they submitted problematic photos.
- Hallucinations. These photos confused the AI: for the same photo, it returned different data, hallucinated, and even began making up data that wasn't present on the ID card photos.
- Long scanned contracts. There were contracts of 30 or more pages in PDF format that were scanned—meaning images. They consumed far more tokens, and the AI needed much more time and resources. For most of these documents, the data needed by the client was in the first two to four pages. In no time, the tokens we had allocated were exhausted.
The solution. We stopped the AI and stepped back one step. We implemented our own OCR library, plus custom rules and guardrails set by the client. We used AI only on precisely defined, filtered text from which it had to return strictly specified information to be saved in storage.
The result. Saved time, saved tokens and resources—and we managed to reach and even slightly improve the accuracy that the AI was giving us. The lesson is that sometimes we need to take a step back, remove AI, and think about how to use it only where it truly brings value—and not where it is easiest to plug it in.
07 The four pillars of reliability (41:58–45:40)
We use four main pillars of reliability. None of them are trendy or came out yesterday—all are foundations of software engineering and all are mandatory: an iterative approach, safeguards, human supervision, and continuous maintenance. They guarantee reliability and security.
- Iterative approach. You start small. Then the agent works as a shadow, in parallel with a human, without real consequences. You measure and compare the agent's data with the human's. Only when everything is 100% correct and you are confident do you transition to expansion and autonomy.
- Safeguards. They are completely mandatory—you cannot trust the model. Always verify every number it returns. Business rules act as a second key. When confidence is low, the task goes to a human. The agent has access only to what it needs. Do not give it full access to your company, your personal data, or your computer—just as you can use it, someone else can use it against you if you don't protect yourself properly.
- Human-in-the-loop. This is one of the most important things for accuracy. Autonomy is earned over time as trust in the agent is gradually built. If granted blindly right from the start, results become unpredictable and multiple problems begin to appear.
- Maintenance. You cannot do without it. The skills and tools the agent connects to change and update. Someone decides to add a new field to the login form, move a button, or change something else. You cannot build something that works for a lifetime. New regulations also always emerge that can restrict your AI and which you must comply with.
An agent is not a project—an agent is a product. And agents don't break loudly; they break confidently. Therefore, everything I've said so far is not optional—we have lived through it.
08 Five lessons learned (45:40–48:31)
Let's move on to the final chapter: what my team and I learned when dealing with such problems and what the most common issues are. If you remember only five things:
- Start simple—simpler than you think. You don't need to overreach from the beginning. Think and build the foundation, and when it is solid, build everything else on top of it.
- Not everything needs to be an agent. Sometimes standard automations and rules are fully sufficient.
- Visibility and monitoring from day one—to track and compare data and be able to test, especially when the agent starts hallucinating.
- Design for exceptions, not happy paths.
- Plan maintenance before launch. In other words: plan the entire architecture, how the agent will be used, and what will happen moving forward to save yourself headaches.
How to start. Whether you start with a subscription, vibe coding your own platform or agent, or turning to us, my advice is: don't start with something big. Go step by step:
- Identify the problem.
- Think about how to solve it in the simplest way possible.
- Find small, repetitive tasks and automate them.
- Connect the remaining systems.
- Only then consider where AI will add value—rather than adding AI just for the sake of having it.
Agents genuinely build upon automation. Without it, AI has no way to act—nothing to touch. And another thing: AI is not new. The term "artificial intelligence" has existed since 1956. What's new is that today it is accessible to everyone. Therefore, don't rush—the foundation is more important than the trend.
09 Conclusion and Q&A (48:31–end)
Thank you for your attention. If you want to continue the conversation or think of a question tomorrow, the day after, or anytime in the future, the QR codes lead to our website, our LinkedIn page, and my personal profile. We are open to assisting with whatever we can. We frequently post about what happens behind the scenes and how. If you want to contact us and organize a meeting—no problem, we are open to helping anyone who needs it.
Now we move to the Q&A in Slido. You can scan the QR code on the left or enter slido.com with the code #seminar.
Questions and Answers
Question: Out of the 100+ agents and automations you have delivered, what proportion actually work daily? What is the most common reason an agent gets stuck at the demo stage?
Answer: I don't have the exact numbers on hand, but certainly over 75% of the agents and automations we've implemented are used daily. The most common reason they stay at the demo stage is client uncertainty. They are not sufficiently informed and confident, don't know how to protect themselves from AI, and stand on the border between fear and the desire to add something new just because it's new.
Question: Where exactly do you place the human in the process—which decisions does the agent make alone and which always require approval? And how do you prevent the human from eventually starting to approve everything mechanically?
Answer: In the beginning, the human sits at the end of the process as a barrier between the end user and the data that will reach them. The agent processes the data and sends it to an employee who checks it manually to be 100% sure it's correct—and only then releases it further. When the testing period passes, a large volume of data has passed through the agent, and people trust it; they stop approving, and the agent sends everything to the end user completely autonomously. Prevention comes mainly from the employees themselves for whom the agent works: at some point, they trust it so much and are so confident in the data that they see no point in continuing to approve. They themselves say they are ready to stop and let the agent be released fully into production.
Question: What breaks most often after the agent is already in use—model changes, new data formats, changes in client processes? How much effort does maintenance take compared to initial development?
Answer: Model changes are not the most frequent problem—models released over the past 6–12 months are quite stable, and changes come with the newest versions. More often, external factors change: the format of data we extract from a given system because the system was updated; changes in client processes; new requirements and regulations. From an effort perspective, maintenance doesn't take much time if development was done right, with a solid foundation and well thought out—then it is very easy.
Question: How do you measure whether an agent is accurate enough for tasks like data reconciliation or taxes before trusting it? What error rate is acceptable, and who decides—you or the client?
Answer: I'll start with the last question. (The microphone turns off briefly, 54:45–55:05.) Usually, the client tells us what error rate they tolerate, and we adapt. If they seek 100% accuracy, we aim for 100%—and that before deployment to production. There are also clients for whom up to 10% errors reaching the end user is acceptable because they are easily corrected and do not cause significant harm. Accuracy is measured during the shadow mode period: on one side, the agent runs every day, and on the other, an employee continues to execute the same process. Every day, the data is compared. When the necessary accuracy is reached and trust is built that nothing will go wrong, we move to the next step.
Question: When the agent works directly in the client's systems with sensitive financial data, what safeguards, access restrictions, and audit trails do you use? How do you approach requirements like GDPR and "LAC" (unclear in recording)?
Answer: The first safeguard is that we do not give AI access to those systems—we do not feed the agent APIs, passwords, and access keys. We build an automation that connects to the systems and extracts the necessary data. From that, we filter and remove sensitive data that the client explicitly stated they do not want reaching the AI. This limits access and prevents data leaks. Audit trails are created according to the client's requirements—logs and necessary documentation are recorded just as they specified, and this varies for each client. When the client has GDPR requirements, we comply with them by regulation—it is strictly defined there what, how, and why can and cannot be done. When we connect to third-party systems that comply with these protocols, we comply with them as well.
If there are no more questions, we can conclude the seminar—I'll wait another minute. Wonderful closing question, thank you.
That was all from me. I hope I didn't bore you. Thank you for spending an hour of your evening. If you have questions, myself and the Capto team are available to help with anything related to agents.



