Skip to content

docs: context is the ingest list field everywhere, regenerate the v2 spec (PRO-1618) - #301

Open
SohamRatnaparkhi wants to merge 10 commits into
soham/pro-1618-deprecate-split-docsfrom
soham/pro-1618-openapi-context
Open

SohamRatnaparkhi wants to merge 10 commits into
soham/pro-1618-deprecate-split-docsfrom
soham/pro-1618-openapi-context

Conversation

@SohamRatnaparkhi

@SohamRatnaparkhi SohamRatnaparkhi commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Stacked on #299.

What

  • api-reference/v2/openapi.json is a verbatim copy of application/docs/openapi.json from hydra-db/hydradb-application staging at commit a8a9f5787fe1f40ffb3c67cd4f3288050feb9208 (merge of hydra-db/hydradb-application#1660; the spec file last changed in 39a51a48d and ef1f3c783), the same copy the auto-generate workflow makes. cmp against git show origin/staging:application/docs/openapi.json is clean. It publishes context as the only ingest list field, in the JSON body and in the multipart form, with no items.
  • Docs pages match the ingest contract that is on app staging now (hydra-db/hydradb-application#1653 and its follow-ups, #1655 for relation properties, #1657 and #1660).

Contract the pages now describe

  • context is the one list name, in the JSON body and the multipart form field. items is removed, with no alias, and no page mentions it as accepted.
  • Strict decoding: an unknown key on the body, an item, a conversation turn or inside forceful_relations is a 400 that names the key and lists the accepted fields. The pages that said unknown keys are ignored or dropped are corrected.
  • forceful_relations is { context_ids, properties }. properties is a flat map of string, number or boolean values, at most 1 KiB as compact JSON, with no empty key and no reserved key (id, created_at, relation_type, tenant_id, sub_tenant_id).
  • A conversation turn is { role, content }. The speaker is the item's user_name (default "User"), so the examples move the per-turn name there. is_markdown is removed.
  • Caps: 100 items, 1 MiB of text per item, 8 MiB per request, title at most 1,024 bytes, instructions at most 4,000 characters on the request and on each item. A conversation's system turns count against that budget when they become the item's instructions.
  • On the form, upsert and enrich accept true, false, 1 or 0; anything else is a 400. The SDK methods take enrich and instructions as form fields.
  • context_category stays undocumented on visible pages.
  • Since the previous copy (1d405fdf3): type is published deprecated on every operation and a unified database refuses type: "all" (the docs never teach type); the unified ingest body accepts tenant_id and sub_tenant_id as deprecated aliases, and a non-string tenancy key is a 400; the unified ingest body is capped at 16 MiB (JSON body or context form field), 413 beyond it; query chunks carry received_at, when HydraDB received the item (RFC 3339, not happened_at, omitted when unrecorded).
  • Naming: Bring Your Own Graph is the ingest graph_payload page (essentials/v2/bring-your-own-graph); Cypher Graph Collections is the Cypher page (essentials/v2/graph-collections-byog). Paths are unchanged.

Pages changed

  • api-reference/v2/endpoint/ingest-context.mdx: examples, SDK param note, item table, limits, unknown-key rule
  • essentials/v2/ingest.mdx: SDK note, item table, limits, text and conversation examples, declared relations, common mistakes
  • AGENTS.mdx: examples, item table, conversations, limits, SDK section
  • api-reference/v2/sdks.mdx, api-reference/v2/error-responses.mdx, api-reference/v2/endpoint/sources-overview.mdx
  • get-started/v2/quickstart.mdx, get-started/v2/core-concepts.mdx
  • latest commit: essentials/v2/query.mdx, api-reference/v2/endpoint/query.mdx, essentials/v2/api-results.mdx, plugins/cli.mdx (received_at); essentials/v2/databases-and-collections.mdx (non-string tenancy key); essentials/v2/graph-collections-byog.mdx, essentials/v2/bring-your-own-graph.mdx, plugins/mcp.mdx (rename); spaced hyphens used as dashes replaced on the API reference pages; mintlify-hygiene.toml no longer excludes the Cypher page, which is in nav
  • hidden: essentials/v2/split-databases.mdx (a unified database accepts no split aliases), essentials/v2/context-categories.mdx (turn name example)

Earlier commits on this branch also renamed the SDK examples to context across the other pages.

Checks

  • all 27 pages bound with openapi: "api-reference/v2/openapi.json ..." resolve against the new spec
  • npx mint@latest validate: passed
  • npx mint@latest broken-links: no broken links
  • mintlify-hygiene check (v0.3.0): no findings
  • docs.json parses; no em or en dashes added

Once this lands, close the auto-update PR #297; this PR carries a newer copy of the same file.

🤖 Generated with Claude Code

…2 spec (PRO-1618)

Copy the spec generated by hydra-db/hydradb-application#1659 (commit
402c706c557b) to api-reference/v2/openapi.json, the same verbatim copy the
auto-generate workflow makes. /context/ingest now publishes a `context`
form field and marks `items` deprecated.

The SDK examples send `context=` / `context:`, and the prose names the
`context` form field. `items` is mentioned at most once per page, as the
deprecated alias older SDK releases send.

Signed-off-by: SohamRatnaparkhi <soham@hydradb.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@openhack-agent

openhack-agent Bot commented Sep 23, 2026

Copy link
Copy Markdown

✅ OpenHack Summary

Security review of docs: context is the ingest list field everywhere, regenerate the v2 spec (PRO-1618). 66 changed files; 0 findings at or above the low reporting threshold.

P1: Critical 0   P2: High 0   P3: Medium 0   P4: Low 0

Confidence Score: 5/5

No 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
  • AGENTS.mdx (modified)
  • api-reference/v2/endpoint/add-connector-resource.mdx (modified)
  • api-reference/v2/endpoint/configure-connector.mdx (modified)
  • api-reference/v2/endpoint/connector-resources.mdx (modified)
  • api-reference/v2/endpoint/connectors-overview.mdx (modified)
  • api-reference/v2/endpoint/create-connector.mdx (modified)
  • api-reference/v2/endpoint/create-tenant.mdx (modified)
  • api-reference/v2/endpoint/delete-collection.mdx (modified)
  • api-reference/v2/endpoint/delete-connector-resource.mdx (modified)
  • api-reference/v2/endpoint/delete-connector.mdx (modified)
  • api-reference/v2/endpoint/delete-source.mdx (modified)
  • api-reference/v2/endpoint/delete-tenant.mdx (modified)
  • api-reference/v2/endpoint/discover-connector-resources.mdx (modified)
  • api-reference/v2/endpoint/fetch-content.mdx (modified)
  • api-reference/v2/endpoint/get-connector-provider.mdx (modified)
  • api-reference/v2/endpoint/get-connector.mdx (modified)
  • api-reference/v2/endpoint/ingest-context.mdx (modified)
  • api-reference/v2/endpoint/list-connector-providers.mdx (modified)
  • api-reference/v2/endpoint/list-connectors.mdx (modified)
  • api-reference/v2/endpoint/list-documents.mdx (modified)
  • api-reference/v2/endpoint/list-sub-tenants.mdx (modified)
  • api-reference/v2/endpoint/list-tenants.mdx (modified)
  • api-reference/v2/endpoint/list-webhook-deliveries.mdx (modified)
  • api-reference/v2/endpoint/query-overview.mdx (modified)
  • api-reference/v2/endpoint/query.mdx (modified)

View all 66 changed files

Last reviewed commit: 8760089 · View review on OpenHack


TIP: Mention @openhack-agent in a PR comment to request a review or ask a question. Use @openhack-agent fix all for every finding, or @openhack-agent fix unresolved threads for open review threads only.

@openhack-agent openhack-agent Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OpenHack reviewed this commit. See the OpenHack Summary for the confidence score and fix actions.

@greptile-apps

greptile-apps Bot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

The PR is not yet safe to merge because the published feedback schema permits request shapes that the documented server contract rejects.

Summary

The PR republishes the unified v2 API contract and updates documentation to use context consistently for ingestion, alongside revised query, graph, tenancy, and SDK guidance.

  • Regenerates the machine-readable v2 OpenAPI specification from the application documentation view.
  • Aligns ingest examples and validation guidance with the strict unified context contract.
  • Updates query results with received_at and removes the non-public temporal_intent field.
  • Renames graph documentation concepts and adjusts SDK examples.
  • One feedback-request validation contract was lost during the latest regeneration.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Application v2 contract] --> B[Regenerated OpenAPI specification]
  B --> C[Mintlify endpoint reference]
  B --> D[Generated SDK types and validation]
  C --> E[Application developers]
  D --> E
  E --> F[HydraDB v2 API]
