Engineering practices · AI

AI engineering practices.

Live data indexing, five-minute sync, scoped queries, hybrid ranking, context budgets, document and image extraction, provider routing, time budgets, schema checks, personal data tokenisation, bounded agent actions and daily validation: what runs around every model call on the AI platform we operate.

AI Platform Components

One AI service sits behind a live test-management platform, and thirteen parts around it decide whether its answers are current, scoped, affordable and safe.

AI service4.9M vectors · ~2,000 requests a dayLive data indexingFive-minute syncScoped queriesHybrid rankingContext budgetsDocument and image extractionNightly summariesProvider routingTime budgetsStructured outputPersonal data tokenisationBounded agent actionsDaily validation
4.9Mvectors in the live index
39kinds of record indexed
79,000+teams, each scoped apart
~2,000AI requests on a working day
5 minfrom a change to the index

Data and Retrieval

What the AI reads, how current it is, and whose data each query can see.

01

Live Data Indexing

An AI feature is only as useful as the records it can read, and on a working platform those records change every minute. An index built once from an export answers from last month and loads the main database every time it is rebuilt. We index 4.9 million chunks across 39 kinds of record, from issues and test cases to requirements and sprints, as 768-dimension vectors read from a database replica that runs with zero lag, so the live database never carries the AI load.

Live databasethe platformReplicalag 0 sChunk and embed768 dimensions4.9M CHUNKSissues test cases comments requirements test data journeys sprints 32 more types
02

Five-minute Index Sync

When a record is edited or deleted, users expect the AI to know straight away. Without a sync the index drifts from the database, and deleted or trashed records keep turning up in answers. An incremental sync runs every five minutes across 20 tables, upserting about 8,400 changes a day with a median run of 13 seconds, and a separate deletion pass runs two minutes later in each cycle, removing about 160 records a day.

add · update0m 1m remove2m 3m 4m add · update5m 6m remove7m 8m 9m add · update10m 11m remove12m 13m 14m add · update15m~8,400 a dayrecords upserted~160 a dayrecords removed13 smedian run · 20 tables
03

Scoped Queries

On a platform shared by many organisations, an AI answer must only ever draw on the asking team’s records. A single unscoped search leaks one customer’s issues or requirements into another customer’s answer. Every chunk carries indexed fields for team, app, record type, source table and a deleted flag, every query filters on them before ranking, and more than 79,000 teams are kept apart this way in one index.

Queryfrom team Ateam = Aapp = 12type in (issue, test case)not deletedONE INDEX · 79,000+ TEAMS team A’s chunksevery other team: never considered
04

Hybrid Ranking

Users search with exact IDs, error messages and product terms as often as with plain questions. Meaning-based search alone misses exact matches, and keyword search alone misses paraphrases, so the right record ranks below noise. Each request runs up to six queries, combines meaning-based and keyword results by reciprocal rank fusion over a depth of 40, keeps the top five per query, and drops anything scoring under 0.3 or more than 0.15 behind the best match.

Requestquery 1query 2query 3query 4query 5query 6Meaningvector searchKeywordsexact termsFused rankingdepth 40 · top 5score ≥ 0.3within 0.15 of best
Planning AI on your own data?

A call with an engineer who runs retrieval over millions of live records, about your data, users and limits.

Context and Generation

What goes into each model call, where it comes from, and which model answers.

05

Context Budgets

A model can only read so much at once, and what fills that space decides the answer. Without limits, one long source such as a knowledge-base document crowds out the requirements or test cases the question was really about. Each answer gets 12,000 to 18,000 characters of context, divided by source with its own cap, from 42 percent for knowledge-base text to 18 for requirements, 15 for test cases and 4 for test data.

SHARE OF CONTEXT, CAPPED PER SOURCEKnowledge base 42%Requirements 18%Test cases 15%Summaries 12%Apps 10%Sprints 10%Requirement contexts 8%Issues 5%Test data 4%12,000 to 18,000 characters of context per answer
06

Document and Image Extraction

Much of what teams know sits in attached documents and screenshots rather than in database fields. If those stay unread, the AI answers without the specification or the screenshot that explains the bug. Documents of up to two million characters and twenty attachments each are extracted, images over 10 KB are turned into text with up to ten per document and eight in flight under a 90-second budget, and everything is cut into 1,800-character chunks with 200 characters of overlap.

Documentsup to 2M chars · 20 attachmentsImagesover 10 KB · 10 per documentTo text8 in flight · 90 s budgetCHUNKS · 1,800 CHARS 200 characters of overlapextracted text cached; cache pruned after 180 days
07

Nightly Context Summaries

Answering well about a whole app needs a view of the app, not just the five chunks that matched a query. Building that view on every request is slow and expensive, and skipping it leaves answers blind to the bigger picture. Every night at 21:00 a job summarises up to 100,000 apps under a ten-hour cap, keeping about 7,000 summaries in the index for answers to draw on.

