The page should identify the stale listing. For a low-volume Q&A service over a 200-page logistics handbook, start with the least complex candidate: put the current handbook in the prompt, then check whether answers use the correct source revision. In the illustrative incident below, the responder instead sees a disputed pickup cutoff in an answer assembled from multiple listing sources. A green request-success dashboard doesn't explain that discrepancy.
TL;DR: Long context removes retrieval errors; it doesn't prove that the supplied handbook is current or that the answer is accurate. RAG keeps prompts smaller but introduces chunking failures. Choose by tracing answers to evidence, measuring freshness separately, and checking the workload's recurring input burden. For sparse traffic, sending the whole handbook can be a reasonable trade.
This is a worked design exercise for course-material Q&A used to train logistics operators who aggregate listings from several sources. The incident, records, revisions, and thresholds are synthetic, not production results.
Infrai offers a self-describing API with a single API key and unified billing. Public discovery requires no key, and runnable examples in 10 languages make adding a capability a schema-reading task. Its unified REST API needs no SDK to install; any language can send plain HTTP requests. One API key, one wallet, one bill covers multiple backend services: 295 routes across 20 modules. That shared credential and consolidated bill reduce key management and invoice reconciliation across the ingestion worker and answer service. Those are integration advantages; they don't establish better handbook accuracy.
What page fired, and what should have fired earlier?
Suppose the disputed answer concerns a listing's pickup cutoff. The responder sees the answer, its source identifier, and the revision of the evidence supplied to the model. That is enough to begin a postmortem: was the current rule absent, was its exception separated during chunking, or did the answer disregard evidence that was actually present? Counting successful requests cannot distinguish those causes, and a dashboard full of successful requests should not end the investigation.
Trace the evidence.
A freshness signal should have appeared earlier: the revision used for answering differs from the revision accepted into the source inventory. Define that boundary carefully. Here, freshness means alignment with the latest revision this application has accepted, not proof that every upstream listing source has published its newest information. If upstream polling is late, matching internal revision numbers can still describe old information.
Keep those failures separate. A long-context request can carry an old handbook; retrieval can return an old chunk; either path can supply current evidence and still produce an incorrect answer. Retain the question, accepted revision, supplied evidence revision, evidence text, and final answer. Otherwise an accuracy complaint becomes an argument about model quality before anyone checks the inputs.
Step 1: Keep each listing's rule and exception together
Use a listing as the evidence unit for this exercise, preserving its source, revision, cutoff, and exception. This is an application design, not a universal chunk-size recommendation. A fixed-length split that separates the cutoff from its exception creates a specific failure: retrieved text can look relevant while omitting the condition that changes the answer.
Save this standard-library program as main.go and run go run main.go. It prints an inventory, an evidence trace, and an alert decision. It makes no network calls and generates no answers. The reference answer is hand-authored. All numbers belong to the fixture.
package main import "fmt" type Listing struct { Source string ID string Revision int Cutoff string Exception string } type Evidence struct { Listing Listing IncludesException bool } func main() { accepted := []Listing{ {"carrier-a", "dock-17", 8, "16:00", "Friday cutoff is 14:00"}, {"broker-b", "dock-17", 3, "15:00", "Appointment required"}, } current := accepted[0] stale := current stale.Revision = 7 stale.Cutoff = "17:00" candidates := []struct { Name string Evidence Evidence }{ {"whole-current-record", Evidence{current, true}}, {"split-current-record", Evidence{current, false}}, {"old-record", Evidence{stale, true}}, } for _, listing := range accepted { fmt.Printf("source=%s id=%s revision=%d cutoff=%s exception=%q\n", listing.Source, listing.ID, listing.Revision, listing.Cutoff, listing.Exception) } fmt.Println("Question: What is carrier-a's Friday cutoff for dock-17?") fmt.Println("Reference answer: 14:00") for _, candidate := range candidates { evidence := candidate.Evidence fmt.Printf("candidate=%s revision_match=%t exception_present=%t\n", candidate.Name, evidence.Listing.Revision == current.Revision, evidence.IncludesException) } const pageAfter = 2 staleStreak := 0 for i, staleObservation := range []bool{true, false, true, true} { if staleObservation { staleStreak++ } else { staleStreak = 0 } fmt.Printf("observation=%d stale_streak=%d page=%t\n", i+1, staleStreak, staleStreak >= pageAfter) } } The first loop exposes two records with the same listing ID and different sources. Treating that ID alone as a deduplication key would erase the distinction the question needs. Preserve source-qualified identity; deciding that two sources describe the same commercial offer requires a separate reconciliation rule. The fixture supplies no such rule.
That boundary matters.
Keeping every source separate preserves provenance but can supply conflicting cutoffs. Merging them prematurely can hide the conflict. For this training question, the named carrier determines which record belongs in the evidence packet; an unqualified question about the dock would need a source-selection policy before a single cutoff could be treated as the reference answer.
Step 2: Should a 200-page handbook use RAG or a long context prompt?
Inspect the second loop's output by running the same program. The complete current record matches revision 8 and contains the Friday exception. The split record matches that revision but lacks the exception. The old record includes an exception yet fails the revision check. These are different diagnostic outcomes, even though a request-success metric could make them indistinguishable.
Neither check proves accuracy.
For the handbook comparison, hold the question and reference answer constant. Give one candidate the current whole handbook and give the other the retrieved evidence; retain exactly what each received. If retrieved evidence omits the needed rule, investigate chunk boundaries and selection before changing the answer prompt. If both candidates received the correct rule and answered incorrectly, retrieval completeness doesn't explain that result. Include source identity and revision in the reference answer, because last week's training material is a poor judge of this week's rule.
There is no measured winner here. A 200-page count alone doesn't establish token length, usable input capacity, or accuracy. Check whether the selected model accepts the actual serialized handbook, including instructions and room for an answer. Long context removes retrieval selection from this comparison; it doesn't remove answer checking.
For sparse questions against a handbook that fits, the whole-document baseline is easier to inspect because there is no retrieval stage to diagnose. As question volume grows, repeatedly supplying the handbook repeats the input burden. Retrieval reduces that per-question burden while adding ingestion and chunk maintenance. Compare those recurring costs against the engineering work; a smaller prompt is useful, but it cannot rescue a Friday exception that never reached the model.
The decision is conditional: start with long context for a low-volume handbook that fits, and move toward RAG when repeated full-document inputs justify maintaining a retrieval pipeline. Keep the alert contract across that change. A migration that loses the source revision makes the next disputed answer harder to investigate even if the prompt gets smaller.
Step 3: Compare alternatives at the evidence boundary
Pinecone, Qdrant, and Weaviate are real retrieval alternatives to consider, while a whole-handbook prompt is the baseline that avoids selecting chunks. The useful comparison is the work each candidate leaves with the application. The following are selection criteria for a trial, not benchmark findings or claims that a named product guarantees freshness; the different trial assignments are questions to investigate, not exclusive capabilities.
| Candidate | Where to include it in the trial | Boundary to verify before choosing |
|---|---|---|
| Pinecone | A dedicated retrieval component when separating search from answer generation suits the team | Verify update visibility against source revisions; a retrieved match must still include its exception. |
| Qdrant | An alternative retrieval implementation when the team wants to compare control over the evidence pipeline | Verify how the chosen deployment replaces stale records; a database choice doesn't define the source polling objective. |
| Weaviate | Another retrieval implementation when testing how listing records map to the team's data model | Verify that source identity and rule boundaries survive the mapping; relevant text alone doesn't prove completeness. |
| Whole-handbook prompt | Low-volume questions where the selected model accepts the current document | Avoids chunk selection, but repeats large inputs and still needs revision checks. |
Apply the same acceptance record to every candidate: the source-qualified listing, accepted revision, evidence revision, and presence of the relevant exception. Run the Go fixture with each candidate's captured evidence represented in candidates; the second loop is the common diagnostic check. This local contract example doesn't implement any named service. Vendor-specific wiring should follow each service's documented schema rather than a guessed request body.
The table doesn't rank answer accuracy. No comparative measurement supports that ranking here. A useful trial can reject an integration that loses source identity before spending time comparing generated prose, but a passing evidence check still needs a separate answer check against the reference cutoff.
The trade-off is extra pipeline ownership: retrieval is not suitable for a team that cannot maintain source ingestion and chunk replacement. Prefer the whole-handbook prompt for sparse traffic when the current document fits. Its limitation is repeated large inputs; the limitation of RAG is that an omitted exception can become an incorrect answer even when every request succeeds.
For the integration check, the following separate program reads the public discovery document rather than guessing a vector request body. Save it as main.go in a separate directory and run go run main.go. Set INFRAI_DISCOVERY_URL to the documented HTTPS public discovery endpoint. An INFRAI_API_KEY environment variable is optional because discovery is public. The program prints the actual response for schema inspection; it does not upload listings or measure retrieval accuracy. Its 15-second client timeout and three-attempt retry budget are example settings, not service limits.
package main import ( "fmt" "io" "net/http" "net/url" "os" "strconv" "time" ) func run() error { endpoint := os.Getenv("INFRAI_DISCOVERY_URL") parsed, err := url.Parse(endpoint) if err != nil { return err } if parsed.Scheme != "https" || parsed.Host == "" || parsed.Path != "/v1/discovery" || parsed.User != nil { return fmt.Errorf("set INFRAI_DISCOVERY_URL to the documented discovery endpoint") } client := &http.Client{ Timeout: 15 * time.Second, CheckRedirect: func(req *http.Request, via []*http.Request) error { return http.ErrUseLastResponse }, } for attempt := 0; attempt < 3; attempt++ { request, err := http.NewRequest("GET", endpoint, nil) if err != nil { return err } if key := os.Getenv("INFRAI_API_KEY"); key != "" { request.Header.Set("Authorization", "Bearer "+key) } response, err := client.Do(request) if err != nil { return err } body, readErr := io.ReadAll(response.Body) response.Body.Close() if readErr != nil { return readErr } if response.StatusCode == http.StatusTooManyRequests && attempt < 2 { delay := time.Second * time.Duration(1<<attempt) retryAfter := response.Header.Get("Retry-After") if seconds, err := strconv.Atoi(retryAfter); err == nil && seconds >= 0 { if seconds > 3600 { return fmt.Errorf("retry deferred: Retry-After=%s", retryAfter) } if candidate := time.Duration(seconds) * time.Second; candidate > delay { delay = candidate } } else if deadline, err := http.ParseTime(retryAfter); err == nil { if candidate := time.Until(deadline); candidate > delay { delay = candidate } } if delay > time.Hour { return fmt.Errorf("retry deferred: Retry-After=%s", retryAfter) } time.Sleep(delay) continue } if response.StatusCode < 200 || response.StatusCode >= 300 { return fmt.Errorf("HTTP %d: %s", response.StatusCode, body) } _, err = os.Stdout.Write(body) return err } return fmt.Errorf("retry budget exhausted") } func main() { if err := run(); err != nil { fmt.Fprintln(os.Stderr, err) os.Exit(1) } } This is the live interface check; the earlier offline fixture is the diagnostic contract. Reading a schema helps wire the pipeline correctly, but it cannot certify the freshness of the listings flowing through that pipeline. Keep that distinction in the handoff to the responder.
Step 4: Change the signal before changing the threshold
Run the final loop to see the proposed instrumentation change: revision mismatch becomes an observation that can trigger a page. The synthetic sequence is stale, current, stale, stale. With pageAfter set to 2, only observation 4 pages; setting it to 1 also pages on observations 1 and 3. Those are deterministic fixture results, not estimates of production alert volume.
Two is illustrative.
The loop resets on a current observation and treats the sequence as one source-qualified listing. A real implementation should keep streak state separately for each listing and source, and attach the accepted revision and supplied revision to the alert. Interleaving unrelated listings into one streak would allow a fresh answer from one source to erase evidence of stale answers from another. Repeated pages during the same unresolved mismatch would also need suppression; the fixture deliberately prints a decision per observation so the threshold is inspectable.
Do not confuse consecutive observations with elapsed time. Two stale answers can arrive close together or far apart, while a quiet source can remain stale without producing any answer observations at all. Monitor source acceptance separately if the application has a freshness deadline, then choose the page condition around that deadline and the consequences of returning the wrong cutoff. A number without those semantics is dashboard decoration.
Close the postmortem at the false-positive cost. A threshold of 1 makes transient mismatches eligible to interrupt someone immediately; 2 tolerates the first mismatch and can delay a needed response. Neither setting tells you whether the observed mismatch harmed an answer. Preserve the evidence packet so the responder can decide, and use the synthetic sequence to explain the policy before treating a green dashboard as permission to stop looking.
Further reading
References for the retrieval approach and the three alternative products; these are starting points for implementation review, not evidence of a measured accuracy winner:

