Private, self-hosted AI agents that answer from your company documents, APIs and rules
Optiflow builds private AI agents for one company at a time: deployed on your server, limited to the sources you allow, with the model running there or through a provider you choose.
Sample rules written for this page, not a client’s data.
Point at the print to read the rules it is written in.
What is a self-hosted AI agent?
A self-hosted AI agent is an assistant that runs on infrastructure you control and works from your own material. It searches the documents, systems and rules you connect, writes an answer from what it finds, names the source, and stays inside the permissions of the person asking. It is not a public chatbot.
Someone asks
In plain language, signed in as themselves.
“Can I give this client 15% off?”
Access is checked
Only the sources their role may open are searched.
Role: Sales
Sources are found
The relevant passages are retrieved, a method called retrieval-augmented generation (RAG).
Two people approve any discount above ten percent.
An answer is written
The model answers from those passages and cites them, or says it found nothing.
“Only if two people approve it.”
Local model or provider API: which should you choose?
Run an open-weight model on your own server when questions and documents must not leave your network. Use a provider’s API when answer quality on hard questions or low upfront cost matters more, and its data terms are acceptable. Optiflow builds both, and the choice is yours.
Your server
- Documents
- Search index
- Access rules
- Question log
- Open-weight model
Nothing needs to cross the boundary to produce an answer.
The question and the passages needed to answer it cross to the provider.
Provider API
Not used Writes the answer| Compared on | Model on your server | Model through a provider |
|---|---|---|
| What leaves your network | Nothing is needed to answer | Questions and the retrieved passages |
| Hardware | A server with a suitable GPU | An ordinary server is usually enough |
| Running cost | Mostly fixed, busy or idle | Grows with how much it is used |
| Answer quality | Depends on the model your hardware can hold | Access to large models without buying hardware |
| Model updates | You decide when to change it | The provider changes and retires models |
| Choose it when | The material is confidential or regulated by your own policy | You want to start quickly and the terms suit you |
How does the agent connect to your documents, APIs and rules?
Documents are split into passages and indexed, so the agent can find the right ones. Internal APIs are offered to it as named tools with fixed inputs, such as “check a booking”. Rules that must never bend are enforced in code, not left to the model’s judgement.
Documents
Handbooks, policies, contracts, price lists and manuals. When a file changes, it is indexed again, so answers follow the current version.
Searched, then quoted
Internal APIs
Your booking system, CRM or database, reached through tool calling. Each tool does one thing and checks who is asking.
Called, read-only unless agreed
Rules
Who approves what, what is confidential, which answers need a person. The hard limits are written as checks the model cannot talk its way past.
Enforced in code
If the job is moving data between tools on a trigger, with no questions to answer, that is AI automation and usually the simpler choice. If people need to see and correct the figures themselves, look at internal tools and dashboards.
How do you stop it from accessing data it shouldn’t?
The limit is set before the model sees anything. Sources are allowed one by one, each person’s role decides which of them are searched, connections are read-only unless you agree otherwise, and every question is logged with what was opened. A file that is never retrieved cannot be quoted.
| Source | Sales | Support | Finance |
|---|---|---|---|
| Price and discount rules | Can open | Can open | Can open |
| Client files | Can open | Can open | Closed |
| Refund records | Closed | Can open | Can open |
| Salary file | Closed | Closed | Can open |
- SalesCan I give this client 15% off?Answered from the discount rule
- SalesShow me everyone’s salary.Refused, nothing opened
- SupportWhat is our parental leave policy?No source found, no answer
What hardware does a local LLM need, and what does it cost to run?
A local LLM needs a server whose GPU memory can hold it, and the need grows with model size and with how many people ask at once. Its cost is mostly the server, whether busy or idle. A provider API needs little hardware and charges by use.
No honest figure exists before the questions and the number of users are known. We test candidate models on your own questions first, then size the server or estimate the usage bill, so you compare two real options.
What moves the bill
- How many questions a day
- Drives a provider bill directly.
- How many people at once
- Drives the size of a local server.
- How large the model is
- Drives GPU memory, or the price per request.
- How long the passages are
- More text per question costs more time and money.
- Who keeps it running
- Updates, backups and monitoring need an owner.
How long does it take, and who maintains it afterwards?
Optiflow plans a focused agent as a fixed-scope 14-day sprint: sources and question sheet agreed by day 3, a prototype you question on day 7, launch and handover by day 14. You receive the code and documentation, so your team or another developer can maintain it.
- Days 1 to 3
Sources and limits
Which material, which roles, where the model runs and what it must refuse.
- Days 4 to 10
A prototype you can question
Indexing, tools and access rules against your real material. You start asking on day 7.
- Days 11 to 14
Tested, then handed over
The question sheet is run, the agent goes live on your server, and the repository is yours.
After handover, new sources or abilities are scoped as a further sprint. The same delivery method is described under vibe coding development.
When is a private AI agent the wrong choice?
When the answers live only in people’s heads, when the documents contradict each other, or when nobody will keep them current. An agent repeats what its sources say. If the material is public and not sensitive, an off-the-shelf assistant may be all you need.
Worth building
- The same internal questions come back every week
- The answers are written down, but hard to find
- Some material may only be seen by some people
Fix this first
- Rules that exist only as habit
- Several versions of one policy, none marked current
- No owner for the documents
Is a self-hosted AI agent right for a small business?
It can be, when the same internal questions come back every week and the answers are already written down. A small team needs three things before the software: current documents, one person who owns them, and a decision about where the model runs. A provider API needs little hardware. A model on your own server keeps questions and documents on your network and needs a server with a suitable GPU.
A sensible first version
- One team and the questions it asks most
- The few documents that already answer them
- A question sheet that includes what it must refuse
Consider something simpler
- Nothing in the material is sensitive: try an off-the-shelf assistant
- The job is moving data on a trigger: AI automation
- People need to correct the records: an internal tool
Questions about private AI agent development
Is a self-hosted AI agent the same as a chatbot?
No. A general chatbot answers mainly from what its model learned and what you paste or upload into it. A self-hosted agent is connected to your own documents and systems, checks who is asking, and is built to cite the passage it used or to say it found no source.
Does my data leave my network if I use an external API?
Partly. Your files and the search index stay on your server, but each question and the passages needed to answer it are sent to the provider. If nothing may leave, run an open-weight model on your own hardware instead.
How does the cost compare with a ChatGPT subscription?
They are priced differently. A subscription is paid per user. A custom agent has a build cost, then either a server you run or an API bill that follows use. It makes sense when you need your own sources, permissions and integrations.
What happens when the agent does not know the answer?
It is built to say so and to point to a person, and those cases are part of the test sheet. No model is perfect, so answers carry their source and anything that matters can be checked against it.
Can it take actions, or only answer questions?
It can do both through tool calling, for example creating a draft or checking a booking. Reading is the default. Any action that changes data is agreed one by one and can require a person to confirm it.
Can we start with a provider and move to a local model later?
The model connection is built so it can be changed. Moving still needs a suitable server and a new run of the question sheet, because a different model will not answer in exactly the same way.
Do I need my own server?
You need infrastructure you control: an on-premise machine, a private VPS or your own cloud account. With a provider API a modest server is usually enough. A local model needs one with a GPU sized for that model.
How much does a private AI agent cost to build?
Optiflow does not publish prices. Before any code is written you receive the scope, the launch date and a fixed total for the build. Running costs come on top and depend on the setup: a GPU server for a local model, or a usage-based bill from the provider.
Read before you decide
- Vibe coding developmentHow the software around an agent is written, reviewed and handed over.
- AI automation servicesWhen the job is a workflow that runs on a trigger instead of a question.
- Why automation breaks at 3amRetries and contract checks for any system that calls your internal APIs.
- A founder’s checklist for buying automationQuestions on ownership and lock-in before you commit to a platform.
- What is vibe coding?The plain-English guide to how this studio builds.
- The hidden cost of alert fatigueWhy static thresholds page too often, and a first pass that is not human.
Which question does your team keep asking?
Send us three of them and where the answers are kept today. We reply with whether an agent is the right tool.
Prefer email? show our email.