21:00 · nightly · 10-hour capApp 1recordsApp 2recordsApp 3recordsApp 4recordsApp 5recordsApp 6recordsSummary writerone per app~7,000 summaries in the index
280 stime budget per request
90 slimit on each model call
2retries on overload or server errors
3model providers behind one client
08

Provider Routing and Fallback

Model providers have outages, rate limits and price changes, and an AI feature tied to one of them inherits all three. Without routing, a provider’s bad hour becomes the platform’s bad hour, and switching means rewriting the application. Three providers sit behind one client with interchangeable drivers, local models run with a 32,768-token context, heavy jobs fall back to a hosted model when local capacity is short, and calls that hit rate limits or server errors are retried.

Applicationone interfaceOne clientdrivers swapProvider AhostedProvider BhostedLocal models32,768-token contextfallbackretry on 429 and 5xx
09

Time and Cost Budgets

A model call can run for minutes and cost more than the feature earns if nothing stops it. Without budgets, callers time out while the work carries on, and long prompts quietly raise the bill. Every request has a 280-second budget, each model call is capped at 90 seconds and is only started with at least 10 seconds left, retries wait no more than 30 seconds, and output is capped at 16,384 tokens.

ONE REQUEST · 280 S BUDGET call 1 · ≤ 90 s call 2 wait ≤ 30 s call 3 under 10 s left: no new call16,384output tokens at most0.1 to 0.2temperature for facts2retries per call

Control and Safety

What the AI may output, what it may see, what it may do, and how we know it is healthy.

10

Structured Output Validation

When AI output feeds forms, test cases or actions, free text breaks the systems downstream. A missing field or malformed reply either fails silently or writes bad data into the platform. Every call that feeds the platform asks for a JSON schema, the reply is decoded and checked for required keys, a failed reply is retried once at temperature zero, and structured output never runs above a temperature of 0.2.

Model replySchema checkdecode · required keysValidwritten to the platformInvalidone retry at temperature 0
11

Personal Data Tokenisation

Prompts built from real records carry names, email addresses and phone numbers that do not need to leave the platform. Sending them to a model exposes personal data to a third party and to its logs. Before any call, email addresses and phone numbers are replaced by tokens, the token map is kept encrypted, the real values are put back only in the reply, and an action that still contains an unresolved token is not executed.

Recordasha@… · +91 98…Sent to modelEMAIL_1 · PHONE_1Modelsees tokens onlyEncrypted maptoken → valueReply restoredreal values backUnresolved tokenaction stopped
Do your records have to stay private?

A call with an engineer about tokenising personal data, local models and keeping AI inside your limits.

12

Bounded Agent Actions

An agent that can change records is useful only if what it can change is limited and checked. Without limits, one bad plan updates hundreds of records or messages people who should never be contacted. Our agents plan in at most three rounds, take at most five actions per run and create at most fifty records, may only use five action types (update fields, notify, comment, create a linked record, attach a file), and each action is validated before it runs, with a review step capped at 300 seconds.

Planup to 3 roundsProposed actionsat most 5Validateallowed type? in scope?update fieldsnotifycommentcreate linked recordattach fileReviewup to 300 sat most 50 records created per run
5actions at most per agent run
20guardrail patterns on every prompt
25checks in the daily validation
1 minbetween health checks
13

Daily Validation and Guardrails

An AI service fails quietly: a stuck sync, a lagging replica or an expiring certificate still returns answers, just worse ones. Without a daily check, nobody notices until users stop trusting the feature. A health check runs every minute, a validation at 05:10 each day runs 25 checks across the service, index, replica lag, both syncs, five scheduled jobs and logs and reviews the last 24 hours of request quality, and 20 guardrail patterns turn away prompts that probe the system’s internals.

05:10 · daily validation · 25 checks service index green replica lag 0 s incremental sync deletion sync 5 scheduled jobs logs request quality · 24 hHEALTH · EVERY MINUTEGuardrails20 patternsprobes of internals refusedall prompts and results logged for review

Self-assessment Questions

Questions worth asking of any platform you run today.

  1. Could one customer’s records appear in another customer’s AI answer?
  2. When a record is deleted, how long until your AI stops quoting it?
  3. Does your AI index read from your live database or from a replica?
  4. What stops one long document crowding out everything else in a prompt?
  5. What stops a single request from running for minutes or costing more than planned?
  6. Could you switch model providers without changing application code?
  7. Do email addresses and phone numbers leave your platform inside prompts?
  8. What can your AI change or send without its actions being checked?
Want an Independent AI Readiness Review?

An engineer reviews your data, retrieval, model choice, checks, budgets and guardrails against the questions above, and gives you a prioritised plan.

Discuss a project

Share a short brief. If it is a fit, the next step is a call with one of our engineers.