Skip to content

docs(databases): Unified Databases guide: create, context[] ingest, status with collection, refusals (OSS-117) - #408

Open
adityamishra-hydradb wants to merge 4 commits into
mainfrom
adityamishra/oss-117-unified-databases
Open

adityamishra-hydradb wants to merge 4 commits into
mainfrom
adityamishra/oss-117-unified-databases

Conversation

@adityamishra-hydradb

@adityamishra-hydradb adityamishra-hydradb commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

For humans

The public docs did not explain unified databases. A new user could not find how to create one, what to send, or why the quickstart fails on one (400 CORPUS_TYPE_UNSUPPORTED). This PR adds one guide page, Unified Databases (essentials/v2/unified-databases.mdx), under Core Concepts, after Databases and Collections.

The page covers:

  1. Split and unified layouts side by side.
  2. Create a unified database (type: "unified") and wait until it is ready.
  3. Find the layout: GET /databases/status returns "type": "unified". A split database has no type.
  4. Ingest with context[]: a text item and a conversation item, the request and item fields, and the limits (100 items, 1 MiB per item, 8 MiB per request, unknown fields refused).
  5. Poll the status with the same collection. Without it, the API reports each item as errored / FILE_NOT_FOUND while the item is still in progress.
  6. Query without type. A type is ignored with a type_ignored_on_unified warning.
  7. What a unified database refuses, with the real error messages.

Every example ran on prod (see Proof). Examples are Python and cURL. The TypeScript SDK that the docs test pins (2.1.8) has no context or type field yet, so the page has no TypeScript tab.

Not in this PR, and why:

  • BYOG page (OSS-117): it exists already: essentials/v2/bring-your-own-graph.mdx (endpoints, Cypher support, limits, errors). This page links to it for graph_payload.
  • Integrations page (OSS-111): PR 387 already adds pages and ecosystem cards for n8n, Zapier, Composio, Nango, Merge and AgentMail. A second page would duplicate it.

Merge order: after PR 400 (the spec on main has no context or type on POST /databases) and PR 407 (moves the examples test to hydradb-sdk 2.1.8, the first Python SDK with context and type). This branch is off main, not stacked.

For agents

  • Source of truth: application/internal/api/handler/context.go @Param context and memories.UnifiedIngestRequest / IngestItem in application/internal/domain/memories/unified_ingest.go (hydradb-application main).
  • scripts/test_docs_examples.py: the fake now checks context items (allowed keys, text XOR conversation, roles) and answers with each context_id. The helper sits next to FakeHydraDB, away from the lines PR 400 changes.
  • llms.txt regenerated with scripts/generate_llms_index.py.
  • Linear: OSS-117 (OSS-111 covered by PR 387).

Proof

A = base main @ 484c1ce / B = this PR @ 9248d8f

Audit re-run on 2026-12-04 (03:05 to 03:20 UTC) on the current head. Prod api.hydradb.com, own throwaway databases dogfood-audit-docs-408p (Python), -408c (cURL), -408s (split), -408q (SDK 2.1.7 try, never created); all deleted after. Node 24.11.0, Python 3.12, clean venvs. Raw outputs: ~/hydradb/dogfood/proof/mintlify-docs-408/.

1. A/B on the real repro

The finding: the docs did not explain unified databases. A user who follows the split-style docs on a unified database gets 400 CORPUS_TYPE_UNSUPPORTED.

Check A (base @484c1ce) B (PR @9248d8f)
docs.hydradb.com/essentials/v2/unified-databases (A = live site, built from main) HTTP 404 new page in the nav, after Databases and Collections
Non-archive pages that mention "unified" 2 (query.mdx, introduction.mdx), no how-to + the full guide (create, layout, ingest, poll, query, refusals)
Python blocks L35 + L87 + L200 + L231, run as written (SDK 2.1.8) no page create: ready, type = unified; ingest: refund-policy, chat-ana-0412 queued; status: both completed; query: both items returned
cURL L44 + L52 no page status type: unified, ready (rid fbf7dc49-5349-4e72-ad4e-85e658ec8d68)
cURL L115 JSON ingest no page 2 queued (rid cb8b5ce8-3477-4276-a0b2-da3342c7256a)
cURL L212 status with collection no page both completed (rid 0f600989-71ec-4a79-8125-149cdd8e1776)
cURL L240 query no page Refund policy with metadata {"team":"billing"}, additional_metadata {"source":"help-center"} (rid 0de65937-3c7e-4a78-b500-144df1533560)

Commands: python -I scripts/py_blocks.py (the 4 blocks copied verbatim from the page, acme_unified replaced by the test database; file python-blocks-prod.txt), scripts/curl_blocks.sh (file curl-blocks-prod.txt), live-docs-A.txt.

2. Regression: the CI validate steps

Command: docs-ci.sh <venv> (the CI steps in order, then pnpm mintlify validate and pnpm mintlify broken-links). Files ci-A-484c1ce-sdk2.1.7.txt, ci-B-9248d8f-sdk2.1.7.txt, ci-B408-merged-with-407-sdk2.1.8.txt, ci-B408+407+400-sdk2.1.8.txt.

Run A (base @484c1ce) B (PR @9248d8f)
unittest discover -s scripts, SDK 2.1.7 (CI pin today) 12 failing (pre-existing; validate is red on main) 17 failing: the same 12 + 5 page blocks (type/context missing from the 2.1.7 SDK and from main's openapi.json; L200 fails only because L87 did not run)
B merged with PR 407 (SDK 2.1.8), without PR 400 - 21: the 5 page blocks still fail on the spec check (main's spec has no type/context)
B merged with PR 407 and PR 400 @a51a850 (SDK 2.1.8), the stated merge order - 5 errors, 0 on this page. All 5 are app_knowledge samples (4 cookbooks + context.mdx:229), see PR 407
Contract, schema, consistency, agents endpoints, generate_llms_index.py --check pass pass

So the red validate check on this PR is expected until PR 400 and PR 407 merge. The page blocks pass in the merge order.

3. Smoke: build, links, and the prose claims on prod

Check A (base @484c1ce) B (PR @9248d8f)
pnpm mintlify validate passed passed
pnpm mintlify broken-links no broken links no broken links
Split database status has no type - <absent> (rid 3d1e83e0-212c-459b-9925-828ed44d1dad)
GET /databases details[] - {408c, type: unified}, {408s} (no type)
Query with type: memory - 2 chunks + type_ignored_on_unified (rid 464ac264-e53b-4932-806b-fa93b93e6581)
metadata_filters {"team":"billing"} - only Refund policy (rid 427ba6b4-e918-4e4e-9672-eff1f401089a)
Split database accepts context - queued (rid d345ba48-23ec-4592-9372-36ec4479252f)

4. Stress

N/A: a docs change. The one bound on the page (100 items) is checked as an edge case.

5. Edge cases (section 7 of the page, and the polling warning)

Case A (base @484c1ce) B (PR @9248d8f), prod result
Status without collection (in progress and after completed) not documented errored / FILE_NOT_FOUND both times (rids eac65066…, b4c9c6c0…)
type=memory on ingest not documented CORPUS_TYPE_UNSUPPORTED (rid ae19c79b-c66b-4e8f-a657-3e1c931c03b6)
Multipart memories not documented CORPUS_TYPE_UNSUPPORTED "this database is unified: send the content as context" (rid 7a2862ae…)
JSON memories not documented INVALID_INPUT unknown field, lists accepted fields (rid bd7184f4…)
text + conversation / role bot / 101 items / happened_at timestamp not documented INVALID_INPUT each (rids ed595617…, 2774f798…, 143dadd0…, c06db3f6…)
Python blocks on SDK 2.1.7 - TypeError: … unexpected keyword argument 'type'; the page says 2.1.8 or later

🤖 Generated with Claude Code

The public docs did not describe unified databases: how to create one
with type "unified", the context[] ingest shape, what a unified database
refuses, how to tell the layout, and that status polls need the ingest
collection. Add a guide with Python and cURL examples, a nav entry, a
link from Databases and Collections, and teach the examples test fake
the context[] shape.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: adityamishra-hydradb <[email protected]>
@adityamishra-hydradb

Copy link
Copy Markdown
Contributor Author

@hydra-mira-review review

@adityamishra-hydradb

Copy link
Copy Markdown
Contributor Author

/devin review

@mintlify

mintlify Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
cortex-ai 🟢 Ready View Preview Dec 4, 2026, 2:10 PM

💡 Tip: Enable Automations to automatically generate PRs for you.

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Starting Devin Review.

Devin Review

@hydra-mira-review

hydra-mira-review Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Mira score 5/5 · 🟢 Good to merge

  • No findings in the code.
  • Ship with or after: Python SDK upgrade supplied by PR 407.

Users get a guide to creating unified databases, ingesting content, checking progress, querying, and understanding rejected requests. The PR adds discovery links and extends example tests to validate context items and return their identifiers.

Before this ships · 1 with another PR, 1 in place
  • ⏳ Python SDK upgrade supplied by PR 407 (order), needed in scripts/requirements-test.txt and the validate CI job. scripts/requirements-test.txt still pins 2.1.7; PR 407 supplies 2.1.8, which the new Python examples require. Merge PR 407 before this PR so the example runner installs a compatible SDK.
  • ✅ OpenAPI support for unified creation and ingestion (schema), needed in api-reference/v2/openapi.json. The current schema declares creation type, JSON context items, and multipart context, covering the dependency attributed to PR 400.
How this PR works · 5 changes, 5 low risk

New users lacked a guide for unified databases and encountered errors when following split database examples. This PR documents creation, ingestion, polling, querying, and rejected inputs. It also extends the example checker and makes the guide discoverable.

1. Explain how to create and identify unified databases · 🟢 low risk · essentials/v2/unified-databases.mdx

Users gain a setup guide for a previously undocumented database layout. It compares layouts, demonstrates creation with type: "unified", waits for readiness, and explains layout discovery.

Risk: Incorrect setup guidance would leave users with the wrong layout or ingestion requests sent before their database is ready.

Check:

  • Check that the deployment's default layout matches the comparison table.

In unified-databases.mdx:1-76.

2. Document unified ingestion fields, limits, and refusals · 🟢 low risk · essentials/v2/unified-databases.mdx

Users gain working examples for sending text and conversations together. The guide describes context fields, replacement behavior, metadata, access restrictions, size limits, and rejected split inputs.

Risk: Incorrect ingestion guidance would cause rejected requests or lead users to replace existing items unintentionally.

Check:

  • Compare the refusal table with the deployed API's handling of multipart files and split fields.
  • Check that metadata and access restriction descriptions match the query contract.

In unified-databases.mdx:78-184, unified-databases.mdx:260-271.

3. Keep polling and querying in the ingestion collection · 🟢 low risk · essentials/v2/unified-databases.mdx

Users gain a complete path from queued items to retrieved results. Polling retains the ingestion collection, while querying omits the corpus selector and explains metadata filters and caller access checks.

Risk: Incorrect guidance would make users misread indexing failures, retrieve the wrong collection, or omit caller filtering for restricted items.

Check:

  • Check that every polling and query example uses the same collection as ingestion.
  • Read the warning that queries without acl can return restricted items.

In unified-databases.mdx:185-258.

  1. Validate unified ingestion in executable examples · 🟢 low risk · tests in test_docs_examples.py:189-198, test_docs_examples.py:221-228, test_docs_examples.py:263-274.
5. Supporting changes · 🟢 low risk · essentials/v2/databases-and-collections.mdx +2

Readers and agents can discover the new guide through navigation, the existing database page, and the generated documentation index.

Risk: Incorrect links would leave readers or agents unable to reach the new guide.

Check:

  • Check that Core Concepts places the new guide immediately after Databases and Collections.

In databases-and-collections.mdx:8, docs.json:67-73, llms.txt:72-77.

Requirement check · 9 met · from the PR description
  • ✅ Compare split and unified layouts (met). essentials/v2/unified-databases.mdx:13 compares creation, corpora, ingestion formats, selectors, and file uploads.
  • ✅ Show unified creation and wait for readiness (met). essentials/v2/unified-databases.mdx:24 provides Python and cURL creation examples with readiness checks.
  • ✅ Explain how status identifies unified and split databases (met). essentials/v2/unified-databases.mdx:61 documents the unified marker and its absence for split databases.
  • ✅ Show text and conversation ingestion, fields, limits, and unknown-field rejection (met). essentials/v2/unified-databases.mdx:78 includes both item forms, request and item tables, and the three stated size limits.
  • ✅ Poll with the ingestion collection and explain misleading missing-item errors (met). essentials/v2/unified-databases.mdx:185 retains support in polling and warns about errored results with FILE_NOT_FOUND.
  • ✅ Query without a corpus selector and explain ignored selectors (met). essentials/v2/unified-databases.mdx:223 omits type and documents type_ignored_on_unified in meta.warnings.
  • ✅ Document refused inputs and their error messages (met). essentials/v2/unified-databases.mdx:260 lists split selectors, split fields, conflicting content, invalid roles, and excessive item counts.
  • ✅ Provide Python and cURL examples with the Python SDK minimum version (met). essentials/v2/unified-databases.mdx contains both languages and states the 2.1.8 minimum; it adds no TypeScript examples.
  • ✅ Extend the fake to validate context items and return their IDs (met). FakeHydraDB.check_ingest_items validates unified shapes; FakeHydraDB.respond returns each submitted context_id.
⚠️ Other open PRs change the same code · 2

Merge them in order, or check that they agree.

  • #370 (duplicate effort + merge-conflict risk). Both teach unified databases and context ingestion while editing the same Databases and Collections guide and example validation script. Shared: essentials/v2/databases-and-collections.mdx, llms.txt, scripts/test_docs_examples.py
  • #365 (merge-conflict risk). The major rewrite also edits the Databases and Collections guide, creating a meaningful collision risk with its unified database updates. Shared: docs.json, essentials/v2/databases-and-collections.mdx, llms.txt

Comment @hydra-mira-review help for commands.

@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown

✅ Mintlify Hygiene

No issues found.

devin-ai-integration[bot]

This comment was marked as resolved.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: adityamishra-hydradb <[email protected]>
@adityamishra-hydradb

Copy link
Copy Markdown
Contributor Author

@hydra-mira-review review

@adityamishra-hydradb

Copy link
Copy Markdown
Contributor Author

/devin review

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Starting Devin Review.

Devin Review

hydra-mira-review[bot]

This comment was marked as resolved.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: adityamishra-hydradb <[email protected]>
@adityamishra-hydradb

Copy link
Copy Markdown
Contributor Author

@hydra-mira-review review

@adityamishra-hydradb

Copy link
Copy Markdown
Contributor Author

/devin review

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Starting Devin Review.

Devin Review

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: adityamishra-hydradb <[email protected]>
@adityamishra-hydradb

Copy link
Copy Markdown
Contributor Author

@hydra-mira-review review

@adityamishra-hydradb

Copy link
Copy Markdown
Contributor Author

/devin review

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Starting Devin Review.

Devin Review

This branch was successfully deployed

1 active deployment
staging — f9eca53d Deployed Dec 4, 2026 by mintlify[bot]
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.

1 participant