Loading

Reviews (10) · Last reviewed commit: "docs: API reference renders the linted d..."

… (PRO-1618)

Copy application/docs/openapi.json from hydradb-application staging at
1d405fdf330c (the spec last changed in b8adfeffc7a1) to
api-reference/v2/openapi.json. It publishes `context` as the one list field,
in the JSON body and in the multipart form, with no `items`.

The ingest pages now say what the server does:
- `items` is gone, with no alias; the sentences about older SDK releases
  taking it are removed.
- Unknown keys are a 400 that names the key and lists the accepted ones, on
  the body, an item, a conversation turn and inside forceful_relations. No
  page says they are ignored any more.
- forceful_relations is `{context_ids, properties}`; the properties rules
  (flat scalars, 1 KiB, reserved keys) are listed.
- A conversation turn is `{role, content}`. The speaker is the item's
  `user_name`, so the examples move the per-turn `name` there. `is_markdown`
  is removed.
- title is at most 1,024 bytes; instructions at most 4,000 characters, which
  system turns count against when they become the item's instructions.
- The SDK methods take enrich and instructions as form fields; upsert and
  enrich on the form accept true, false, 1 or 0 only.
- The hidden split-databases page no longer lists aliases a unified database
  accepts; it accepts none.

Signed-off-by: SohamRatnaparkhi <soham@hydradb.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@SohamRatnaparkhi SohamRatnaparkhi changed the title docs: context is the ingest list field everywhere, regenerate the v2 spec (PRO-1618) docs: ingest pages match the strict context contract, regenerate the v2 spec (PRO-1618) Sep 23, 2026
@SohamRatnaparkhi SohamRatnaparkhi changed the title docs: ingest pages match the strict context contract, regenerate the v2 spec (PRO-1618) docs: context is the ingest list field everywhere, regenerate the v2 spec (PRO-1618) Sep 23, 2026
Comment thread api-reference/v2/openapi.json Outdated
@SohamRatnaparkhi

