AskLumenBuyer guides & toolsPricing
Lumen · Buyer resources

How to build AI tools?

Building an AI tool is less about the model and more about choosing a narrow job, giving the model the right information and checking its output. Most useful AI tools are a thin layer: a prompt, some retrieval or API calls, and a validation step. This guide describes the path in the order that avoids the usual dead ends.

1. Choose one narrow job

"An AI for marketing" is not a job. "Turn a sales call transcript into a follow-up email in our house style" is. A good first job has a clear input, a clear output, and a way to check whether the output is right. If you cannot write down five example inputs with the output you would accept, the job is too vague to build.

2. Decide what the model needs to know

NeedTypical techniqueWatch out for
Answer from your documentsRetrieval: split documents, index them, fetch relevant chunks into the promptStale documents, chunks that cut a table in half
Use live data or servicesFunction or tool calls to APIsPermissions, rate limits, errors the model ignores
Follow a style or formatExamples in the prompt, output schemasStyle drift on long outputs
Do multi-step workAn agent loop with a step limitLoops that never end, cost runaway
Learn from feedbackStore corrections and feed them back as examplesStoring private data you should not keep

3. Pick a model by testing, not by reputation

Write 20 to 30 realistic inputs and run them through two or three models. Score the outputs. Often a cheaper model passes; sometimes only the strongest does. A model picker, or a router that sends easy queries to cheap models, lowers cost. Lumen's answer engine exposes this idea directly with an Auto cost-router and a list of models from several providers, which makes it a convenient place to compare how different models handle your prompts before you write code.

4. Build the smallest working loop

  1. Hard-code one input and print the model's output.
  2. Add the retrieval or tool call.
  3. Add output validation: parse JSON, check required fields, reject empty answers.
  4. Add a retry with the validation error fed back to the model.
  5. Only then add a user interface.

5. Evaluate before and after every change

Keep your 20 to 30 test inputs in a file with expected properties. Re-run them after every prompt or model change. This is the single habit that separates tools that improve from tools that quietly regress.

6. Add guardrails

7. Ship small and measure

Release to a few users, watch what they ask that you did not expect, and add those cases to your test set. Track cost per task and the share of outputs users accept unedited.

Build or use an existing tool?

If your job is research, summarising or drafting, an existing answer engine with connectors may already do it. Build when you need your data, your workflow, or your guardrails.

A small example end to end

Goal: summarise a customer email thread and propose a reply. Inputs: the thread text. Output: a three-line summary and a draft reply under 120 words. Build: one prompt with two worked examples, a JSON output schema with summary and draft fields, a check that the draft is under the limit, and a retry if parsing fails. Test: twenty saved threads, scored for accuracy and tone. Guardrail: the draft is shown to a person and never sent automatically. A tool this small can be working in an afternoon, and every later improvement can be measured against the same twenty threads.

Frequently asked questions

Do I need to train a model?

Almost never for a first tool. Prompting, retrieval and tool calls cover most needs.

How much does it cost to run?

Estimate tokens per task times price per token, then multiply by tasks per month. Measure on your test set before guessing.

Related guides

All buyer guides and tools