Healthcare AI agent · CDI query

Clinical-Documentation-Integrity Query AI Agent (CDI)

Read the chart after the encounter, surface the indicators that make it ambiguous, and draft a query in the health system's own templates for the treating clinician to answer — or not.

Typical delivery
4–6 weeks
Deployment
Your stack
Clinician-led
Post-encounter
After launch
Agent Care

What this agent does

Drafts the question, never the answer

In

  1. 01

    The chart is read after the encounter closes, against the facility's configured query triggers and template library.

  2. 02

    Normalise indicator values, their date and their exact location in the chart across sources.

Reason

  1. 03

    Identify where documentation is ambiguous, conflicting or silent against a diagnosis the chart may or may not support.

  2. 04

    Apply the approved query templates and compliant-query rules configured for the facility, never assumed.

  3. 05

    Bind each cited indicator to its location in the record, and mark what remains clinically undetermined.

Decide

  1. 06

    Build multiple-choice options as clinically reasonable alternatives, 'clinically undetermined' included.

  2. 07

    Route every drafted query to the treating clinician who provided care in that encounter, for their answer alone.

Out

  1. 08

    Retain the indicators cited, their chart location, the draft sent and the clinician's answer against the record.

  2. 09

    Execute write actions only inside the approval boundaries agreed during implementation.

Product statement

The agent drafts the query; only the treating clinician may answer it, and that answer must reach the permanent record before anything downstream can use it.

Example workflow

One query, chart to clinician

  1. 1Record reviewedEHR chart, closed encounter note, labs and prior query history
  2. 2Indicators gatheredLabs, vitals, orders, prior notes and each one's exact location in the chart
  3. 3Query draftedDraft query, cited indicators and confidence
  4. 4Controls appliedLeading-language checks, template compliance checks, indicator-support checks and confidence threshold

No human action required

Stages 1 to 4 run unaided, and no query reaches a clinician at any of them — the agent is drafting, and the CDI specialist's lane opens at the confidence gate.

5DecisionBranches at the confidence threshold
High confidence

Goes to the CDI specialist to approve.

Low confidence

Adds a second compliance read first.

Specialist approval

The draft is held with its cited indicators, its chart locations and the confidence.

Approve · Edit · Send for compliance review

Approved — released to clinician

  1. 6Query routed to clinicianOnly where write access and approval policy allow it
  2. 7Outcome evaluatedResponse rate, edit distance, indicator-support accuracy and compliance-audit findings

Specialist edits

Every specialist edit made at approval is counted in the evaluation.

What should not run autonomously

Human approval stays in control

Outside the boundary — human approval required

8 items

  • Naming or implying the diagnosis a query is meant to produce.
    • Recording an answer on the clinician's behalf.
    • Sending a query to anyone but the treating provider from that encounter.
    • Disclosing reimbursement, DRG weight or severity impact in a query.
  • Automation boundary

    Agent acts unaided

    • ✓Read the chart after the encounter and cite.
    • ✓Draft the query in the facility's own approved templates.
    • ✓Build multiple-choice options as reasonable alternatives, undetermined included.
    • ✓Flag what the record leaves unclear, and hold the draft for the CDI specialist.

    Any write happens inside the boundaries agreed at implementation, never ahead of approval.

    • Resending a query for the same diagnosis without a new indicator.
    • Setting or enforcing a response deadline with a consequence attached.
    • Using a yes/no query to originate an undocumented diagnosis.
  • Assigning a code, or documenting the note during the encounter.

Example output

One query, annotated

Everything the agent drafts is attached to the indicators it was drawn from.

Query output · single encounter

Illustrative example
Patient
Respiratory-status indicator review
Drafted query
Sepsis, another documented process or clinically undetermined — based on the charted vitals and labs
Query type
Multiple-choice
Indicator source
Nursing flowsheet, day 2
Confidence
88%
Clinician status
Sent to the treating hospitalist

As received

Taken from the chart and the locations cited — nothing on this side is interpreted by the agent.

Indicators cited

  • Vital-sign flowsheet
  • Lab result with time
  • Prior query this stay

Why this reads as ambiguous

The options are clinically reasonable alternatives, undetermined included.

What the score decides

Below the configured threshold the draft picks up a second compliance read before.

Action

ApproveEditSend for compliance review

Value

Where AI adds value

The same four claims, placed at the point in the workflow where each one applies.

Where the value lands

Value 01 – 04

Every closed encounter

From the chart and the query history

03Query drafting

Read for ambiguity

Weigh the indicators already charted against the diagnosis they do, and do not, support.

01Approved path

A query may not suggest its answer

An indicator that supports a diagnosis and one that undercuts it move through the same read, not two.

02Human review

Point the specialist at what needs

Indicators with no clear chart location and low-confidence drafts are marked, so the specialist's read starts where ambiguity concentrates.

04

Build an evidence trail

The query, the indicators behind it and the physician who answered stay in the record.

Integrations

Typical integrations

