In this article

The query works in the database console. It finds the installations that depend on a retiring service, follows them to their subscriptions and returns the supporting paths. The data is correct under the model the team has agreed.

The agent still tells an account manager that no customers need attention.

In this fictional incident, the agent called a wrapper that returned an empty list when an upstream lookup timed out. The model interpreted the response as a complete search with no matches. The reasoning query was correct. The interface around it had turned an unavailable answer into a negative one.

An empty result says no matching records were found within the stated scope. An unavailable source does not establish that result. The wrapper turned one into the other, and the model read it as a complete search with no matches.

This is the gap between having a useful knowledge representation and making it a dependable part of an application. A domain model has to survive source synchronization, query boundaries, permissions, caching and the agent's interpretation of what comes back.

Return the scope of the answer

For a service-retirement investigation, I would not expose only a list of customer identifiers. The result needs to say which question was evaluated, which cases are supported and whether the evaluation covered its intended population.

A simplified response might look like this:

{
  "service": "legacy-auth",
  "technical_exposures": [
    {
      "installation": "I-204",
      "subscription": "S-17",
      "evidence_id": "E-412"
    }
  ],
  "unresolved_installations": [
    {
      "installation": "I-205",
      "reason": "deployment_source_unavailable"
    }
  ],
  "coverage": "partial",
  "knowledge_release": "12"
}

These are illustrative fields, not a complete API specification. Their purpose is to distinguish an established technical exposure from a case the service could not evaluate. Neither is yet a decision to send a contractual notice.

The evidence reference can lead to the source versions, rule evaluation and dependency path. The agent does not need every detail in its first context window, but it needs a way to inspect the basis of an important result. It can then investigate the unresolved installation or explain why the list is provisional.

This should be reinforced through interface validation and application behavior. A prompt asking the model to be careful does not compensate for an API that collapses timeout, access denial and a genuinely empty result into the same value.

A domain operation need not restrict investigation

There is a choice between giving the agent a general query interface and exposing only fixed business operations. I would usually separate the operational path from the exploratory one.

A supported operation such as finding technical exposures can supply the agreed semantics, access controls and evidence structure. A read-only query capability can let an appropriately authorized agent investigate a new hypothesis or an unusual case outside that operation's scope.

The distinction is the status of the result, not whether exploration is allowed. An ad hoc query is a candidate analysis until its interpretation has been checked. A reviewed domain operation provides a maintained contract that other applications can rely on within its stated limits.

This arrangement gives the agent useful freedom. It can follow evidence, compare configurations and discover that the existing operation omits a relevant concept. A successful investigation can become a proposed extension to the shared capability instead of remaining a one-off answer.

Exploration is allowed. What differs is the status of the result: an ad hoc query is a candidate analysis until its interpretation is checked, while a reviewed operation is a maintained contract other applications can rely on.

It also gives the team somewhere to improve performance. A stable, heavily used operation can be optimized without rewriting every agent prompt. More general exploration can have separate resource limits because its workload is less predictable.

Define what a coherent read means

Suppose the subscription service has recorded a migration, but the dependency projection still describes the old installation. Reading the newest available value from each system does not guarantee that their combination describes a state that existed together.

Even within one database, the isolation level affects whether successive queries share a snapshot. PostgreSQL's Read Committed level can use a new snapshot for each command, whereas Repeatable Read maintains a transaction snapshot. Neither setting automatically coordinates a separate search index and an external API.

For a periodic retirement report, a completed set of source batches may provide an adequate consistency boundary. An interactive investigation might use current sources and expose that they are not synchronized. A higher-consequence operation may need to revalidate authoritative state before committing an action.

The boundary must match the business requirement. There is little value in promising universal instantaneous consistency if the use case needs a daily planning report. There is also little value in a millisecond query over an obsolete projection when the application presents it as a current operational decision.

I would make freshness measurable at the relevant source and relationship level. The highest event timestamp observed is not, by itself, proof that every earlier event has arrived. A completeness claim needs support from the ingestion protocol, a completed snapshot or another explicit condition. Otherwise a dashboard can be green while an earlier correction is still missing.

Permissions and caches are part of the meaning

Two users can legitimately receive different answers because their access differs. The service must not imply that an inaccessible relationship does not exist. It also cannot necessarily reveal the existence of a hidden customer merely to explain that the result is incomplete.

I would define authorized response behavior for these cases rather than exposing raw errors from each source. Sometimes a caller can be told that the result is limited to their accessible scope. Sometimes even the count of excluded cases would reveal information the application is not entitled to disclose.

Derived knowledge needs the same care. A summary can reveal a fact about a restricted source without quoting it. Filtering documents after calculating an aggregate is therefore not a sufficient general access-control design. The permission model must cover the deductions and summaries the service returns, with deliberate rules for any approved disclosure.

Caching has a related trap. The same natural-language question may depend on a different tenant, caller scope, business date or knowledge release. Reusing an answer merely because the text matches can silently import the wrong context.

For a supported operation, I would cache a structured result under the parameters and dependencies that determine it. How much invalidation to do is a workload decision: broad release-based invalidation is simpler, while dependency-aware invalidation can retain more useful cached work. Either approach has to address the actual source and policy changes that could invalidate the answer.

An answer is not permission to commit an action

At 10:00, the service identifies a migration task. At 10:05, someone completes that migration. At 10:10, an agent acts on its earlier result.

No improvement to the earlier graph traversal removes this race. The command that changes operational state must check the relevant current preconditions. Where the state belongs to one transactional system, that check and the write should be coordinated there. Where the action spans systems, the design needs an explicit account of partial failure and recovery rather than an assumption that a graph snapshot supplies a distributed transaction.

No improvement to the earlier traversal removes this race. The command that changes state checks its preconditions at commit time and rejects a stale decision or reports the operation as already done.

For a notice workflow, I would distinguish preparing a draft from recording approval and initiating delivery. Repeated tool calls should not create duplicate business actions. The command service can reject a stale decision, identify an already completed operation or return a new state that the agent can investigate.

This does not mean every action needs a person to click approve. It means the application's authority and concurrency model, rather than a conversational assertion, determine whether the operation may proceed.

Test the boundary, not only the query

The evaluation should include the evidence returned to the agent and the meaning the application attaches to it. A correct database result is only one checkpoint.

I would test a source outage, a delayed correction, an ambiguous identity, a revoked permission and an action whose preconditions change after planning. For each, the expected behavior should be explicit. The system might return a supported partial result, request review or reject a stale command. It should not invent a complete answer because the interface lacks a way to express the limitation.

ConditionRequired result behavior
A required source is unavailableReturn an explicitly unavailable response or an authorized partial result. Describe missing coverage only where the caller is permitted to know it; do not reveal restricted entities, counts, or sources through an error message.
A relevant correction has not reached a derived view or cacheExpose the version or freshness limits relevant to the operation, and follow the agreed invalidation or recomputation policy. Do not promise that the next request automatically sees the correction.
Ambiguous identityRetained as unresolved, never merged to shorten the list
Revoked permissionResult limited to the accessible scope, without revealing what was excluded
Preconditions change after planningThe command is rejected as stale or reported as already done

The output also needs a check for claims that exceed its evidence. If the service established technical exposure for the accessible population, the explanation must not turn that into “all affected customers have been identified”. This is a narrower, more testable problem than asking whether the response sounds trustworthy.

The knowledge service should eventually make the agent more capable: faster at reaching a supported result, better at locating uncertainty and able to investigate new cases with reusable context. Achieving that requires carrying the domain's meaning through the interfaces and operational behavior, not stopping once the graph query works.

Sources and scope · 18 September 2026
  • PostgreSQL documentation, Transaction Isolation, particularly Read Committed and Repeatable Read.
  • The service-retirement workflow and response examples are design examples. They illustrate interface, consistency, authorization, and update requirements; no production performance or end-to-end test result is claimed here.