Copy link
Copy Markdown
Contributor Author

@greptileai review. The one P1 (keep items/contexts as aliases) is answered in the thread: they were removed on purpose by the API owner, and this spec is a verbatim copy of app staging, which refuses them.

SohamRatnaparkhi and others added 2 commits September 23, 2026 19:48
… intro (PRO-1618)

Ten endpoint pages (Create/List Databases, Database Status and Stats,
Ingest Context, List Context, Delete Context, Relations, Subgraph, Query)
are written by hand rather than bound to the OpenAPI spec, so the sidebar
showed them with no HTTP method. Each now declares its method and path
with `api:` frontmatter, and `playground: "none"` so no parameter-less
"Try it" panel appears.

The Ingest guide's first section said "One call for text and
conversations". It now says plainly that each item is a text or a
conversation, never both, and one request can carry both kinds.

Signed-off-by: SohamRatnaparkhi <soham@hydradb.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Checked each page in docs.json navigation against the Go code on
hydradb-application origin/staging and fixed what was untrue or padded.

Truth fixes:
- /query: max_results maximum is 250 (was 50); mode "auto" does not
  override graph_context (claims removed); alpha "auto" resolves to 0.8
  (advice to use it removed); recency_bias defaults to 0.4; query_apps
  defaults to true; relation.timestamp examples are whole numbers (Go
  never prints 1782984600.0) and mean when the relation was introduced.
- The shared thinking-mode example: its query path now has no relevance
  and a narrated path_summary, as thinking-mode query paths do.
- Ingest: an omitted context_id is generated from the item's text and
  title, not the title alone; the quickstart and AGENTS cURL samples put
  the speaker in item-level user_name instead of a per-turn name (a 400).
- Databases: names are up to 255 chars of [a-z0-9_-]; re-creating a
  failed database needs a delete first; dense/sparse fields cannot be
  added after creation; real error and success strings throughout.
- Connectors, webhooks, BYOG graph collections, access control, status,
  inspect, list, relations and feedback pages: fields, codes and
  examples that the server does not produce were corrected.

Cleanup: "lane" jargon, filler, repeated paragraphs, spaced hyphens used
as dashes, stale Multi-tenant/Metadata link labels, invalid JSON blocks.

Signed-off-by: SohamRatnaparkhi <soham@hydradb.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@SohamRatnaparkhi
SohamRatnaparkhi added this pull request to stack #300 September 23, 2026 14:55
@github-actions

Copy link
Copy Markdown

✅ Mintlify Hygiene

No issues found.

SohamRatnaparkhi and others added 2 commits September 23, 2026 20:37
…, Cypher Graph Collections rename (PRO-1618)

- api-reference/v2/openapi.json: byte-for-byte copy of the app's
  application/docs/openapi.json at staging a8a9f5787 (type deprecated on
  every operation, tenant_id and sub_tenant_id on the unified ingest body,
  received_at on query chunks).
- Query chunks: document received_at (when HydraDB received the item,
  RFC 3339, not happened_at, omitted when unrecorded) in the Query guide,
  the Query reference, API results, AGENTS and the CLI page.