Five system groups connect to the same agent. Which of them are in scope is decided in discovery.

  • EHR and chart systems

    • Epic
    • Cerner
    • MEDITECH
    • HL7/FHIR chart feeds
  • CDI and query platforms

    • 3M 360 Encompass
    • Iodine
    • Optum CDI
    • nThrive
  • Coding and DRG systems

    • 3M encoder
    • TruCode
    • MS-DRG grouper feeds

Agent

Clinical-documentation-integrity query

  • Reads the chart
  • Drafts the query
  • Holds for approval
  • Query and HIM systems

    • CDI worklist tools
    • HIM and audit-trail systems
  • Observability & evaluation

    • OpenTelemetry
    • Langfuse
    • Supported monitoring/evaluation sources

Integration availability depends on the client's existing systems and API access.

Agent controls

Six layers between the model and the clinician

Each layer contains the next. What escapes all of them is named in the map below.

L6 · Outermost — last line of defence

Inward → L1 · closest to the model

L6Rollback / safe modeNarrow drafting back to indicator surfacing when evaluation or production signals degrade.Roll back
L5Version monitoringTrack model, prompt, template and trigger-rule changes.Track
L4TraceabilityRecord the indicators cited, the draft query, the flag and the specialist's decision.Record
L3Specialist approvalHold drafts for a named CDI specialist; it governs release, not whether a query is compliant.Gate
L2Policy guardrailsTest drafts against leading-language and template rules; a failure returns the draft.Restrict
L1Confidence thresholdsRoute low-confidence drafts to a second compliance read before the specialist sees them.Require review
Model coreQuery drafted — cited indicators, options and confidence
L1 – L2
Test whether a drafted query may stand
L3
Puts the release in a specialist's hands
L4 – L5
Keep the query and the indicators behind it
L6
Falls back to indicator surfacing when signals degrade

How Nestack evaluates it

Evaluate the query workflow — not only the finished draft.

Coverage runs the whole depth of the workflow, and every layer is cut by slice.

Surface — the query the clinician sees

  1. E1Final-output evaluationDid the drafted query cite indicators the chart actually documents?
  2. E2Step-level evaluationDid the agent use the right chart, template rules and trigger configuration?
  3. E3Tool evaluationDid it read the correct chart and route to the correct treating clinician?
  4. E4Confidence calibrationDo low-confidence drafts actually draw more specialist edits?
  5. E5Slice evaluationHow does performance change across specific query types?
  6. E6Business outcomeHow many drafted queries needed a specialist edit or were found non-compliant on audit?

Floor — the outcome the health system answers for

Failure modes

Where each failure originates in the agent

Seven failure modes, placed at the stage in the query workflow each one begins.

Agent lifecycle

Direction of processing →

  1. 01 · Retrieval

    1 mode

    • DQ-03

      Superseded value cited

      A preliminary lab or vital is queried after a corrected result posts to the chart.

    Stage gathers

    Chart notes, labs and the template library

  2. 02 · Reasoning

    2 modes

    • DQ-04

      Leading-query construction

      Option order or wording points toward one diagnosis before the query sends.

    • DQ-06

      Indicator interpreted, not quoted

      A term such as malnourished replaces the value the guideline requires quoted.

    Stage proposes

    Draft query, cited indicators and confidence

  3. 03 · Tool / write

    2 modes

    • DQ-02

      Response inferred, not entered

      A likely answer is treated as documented before the clinician enters one.

    • DQ-05

      Query resent without new indicators

      The same diagnosis is queried again after an unfavourable answer, indicators unchanged.

    Stage writes

    Only where write access and approval policy allow it

  4. 04 · Output

    1 mode

    • DQ-01

      Financial rationale attached

      Reimbursement or severity impact is visible in the query or its surrounding screen.

    Stage returns

    The query the clinician answers

  5. 05 · Change / Version

    1 mode

    • DQ-07

      Silent trigger-point drift

      A coding-guideline or DRG-table update ships without the trigger points recalibrated.

    Stage tracks

    Model, prompt, triggers and templates

  • Sev-1 · a query sends outside the boundary
  • Sev-2 · a leading query reaches the clinician
  • Sev-3 · indicators degrade, goes to review
See the complete Healthcare failure-mode catalogue

Affected slices

One query type can carry the rest

A service line's query-compliance rate can look acceptable while one indicator or query type accounts for most of what a compliance audit would flag. Nestack reports the rate by slice, not only in total.

Slice performance — reported separately, not only in aggregate

Illustrative example
SliceFailure rateLiftLift vs. thresholdStatus
Queries raised on a single indicator7.6%3.9×Review
Sepsis and respiratory-failure queries5.5%2.9×Review
Post-discharge retrospective queries3.4%1.8×Watch
Concurrent queries with full indicators1.9%0.8×Normal

Bar: non-compliant-query rate lift vs. the concurrent full-indicator baseline · scale 0–4.0× · tick marks the 2.0× review threshold

2 of 4 slices over threshold

Evidence-linked improvement

The loop closes on the query, not the volume

A cycle is closed when the leading query is a case the next release must survive. That suite is what the next query raised is measured against.

Improvement cycle · five stages

Switchback — the path turns at Improve and returns at Learn

  1. 01

    Detect

    Non-compliant-query rate rises in a service-line slice.

  2. 02

    Diagnose

    The query that named the diagnosis it wanted is traced to the template, the trigger rule or the training data that produced it.

  3. 03

    Improve

    The change ships against a version, with the queries that exposed it attached.

  4. 04

    Verify

    Release is blocked until the affected query cases pass again.

  5. 05

    Learn

    The case joins the standing suite and the query templates move with it.

  6. Learn → Detect

    The return edge. The next query drafted runs against a suite one case longer.

Typical build scope

Twelve workstreams across six weeks

The build scope read against the delivery timeline. Week structure follows the six-week plan — discovery, sources, query workflow, evaluation, integration, then production validation and handover.

Workstream

Week 1Week 2Week 3Week 4Week 5Week 6

  1. 01Query-workflow discovery and boundary definition.Week 1
  2. 02EHR and chart-source assessment.Week 1, Week 2
  3. 03Template and trigger-rule mapping and rule mapping.Week 1, Week 2
  4. 04Chart ingestion and indicator normalising.Week 2
  5. 05Indicator retrieval and drafting logic.Week 2, Week 3
  6. 06Confidence scoring and flag routing.Week 3
  7. 07Specialist approval workflow.Week 3, Week 4
  8. 08Chart-source and coding-system integration.Week 5
  9. 09Query-construction cases.Week 4, Week 5
  10. 10Guardrails and compliance controls.Week 4
  11. 11Query-trail instrumentation.Week 5, Week 6
  12. 12Deployment, documentation and Agent Care handover.Week 6

12 workstreams · 6 weeks · bar shows the weeks a workstream is active — several run in parallel

Final scope and sequence confirmed in discovery

Engagement tiers

What each tier includes

Rows are the capabilities named in each tier's scope. Higher tiers include everything below them.

Capability✓ in scope · — not at this tierPilotOne facility, one service lineProductionProduction chart integrationAdvancedMultiple facilities / lines
Introduced at Pilot
Query drafting from your chart✓✓✓
Specialist approval✓✓✓
Query-compliance baseline✓✓✓
Introduced at Production
Reporting by service line—✓✓
Approval workflow in your systems—✓✓
Approved query write-back—✓✓
Record-system integration—✓✓
Introduced at Advanced
Multi-facility query rules——✓
Multi-stage specialist approvals——✓
High query volume——✓
Multi-facility query controls——✓
Build priceFrom $5,000From $8,000Custom quote
Final build price
Confirmed after discovery based on integrations, workflow complexity, transaction volume, approval controls and deployment requirements.
Separate from build
Build pricing is separate from recurring Agent Care, which covers managed monitoring, evaluations, incidents and verified improvements after launch.

What we need from you

What you bring, and what we build with it

Each input maps to a piece of build scope and a week in the delivery timeline.

  1. 01Your EHR access, chart sources and query history

    Chart ingestion and prior-query mapping

    Week 1
  2. 02Representative charts across query-type cohorts

    Draft baseline and indicator-citation extraction

    Week 2
  3. 03Your approved query templates and trigger rules

    Template and trigger-rule mapping

    Week 1
  4. 04Access to relevant APIs, feeds or exports

    Chart-source and coding-system assessment, then integration setup

    Week 2
  5. 05Queries you would not want sent

    Leading-query cases and failure-mode testing

    Week 4
  6. 06What no query may imply

    Confidence scoring, flag routing, guardrails and approval controls

    Week 3
  7. 07Named CDI specialists to approve drafted queries

    Specialist approval workflow, then pilot and production validation

    Weeks 5–6

Nothing else is required

Deployment, documentation and Agent Care handover are ours.

Delivery timeline

Four phases across six weeks

Each phase sits over the weeks it really occupies, and week 5 carries evaluation alongside the pilot.

Phase

W1

W2

W3

W4

W5

W6

  1. DiscoveryW1
  2. BuildW2 – W3
  3. EvaluateW4 – W5
  4. Pilot & LaunchW5 – W6

Week focus

W1Query workflow discovery, template mapping and the boundary

W2Chart-source integration and the drafting baseline

W3Drafting logic, confidence scoring and approval controls

W4Evaluation suite, guardrails and failure-mode testing

W5Query-system integration, pilot charts and corrections

W6One coding cycle queried under the CDI lead, then Agent Care handover

Reading the band
A bar covers the weeks its work is named in, and nothing else. The week 5 overlap is real, not padding.
At the end of W6
The last checks clear on live queries and Agent Care picks up monitoring.
Duration
Six-week plan shown · typical delivery 4–6 weeks depending on scope confirmed in discovery.

Next step · Healthcare AI agent

Build a CDI-query agent around your compliant-query workflow.

Show us your chart sources, your approved templates and who answers a query. The answer to every query stays with the treating clinician, entered in the record.

Typical delivery
4–6 weeks
Deployment
Your EHR and chart sources
Clinician-led
Post-encounter
After launch
Agent Care available

Nestack Agents · CDI query

AGT-HC-16 · Agent Care available after launch

Build a CDI-query agent

Four questions so the call starts from your actual setup — then pick a time that suits you.

About you
Your charts

No obligation. We’ll map the workflow, name the automation boundary and tell you if an agent is the wrong answer.