docs: unified ingest and query contract (PRO-1618), stacked on #296 - #298
SohamRatnaparkhi wants to merge 6 commits into
Conversation
✅ OpenHack SummarySecurity review of docs: unified ingest and query contract (PRO-1618), stacked on #296. 20 changed files; 0 findings at or above the low reporting threshold. Confidence Score: 5/5No reportable security findings were detected in this scan. Security merge-readiness rubric: 1 = critical, 2 = high, 3 = medium, 4 = low, 5 = no reportable findings. This score reflects scan findings, not a guarantee of correctness or complete coverage. Files Needing Attention: None Important Files Changed
Last reviewed commit: c42b52c · View review on OpenHack
|
|
✅ Mintlify HygieneNo issues found. |
…618) Stacked on #296. Documents POST /context/ingest and POST /query on a unified database exactly as the PRO-1618 contract: the `context` list key, both item shapes with every field, request-level defaults, graph_payload keyed by context_id, limits and refused fields, the multipart `items` form field for SDK users, the 202 result item (source_id/infer), and the four-key query response (chunks, graph, relations, llm_prompt) with citation labels. Removes build_string guidance from unified pages and moves every old response field into "Split databases" sections. Fixes the context_category wording so `auto` means no label rather than server classification. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: SohamRatnaparkhi <soham@hydradb.com>
…penAPI (PRO-1618) The published spec still describes the split-era shapes for these operations, so the generated panels contradicted the rewritten prose. Both pages already carry the contract by hand; dropping the openapi frontmatter leaves the authored content as the only word on the wire. Signed-off-by: SohamRatnaparkhi <soham.ratnaparkhi@gmail.com> Signed-off-by: SohamRatnaparkhi <soham@hydradb.com>
…ta (PRO-1618) The unified /query response renamed its declared-relation list from `relations` to `forceful_relations`, the same word the ingest item and the follow_forceful_relations switch use. Every unified page now says so, and the llm_prompt section is documented as `=== FORCEFUL RELATIONS ===` with its guide line. graph[] paths now carry `origin` (`query_path` or `chunk_relation`). The Query page gains "Attaching graph paths to chunks": group hops by relation.chunk_id against chunks[].chunk_id, a chunk_relation hop names exactly the chunk it hangs under, and chunk_id -> context_id comes from chunks[] and forceful_relations[].chunk. This is what replaces chunk_id_to_group_ids, and the split mapping table points at it. The unified meta is request_id, api_version, latency_ms, database and collection, with no tenant_id, sub_tenant_id or source_type. Both query pages now show a real rendered response verbatim (request_id replaced with a placeholder), and their request examples use the single collection that response names. Split sections are unchanged. Signed-off-by: SohamRatnaparkhi <soham@hydradb.com> Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…PRO-1618) The server's prompt builder now renders llm_prompt as a markdown document instead of the `=== SECTION ===` text layout, so every unified page that showed or described the old string now shows what the API returns. The sections, in order: `# Query results` (the query, a Found count and the cite-by-number line), `## Results` (`### n. title`, a relevance / collection / type / category line, an id / last-updated line, the content and its enrichment, `---` between results), `## Forceful relations` (`### Rn. title` with `Linked from` in place of relevance), `## Related facts` (one `- [Pn] **A** -pred→ **B** (query path) [1]` line per path, Pn being the path's position in graph[], with the path summary under it), `## Temporal facts` and `## Sources`. Results cite as [n], forceful relations as [Rn], facts as [Pn]; each fact carries the results it was extracted from. An empty result renders "". - Query guide: the example envelope's llm_prompt and chunk temporal text are the server test's output; the llm_prompt section documents the sections, the labels, how a multi-hop chain reads (continue from the chain's end, `←pred-` for a reversed edge, `; ` for a new segment), and that build_string returns llm_prompt verbatim. - Query endpoint reference: same example, the using-the-response note and the llm_prompt row name the markdown sections and labels. - How to Use API Results: the verbatim prompt and a section table with the new headings and labels. - Context graphs: the Related facts excerpt, and how the page's two-hop billing path reads (rendered with the real builder). - Query overview and Split databases: the llm_prompt rows, and build_string returning llm_prompt verbatim on a unified database. Split sections and archive pages are unchanged. Signed-off-by: SohamRatnaparkhi <soham@hydradb.com> Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…RO-1618) Every unified /query example now carries the prompt the server renders at the current app head, and the prose describes what changed since: - Related facts carry each path's relevance after reranking, as in "(query path, relevance 0.81)"; a path with no reranked score prints none, and graph[] itself carries no score. - Temporal facts set the evidence phrase apart after a ";". - Sources print only http(s) links, never a storage location. - path_summary is never empty: the hops are narrated when the server wrote no summary, and the prompt does not repeat that narration. - A chunk_relation path is returned only when one of its hops came from a returned chunk or a forceful_relations chunk. - Unified ingest answers "Context queued for ingestion successfully" followed by the poll-status hint, on the ingest guide and reference. The two JSON examples and the unescaped copies are the server test's llm_prompt character for character; the Context graphs excerpt is an exact substring of it. Signed-off-by: SohamRatnaparkhi <soham@hydradb.com> Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…(PRO-1618) A unified /query chunk now carries enrichment as a plain string, and the declared context_category as a sibling enrichment_kind field (user_preference, business_knowledge or decision_trace). enrichment is omitted when empty; enrichment_kind is omitted when no category was declared and is present even when enrichment is omitted. The same shape applies to forceful_relations[].chunk. The TypeScript SDK spells them enrichment and enrichmentKind. - Both unified response examples are the server's own envelope at the current app head, with the docs' placeholder request_id and latency_ms. - Field tables, the llm_prompt section tables, the SDK loops, the context_category field on the ingest reference, the category guide and the split-to-unified mapping row describe the new fields. - The decision-trace graph fragment carries its origin. Split pages are unchanged. Signed-off-by: SohamRatnaparkhi <soham@hydradb.com> Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
a8a661a to
c42b52c
Compare
Stacked on #296 (
tushar/pro-1618-unified-docs). Documents the PRO-1618 unified API contract forPOST /context/ingestandPOST /queryexactly as implemented (app #1625 and the ingest-contract PR stacked on it), and moves every split-era field on unified pages into a "Split databases" section. No page was added or removed;docs.jsonis unchanged and every touched page is still in the nav.Pages changed
Ingest
essentials/v2/ingest.mdx: request body with thecontextlist key (aliases noted,contextis what to send), both item shapes, every item field with a one-line meaning, request-levelenrich/upsert/instructionsdefaults,graph_payloadkeyed bycontext_id, limits (100 items, 1 MiB per item, 8 MiB per request,context[N]errors), the refused split-era fields, the multipartitemsform-field note for SDK users, the real 202 response (messageisContext queued for ingestion successfullyplus the poll-status hint; result items carrysource_id,title,status,infer,error,error_code), declared relations, and a before/now table from the Linear field-level diffs.api-reference/v2/endpoint/ingest-context.mdx: unified head (JSON body, item field table withcontext_categoryreturned on query asenrichment_kind, limits, refused fields, 202 response with the realmessage) with the existingdocuments/app_knowledge/memoriesreference kept verbatim under a demoted## Split databasessection.api-reference/v2/endpoint/sources-overview.mdx: endpoint table and concepts lead withcontext[]; split shapes moved to their own section.Query
essentials/v2/query.mdx: rewritten. Request withouttype, withattributes(operator filter),follow_forceful_relations(aliasquery_forceful_relations),titles,ids,acl, temporal fields; the response as exactlychunks,graph,forceful_relations,llm_promptwith every field described and one complete example (a real server-rendered envelope,request_idandlatency_msplaceholders); each chunk (andforceful_relations[].chunk) carriesenrichmentas a plain string, omitted when empty, and the declaredcontext_categorybeside it asenrichment_kind(user_preference,business_knowledgeordecision_trace; omitted when none was declared, present even withoutenrichment),enrichmentKindin the TypeScript SDK;llm_promptdocumented as the markdown document the server emits (# Query results,## Results,## Forceful relations,## Related facts,## Temporal facts,## Sources), its labels[1]/[R1]/[P1](P ingraph[]order), each related fact's relevance after reranking ((query path, relevance 0.81), omitted when a path has no reranked score), the temporal evidence phrase set apart after;, web-only source links (nevers3://...),path_summarynever empty (narrated from the hops when the server wrote none, and then not repeated under the chain), achunk_relationpath returned only when one of its hops came from a returned orforceful_relationschunk, how a multi-hop chain reads, and that the SDKbuild_stringhelpers return it verbatim, with a two-line inject snippet; the note that chunks carry no source details andGET /context/inspect?database=..&id=<context_id>returns them; old fields only in the "Split databases" section.api-reference/v2/endpoint/query.mdx: unified request example, request-body table, four-keyResponseExample(the same real envelope, withenrichmenta string andenrichment_kindbeside it), behavior notes;type,query_forceful_relations,metadata_filtersand the old response shape moved to## Split databases.api-reference/v2/endpoint/query-overview.mdx: decisions are now scope / match / mode;attributesandfollow_forceful_relationsin the parameter table; response summary is the four keys, withllm_promptdescribed as markdown.essentials/v2/api-results.mdx:build_stringguidance removed from the unified path (the server buildsllm_prompt, andbuild_stringreturns it verbatim there); inject snippets, the verbatim markdown prompt with a section and label table, structured reads (enrichmentandenrichment_kind,enrichmentKindin the TypeScript loop),GET /context/inspectfor source details;build_stringkept in a "Split databases" section.essentials/v2/context-graphs.mdx:graph[]paths withtriplets({ entity_id, name }entities,{ predicate, context, temporal_details, relationship_id, chunk_id }relations) andpath_summary;query_paths/chunk_relations/chunk_id_to_group_idsonly in the split section; prompt section now shows the## Related factssection ofllm_prompt(- [P1] **A** -pred→ **B** (query path, relevance 0.81) [1]lines, an exact excerpt of the real envelope) and how a multi-hop chain reads.Get started and concepts
get-started/v2/quickstart.mdx: cURL body usescontext; SDK tabs keep theitemsform field with a comment; results readcontent,path_summaryandllm_prompt, with the inject snippet.get-started/v2/core-concepts.mdx,get-started/v2/introduction.mdx:contextlist key, four-key response, no auto-classification.essentials/v2/context-categories.mdx:automeans no label (nothing infers a category, per the contract); JSON examples usecontext; decision-trace graph example in the contract shape; the label comes back asenrichment_kindbeside a stringenrichment.essentials/v2/split-databases.mdx:items->context; full split-to-item and split-to-unified response field mappings (chunk_contentmaps tocontentplus a stringenrichmentandenrichment_kind; includingfollow_forceful_relations,forceful_relations[],llm_prompt, andbuild_stringreturningllm_promptverbatim on a unified database); dropped thegraph.paths[],forceful_relations.declaredandis_memoryclaims that contradicted the contract; section 6 now separates/query(context_id, no attributes) from list/inspect/PATCH names.essentials/v2/architecture.mdx,essentials/v2/databases-and-collections.mdx,essentials/v2/semantic-search.mdx:typeremoved from flows and examples, weightedcollectionsfor personalization,attributesinstead ofmetadata_filters, four-key response.essentials/v2/access-control.mdx:aclshown on acontextitem instead ofapp_knowledge.essentials/v2/attributes.mdx: lead-in note mappingattributes/custom_attributes/attributesfilter to themetadata/additional_metadata/metadata_filtersnames the body still uses (body unchanged).essentials/v2/glossary.mdx: "Context item" and "Unified and split databases" entries.api-reference/v2/index.mdx: concept and inventory rows for context items and the unified query.Checks
mintlify broken-links: no broken links.npx mint@latest validate: build validation passed.llm_promptshown (both JSON examples, the unescaped copies on Query and How to Use API Results) is the server test's rendered prompt character for character; the Context graphs excerpt is an exact substring of it.docs.json(no nav changes needed).npm run hygienecould not run: the installer's checksum step fails on macOS (sha256sumflag mismatch), unrelated to these docs.Not in this PR
api-reference/v2/openapi.jsonis generated from the application repo and still carries the split-era/queryresponse and multipart ingest schemas; the auto-rendered request/response panels on the two endpoint pages will follow the next spec sync. The prose on those pages is the contract.AGENTS.mdx,plugins/*,cookbooks/*still describe the split flow and need their own pass.🤖 Generated with Claude Code