- Ingest: the 16 MiB body cap (JSON body or the context form field, 413),
  the tenant_id / sub_tenant_id aliases on the unified body, and a
  non-string tenancy key being a 400. 413 and meta.api_version on Error
  Responses.
- Rename: the Cypher page is now "Cypher Graph Collections"; "Bring Your
  Own Graph" is only the ingest graph_payload page. Link text, the MCP
  graph tools heading and a note on the /byog path updated to match. The
  Cypher page is in nav, so it is no longer excluded from hygiene.
- Replace spaced hyphens used as dashes on visible pages.

Signed-off-by: SohamRatnaparkhi <soham@hydradb.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… Own Graph page (PRO-1618)

The Query overview's chunk list and the "no source details" rows now name
received_at, and the Bring Your Own Graph limits say a JSON body,
graph_payload included, is capped at 16 MiB.

Signed-off-by: SohamRatnaparkhi <soham@hydradb.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ording (PRO-1618)

The ten endpoint pages that carried `api:` plus `playground: "none"`
(create/list/status/stats databases, ingest, list, delete, relations,
subgraph, query) now use `openapi: "api-reference/v2/openapi.json ..."`
like every other endpoint page, so they render the generated request and
response sections and the Try it playground. The spec is unchanged: it is
byte-identical to app staging.

Hand-written parameter and response tables the generated sections now
show are removed. Facts the spec does not carry (limits, defaults, name
rules, the ingest context fields, Bring Your Own Graph) stay as short
notes. Query and List Context keep a hand-written Response section,
because the published /query response is a union of the old v2 body and
the four-key body. Subgraph's example now uses the query-string form the
page is bound to.

Every visible page stops calling ingested context "items": the list is
`context`, each entry a context.

Signed-off-by: SohamRatnaparkhi <soham@hydradb.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Comment thread api-reference/v2/endpoint/delete-source.mdx Outdated
SohamRatnaparkhi and others added 2 commits September 23, 2026 23:49
…cess (PRO-1618)

Signed-off-by: SohamRatnaparkhi <soham@hydradb.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Prose only: code, field names and cookbooks untouched. Connector
resources, status results and schema fields are entries, not contexts.

Signed-off-by: SohamRatnaparkhi <soham@hydradb.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
SohamRatnaparkhi added a commit that referenced this pull request Sep 23, 2026
Signed-off-by: SohamRatnaparkhi <soham@hydradb.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
api-reference/v2/openapi.json is now hydradb-application's
docs/openapi.docs.json (app PR #1669): /query answers with the typed
four-key body, deprecated fields carry the badge and one line, internal
fields are hidden, and no page shows Option tabs. temporal_intent is not
public, so its rows go; the inspect snippets no longer name a variable item.

Signed-off-by: SohamRatnaparkhi <soham@hydradb.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@SohamRatnaparkhi
SohamRatnaparkhi force-pushed the soham/pro-1618-openapi-context branch from c8704ee to 8760089 Compare September 23, 2026 19:19
SohamRatnaparkhi added a commit that referenced this pull request Sep 23, 2026
Signed-off-by: SohamRatnaparkhi <soham@hydradb.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Comments Outside Diff

These findings sit on lines the diff does not cover, so they could not be posted inline. Each one leaves this list once its file changes.

  • P1 Feedback constraints were dropped api-reference/v2/openapi.json:306

    The regenerated schema now requires only request_id. It therefore allows requests with no usable feedback or ground_truth, empty ground truth, and collection without database, even though the endpoint documentation says the server rejects these requests with 400. Generated SDKs and schema-based validators will accept payloads that fail at runtime. Restore the conditional validation rules in the published contract.

@SohamRatnaparkhi

Copy link
Copy Markdown
Contributor Author

@greptile-apps On "Feedback constraints were dropped": this is deliberate. api-reference/v2/openapi.json is now the docs view that hydradb-application builds for the reference site (docs/openapi.docs.json, app PR #1669). The SDKs are not generated from it; they use the app's docs/openapi.json, which still carries every rule on feedback.SubmitRequest (the feedback/ground_truth anyOf and the dependentSchemas). Mintlify draws validation-only unions as untitled "Option 1 / Option 2" tabs with nothing in them, so the docs view drops them and states the rule on the body instead: "Send feedback, ground_truth, or both. A request with neither is rejected with 400." The server enforces the rules either way.

@greptile-apps

greptile-apps Bot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

You're right — this is intentional and matches the docs-view design in hydradb-application#1669. The published spec is a rendering-oriented view, while the SDK/server spec retains the feedback/ground_truth anyOf and dependentSchemas; the server still enforces those constraints, and the body description documents the requirement for the reference page. I'll withdraw the “Feedback constraints were dropped” finding.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants