Chapter 11: Leveraging AI Assistance

Accelerating mapping work with a locally-deployed AI model that knows your project.

Bridger's AI features are built around Ollama, a tool for running large language models locally. The integration is opt-in and disabled by default — none of the AI menus or options appear until you enable it. When configured well, it can meaningfully accelerate the column mapping phase by suggesting source matches for target columns based on a model that has been loaded with the full context of your project.

Note Ollama must be installed and running on your machine or a reachable server before Bridger's AI features can be used. Ollama installation and model management are outside the scope of this guide. See ollama.com for documentation.

Enabling AI Features

Open Settings and enable the AI features toggle. Once enabled, the AI menu appears in the menu bar and AI-related context menu items become visible in the project panels. Disabling the toggle removes them again.

Two Places for AI Settings

Bridger handles AI configuration in two places. One covers how Bridger talks to the Ollama server. The other covers how a specific workbook wants that model to behave.

The AI Configuration dialog, reached from the AI menu, holds only what's local to the machine running Bridger: the Ollama server address and the pattern used to name deployed models. Nothing here is saved in the workbook, because a colleague opening the same workbook on their own machine may be pointing at a different Ollama server entirely.

Model behavior — which base model to build on, temperature, the confidence threshold, what project content gets embedded, the workflow prompt itself — is saved in the AI Options tab of the Configuration pane instead, alongside Status Codes, Notation Types, and the other configuration editors. That makes it part of the workbook file, so it's saved right along with the workbook, the same way those other settings are.

Note In short: connection details are per-machine, model behavior is per-workbook. If a teammate opens your workbook and AI mapping doesn't work, check their AI Configuration dialog first — the behavior settings came along with the file, but the server address didn't.

Configuring the Connection

From the AI menu, choose Configure AI Settings…. This dialog sets the Ollama server URL and port, plus the model naming pattern used when deploying (covered below). Use Test Connection to confirm Bridger can reach the server; a successful test also reports the Ollama version, how many models are available, and which model is currently cached in memory, which is a handy way to check whether the model you expect to be loaded actually is.

The AI Options Tab

Open the workbook's Configuration pane and select the AI Options tab (visible only when AI features are enabled, same as the menu). This is where you specify how the model behaves once deployed.

Base Model is a free-text field naming the Ollama model your generated modelfile will build on — qwen2.5-coder:7b is the recommended default and works well for this task even on modest hardware; qwen2.5-coder:14b and qwen3-coder:30b have also been tested and run correctly, at the cost of more time and RAM per suggestion. Temperature and Confidence sliders follow, controlling how consistent versus creative the model's answers are and the minimum confidence a suggestion needs before Bridger will act on it automatically.

Three content section toggles control what gets embedded in the modelfile beyond the source and target schemas themselves: library history, transformation templates, and past approved mappings. Library history is worth calling out specifically — each project is treated as new evidence first, with library history corroborating a direct schema match or acting as a capped-confidence fallback when nothing else lines up. It's never a substitute for what the current project's own data shows.

The workflow prompt editor shows the built-in default, dimmed, until you check Use custom workflow prompt, which copies that default into the editor as a starting point for you to modify. Unchecking it reverts to the default and discards whatever custom text was there. The {confidencethreshold} token in the prompt is replaced with the confidence slider's value at generation time — which means changing the slider later has no effect on a model you've already deployed; you'll need to regenerate the modelfile for the new threshold to take hold.

Below the prompt editor, every configured logic template is listed with two flags: Send to AI excludes a template from the generated modelfile entirely, and Canonicalize Logic tells Bridger to replace the model's paraphrased transformation logic with the template's exact wording whenever a suggestion cites that template. Disposition templates — exclusion reasons, default value templates — are never sent regardless of the flag, so their Send to AI checkbox is disabled.

Tip Leave Canonicalize Logic off unless a downstream script depends on literal wording like "Move source to target" — some models write out more useful, fully-elaborated case statements on their own than the template text alone would give you.

Generating and Deploying the Modelfile

The modelfile is a configuration package that tells Ollama everything it needs to make useful suggestions for your project — not a generic prompt, but one built from the actual schemas, history, and templates you chose to include on the AI Options tab.

Choose AI → Generate Modelfile… to open a dialog listing every source table as a checklist; only checked tables are embedded, and the checklist state is saved with the project so it doesn't need reselecting each time. Beside it, the estimated required model context, the prompt size in tokens, a rough KV-cache RAM figure (model-dependent, since it varies by model architecture), and the confidence threshold being baked in are displayed, updating live as you check and uncheck tables. Changing the threshold later means regenerating the modelfile for it to take effect.

