AI agents with LangChain
A chatbot answers. An agent resolves. The difference is tools: an agent can query your ERP, open a ticket, compute a figure and reply with the result — deciding on its own which steps to take and in what order.
It is the most misused technology of the moment, because an impressive demo is easy and a production system that doesn't invent answers is hard. The difference is architectural discipline.
When it makes sense
A question that spans several places
The answer exists, but it's spread across three systems and a spreadsheet — and assembling it by hand takes half an hour.
Support that repeats the same script
Predictable questions whose answers depend on current data. Work that occupies good people with something requiring no judgement.
A process with many conditional steps
If the customer is type A, do this; otherwise, that. Flows a fixed decision tree doesn't cover well.
An internal tool for your own team
An agent the team queries in plain language instead of opening five screens.
How we do it
- 01
We define what the agent can and cannot do
Every tool is declared by name. The agent doesn't discover capabilities along the way — it has a closed set, and whatever sits outside it simply doesn't happen.
- 02
We separate reads from writes
Querying is cheap and reversible; writing isn't. Any action that changes data goes through explicit confirmation or a deterministic rule, never the model's judgement alone.
- 03
We write business rules in code
The model interprets language and picks a tool. The business conclusion comes from an explicit, versioned, testable rule you can read and audit.
- 04
We instrument every run
Which tool was called, with which arguments, and what came back. When something goes wrong, the whole path can be reconstructed.
What you get
- An agent in production, integrated with your systems
- A declared, documented tool set
- Explicit business rules, kept outside the model
- Full execution logs for audit
- A cost-per-call strategy and spend limits
Where we've applied it
In Toreply.me an agent decides which API calls to make, and in what order, to answer a WhatsApp question about the client's own ERP data. In the credit pre-analysis engine, AI reads documents and images — and no credit conclusion is generated by a model.
Questions about AI agents
Can the agent make things up?
It can, if the architecture allows it. That's why we separate the roles: the model interprets the question and picks the tool, but the data always comes from the source system, never from its memory. When the information isn't in the available tools, the correct answer is to say so — and that is behaviour you design for, not hope for.
What's the difference between an agent and a chatbot?
A chatbot talks about information someone prepared in advance. An agent executes: it queries live systems, chains steps and returns the result of an action. In practice, a chatbot answers "what are your opening hours"; an agent answers "how much did this store sell yesterday" by going to the ERP.
What does it cost to keep an agent running?
It varies with call volume and the model used. One practice cuts that bill sharply: use a cheap model or a deterministic rule on the common path, and reserve the expensive model for cases where the classifier isn't confident. That's how we built tax-code classification in Hubfiscal.