A lot of the most valuable AI use cases involve data that companies are not allowed, or not willing, to send to a third-party API: customer records, financial exports, health information, internal documents. For those cases the question is not “which frontier model is best?” but “how much can we do without the data ever leaving our machines?”
We built a small Lab project to explore that question: a multi-agent pipeline that cleans and audits messy customer data using only a local model. This article walks through how it works and what we learned.
The task: messy customer data
The input is the kind of file every operations team has: a CSV export of customer records that has been edited by many hands over many years. Inconsistent name casing, mixed date and phone formats, stray whitespace, partial duplicates and fields in the wrong columns.
The goal is a clean, structured, de-duplicated JSON file, produced without any network call to an external AI service.
The architecture
The whole pipeline runs in a single Python process on one workstation:
- Load. The CSV is read into memory.
- Agent A, the Cleaner. A local Llama 3.1 8B model, served by Ollama, normalizes the records into structured JSON.
- In-memory hand-off. The Cleaner’s output is passed directly to the second agent. There are no intermediate files and no network calls.
- Agent B, the Quality Auditor. The same local model, prompted for a different role, re-checks the JSON, repairs anything the Cleaner missed and removes duplicates.
- Write. The cleaned result is saved locally.
There is deliberately no orchestration framework. One process and an in-memory JSON hand-off are easy to read, easy to debug and easy to run on any machine with Ollama installed.
Why two agents instead of one
The obvious question is why not ask one model to “clean and de-duplicate this data” in a single step.
Small models tend to do better when each call has one clearly defined job. A single prompt that asks for normalization, validation and de-duplication at once tends to do all three a little badly. Splitting the work gives two advantages:
- Focus. The Cleaner only worries about structure and formatting. The Auditor only worries about correctness and duplicates.
- A second look. The Auditor reviews the Cleaner’s output with fresh instructions, giving first-pass mistakes a second chance to be caught. It is the same reason human teams separate doing from reviewing.
This “maker and checker” pattern is one of the simplest and most useful multi-agent designs, and it works with large hosted models too.
Running locally: what it takes
The proof of concept runs Llama 3.1 8B through Ollama on a single workstation with a consumer GPU (12 GB of video memory). A few practical notes:
- Model size matters more than anything else. An 8B-parameter model fits comfortably on a 12 GB GPU and is fast enough for batch work. Larger models improve quality but need more memory or slower CPU offloading.
- Batch, don’t stream. For data cleaning, processing records in chunks keeps prompts small and lets you retry a failed chunk without starting over.
- Ask for structured output. Requesting JSON, and rejecting anything that does not parse, removes a whole class of errors before the second agent ever sees them.
What we learned
Local models are good enough for a surprising amount of operational work. Normalizing formats, fixing casing and spotting obvious duplicates are well within reach of a small model, especially with a second agent checking the result.
Validation belongs between agents. The next improvement on our list is a strict schema check between the Cleaner and the Auditor, so malformed output is caught by code rather than by the second model.
You need a measuring stick. “It looks cleaner” is not a metric. Before using a pipeline like this on real data, you need a labeled sample to measure accuracy and a way to flag low-confidence records for human review.
Privacy is an architecture decision. Keeping data local is not a setting you switch on later. It shapes model choice, hardware, prompt design and how you evaluate quality.
When to use a private pipeline
A local, multi-agent approach makes sense when:
- Data cannot leave your network for legal, contractual or customer-trust reasons.
- The task is well defined and repetitive, such as cleaning, classifying, extracting or summarizing.
- Volumes are predictable enough to size hardware for.
When tasks need deep reasoning over long documents, hosted frontier models still have a clear edge, and a hybrid design, with local models for sensitive steps and hosted models for the rest, is often the best of both.
Where this goes next
This project is a proof of concept, not a product. Our next steps are measuring accuracy against a labeled dataset, adding schema validation between agents and publishing the source in our GitHub organization.
If your team has data that cannot leave the building but still needs AI help, this is exactly the kind of system we design and build.