Tip num_ctx is computed from the actual prompt size rather than left at Ollama's default, so a large project with rich history won't get silently truncated. If the readout shows a much bigger number than you expected, it's worth trimming the table checklist or content sections before generating.

Save the modelfile, then deploy it with AI → Deploy Model…, which loads it into the running Ollama instance under a generated name. The default naming pattern is bridger-{workbookname}-{projectname}-{basemodel}, with the base model portion resolved from the modelfile's own FROM line at deploy time and every token sanitized for Ollama's naming rules — for example, qwen2.5-coder:7b becomes qwen25-coder7b. You can adjust the pattern itself in AI Configuration if you'd prefer something else.

Tip The modelfile reflects the workbook at the time it was generated. If you add significant library content, new templates, or complete a meaningful portion of mappings, regenerate and redeploy to give the model better context. The quality of suggestions depends directly on the richness of what was loaded.

Depending on Ollama's timeout settings, a loaded model may be unloaded from memory after a period of inactivity. If suggestions stop working after idle time, redeploying will reload it. Ollama's keep-alive behavior is configurable via an environment variable in the Ollama engine — consult Ollama's documentation if you need the model to persist across longer sessions.

Choosing a Model for Mapping

Before a bulk mapping run starts, Bridger shows a model picker listing every model currently available on the configured server. This matters because a server may host more than one deployed model — one built for a different data domain, or one a colleague deployed for their own workbook — and the picker lets you confirm or override the choice each time. Bridger pre-selects whichever model was last successfully deployed or picked for this project, so in the common case it's a single confirming click.

Tip Bridger handles a fair amount of variation in how different models format their answers. If you ever run a model and see suggestions come back empty or garbled where they shouldn't, let us know — that's a parsing gap worth fixing, not something to work around.

Running AI Mapping

AI mapping works on target columns. Select one or more target columns using standard multi-select, right-click, and choose AI Map Selected Columns. The model is given the target column's context and asked to find the best matching source column from what it was loaded with. Bridger processes each selected column in sequence.

A progress dialog shows which column is currently being processed, a running tally of successes and failures, and a line for the most recent result — elapsed time in seconds on success, or the failure reason otherwise. Watching that tally climb is a good early signal: if failures start piling up mid-run, it's worth cancelling and reconsidering the model or content settings rather than waiting for the whole batch to finish. An initial warm-up phase loads the model before processing begins — this may take a few seconds on the first request. You can cancel the run at any point; mappings already created before cancellation are kept.

Reviewing the Results

When the run completes, a summary dialog lists every column that was processed. Successful mappings show the suggested source column, the confidence score, elapsed time, and the model's reasoning. Failed columns — those where the model's confidence fell below your threshold, or where no suitable match was found — are listed separately with the reason.

Click View Mappings to filter the mappings tree to just the mappings created in this run, making them easy to review one by one.

AI Generated Status

Mappings created by the AI are assigned AI Generated status, shown in purple. This status is locked — the notation content and properties of an AI-generated mapping cannot be edited until the status is moved to something else. This is intentional: it forces a deliberate human review step before any AI suggestion becomes part of the authoritative map.

To work with an AI-generated mapping, change its status to an appropriate working status first. If the suggestion is wrong, delete the mapping entirely. You cannot manually assign AI Generated status to a mapping — it is only set by the AI mapping process itself.

Note AI Generated is separate from the approval locking described in Chapter 3, but behaves the same way: locked until the status changes. The distinction is that approval locking protects reviewed work from accidental changes, while AI Generated locking protects unreviewed work from being treated as complete.

AI Context Export for Validation

Once a mapping exists, Bridger can build an AI-ready context prompt for generating validation SQL. This is a manual, one-off step meant for pasting into whatever general-purpose AI assistant you use — Claude, Copilot, ChatGPT, Ollama's own chat interface, or similar — separate from the AI mapping feature described above.

Right-click a mapping and choose Export AI Context…. A dialog displays a structured markdown prompt containing the mapping's full context: source and target columns, data types, transformation logic, exception codes, status, and default value. Review and edit the prompt if needed, then click Copy to Clipboard and paste it into the AI tool of your choice to generate validation queries.

This is a per-mapping operation. Bulk context export is not supported, as the resulting prompt would be too large to be useful in most AI tools.