From 558c648b6b44b7ae6cb754de505d4b70a9512415 Mon Sep 17 00:00:00 2001 From: adityashrivastavaa <288670127+adityashrivastavaa@users.noreply.github.com> Date: Tue, 17 Nov 2026 22:13:02 +0000 Subject: [PATCH 1/2] docs: align executable examples with public ingest contract Signed-off-by: adityashrivastavaa <288670127+adityashrivastavaa@users.noreply.github.com> Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --- AGENTS.mdx | 127 ++------------ api-reference/v2/endpoint/ingest-context.mdx | 100 +---------- .../v2/endpoint/update-source-metadata.mdx | 13 +- essentials/v2/connectors.mdx | 24 +-- essentials/v2/context.mdx | 157 +++--------------- essentials/v2/metadata.mdx | 84 +++------- 6 files changed, 84 insertions(+), 421 deletions(-) diff --git a/AGENTS.mdx b/AGENTS.mdx index 26705e4b..35721004 100644 --- a/AGENTS.mdx +++ b/AGENTS.mdx @@ -60,7 +60,7 @@ Raw HTTP responses are wrapped: - `metadata`: schema-aligned fields, declared at database creation; the fast filter path. Filter on them with top-level `metadata_filters` keys. - `additional_metadata`: free-form fields; anything not in the `metadata` schema. Filter on them with `metadata_filters.additional_metadata`. -- Set both per source on `/context/ingest`: on each `document_metadata[]` item (file uploads), each `app_knowledge[]` item, or each memory item. There is no top-level `metadata` or `additional_metadata` form field. +- Set both per source on `/context/ingest`: on each `document_metadata[]` item (file uploads), or each memory item. There is no top-level `metadata` or `additional_metadata` form field. Schema fields, placement, and filter operators are in [10. Metadata guide](#10-metadata-guide). @@ -234,14 +234,14 @@ Forceful relations are links you declare between sources at ingest: ``` - Use `ids`. -- Declare `relations` on `document_metadata[]` and `app_knowledge[]` items. They link knowledge sources; memory items do not take `relations`. +- Declare `relations` on `document_metadata[]` items. They link knowledge sources; memory items do not take `relations`. - A query pulls the related chunks into `additional_context` only in `mode: "thinking"` with `query_forceful_relations: true` (the default). ### Access control A source's `acl` lists who may retrieve it; a query's `acl` says who is asking. The query-side rule is in [Send `acl` on user queries](#send-acl-on-user-queries). -- Set `acl` on `app_knowledge[]` items at ingest, or on any existing source with `PATCH /context/{id}/metadata`, where it replaces the stored list. +- Set `acl` on an existing source with `PATCH /context/{id}/metadata`, where it replaces the stored list. - Connectors copy permissions from Slack, Google Drive, GitHub, Confluence, Jira, and other providers on every sync. - Principals: an email (`grace@acme.com`), `domain:acme.com`, `group::`, or `__public__`. - On a query, the caller's email also matches its `domain:` principal and `__public__` automatically. Group membership is never derived from an email; send `group:` principals yourself. @@ -251,7 +251,7 @@ Example: a source with `"acl": ["grace@acme.com"]` comes back for a query with ` ### Connectors -Connectors sync context from 70 apps, including Slack, Gmail, Google Drive, Notion, Jira, Confluence, GitHub, Linear, HubSpot, and Zendesk, into a database on a schedule, with no ingestion code. Prefer a connector over hand-written `app_knowledge` ingestion when the app is in the catalog; `GET /connectors/providers` lists it. +Connectors sync context from 70 apps, including Slack, Gmail, Google Drive, Notion, Jira, Confluence, GitHub, Linear, HubSpot, and Zendesk, into a database on a schedule, with no ingestion code. Use connectors for app content; the public ingest endpoint does not accept provider-shaped app sources; `GET /connectors/providers` lists it. Setup is four calls, made once: @@ -352,7 +352,7 @@ SDK naming: - Python methods and fields are snake_case: `databases.get_metadata_schema()`, `page_size`, `query_by`. - TypeScript methods and fields are camelCase: `databases.getMetadataSchema()`, `pageSize`, `queryBy`. -- Values passed as JSON strings (`memories`, `app_knowledge`, `document_metadata`) keep snake_case keys inside the stringified payload in both SDKs, because that is raw wire data. +- Values passed as JSON strings (`memories`, `document_metadata`) keep snake_case keys inside the stringified payload in both SDKs, because that is raw wire data. --- @@ -554,7 +554,6 @@ The collections, stats, and delete routes also take `database` as a query parame | `upsert` | default `true`; replaces existing sources with the same ID | | `documents` | binary file uploads for knowledge | | `document_metadata` | JSON-stringified array, one item per uploaded file; see [Knowledge from files](#knowledge-from-files) | -| `app_knowledge` | JSON-stringified object/array of pre-extracted app sources | | `memories` | JSON-stringified array of memory items | ### Knowledge from files @@ -603,59 +602,9 @@ with open("policy.pdf", "rb") as f: ### Knowledge from app sources -Use `app_knowledge` when you already extracted the text from Slack, Gmail, Jira, Linear, Zendesk, Notion, Confluence, Salesforce, webpages, and so on. +Use [connectors](/essentials/v2/connectors) for app content. The current public ingest contract accepts file uploads and memories, not provider-shaped app-source payloads. For text your application owns, use the file upload example above. -```ts -await client.context.ingest({ - type: "knowledge", - database: "acme_corp", - appKnowledge: JSON.stringify([ - { - id: "slack_C123_1715012345_000100", - title: "Pricing discussion - Slack #product", - kind: "message", - provider: "slack", - external_id: "1715012345.000100", - url: "https://slack.com/archives/C123/p1715012345000100", - timestamp: "2025-01-15T12:30:00Z", - fields: { - kind: "message", - body: "We agreed on three tiers: Starter, Pro, and Enterprise.", - author: "alice", - thread_id: "1715012345.000100", - created_at: "2025-01-15T12:30:00Z", - }, - metadata: { - channel: "product", - workspace: "acme", - }, - additional_metadata: { - slack_ts: "1715012345.000100", - }, - relations: { - ids: ["slack_thread_root_001"], - }, - } - ]), -}); -``` - -Recommended app-source fields: - -| Field | Why send it | -|---|---| -| `id` | stable HydraDB ID and upsert key | -| `title` | readable result/citation title | -| `kind` | what the record is: `email`, `message`, `ticket`, `knowledge_base`, `comment`, `meeting`, or `custom` | -| `provider`, `external_id` | the app it came from and its ID there | -| `fields` | the record's content and structure for that kind, such as `body`, `author`, and `thread_id`; `fields.kind` must equal `kind` | -| `metadata` | fast filters such as channel, project, region, workspace | -| `additional_metadata` | provider IDs, status, assignee, timestamps | -| `url` | citation / navigation link | -| `timestamp` | freshness and chronology | -| `relations.ids` | thread, parent/child, linked issue, related source expansion | - -Kinds in OpenAPI are `email`, `message`, `ticket`, `knowledge_base`, `comment`, `meeting`, and `custom`. An older shape with `type` and `content.text` in place of `kind` and `fields` is still accepted; do not use it in new code. See [Context](https://docs.hydradb.com/essentials/v2/context.md) for the keys each kind takes in `fields`. At minimum provide a stable `id`, `kind`, `fields`, and the `metadata` you filter on. +Kinds in OpenAPI for connector-synced app sources are `email`, `message`, `ticket`, `knowledge_base`, `comment`, `meeting`, or `custom`. ### Memories @@ -1252,7 +1201,7 @@ Section 1, critical rules: Sections 2 to 7, ingestion and lifecycle: - [ ] Uploading a file with an unsupported extension, such as source code, and polling an ID that was rejected with `E1002`. -- [ ] Hand-writing `app_knowledge` ingestion for an app a connector already syncs. +- [ ] Sending unsupported app-source form fields instead of using a connector or uploading a file. - [ ] Editing an existing connector resource with `POST /connectors/{id}/resources`, which returns `409` and changes nothing. - [ ] Querying right after database creation without polling readiness. - [ ] Querying right after ingestion without polling `context.status` or using webhooks. @@ -1375,66 +1324,22 @@ curl -s -X POST 'https://api.hydradb.com/query' \ | jq '.data.chunks' ``` -### 15.2 Raw HTTP: ingest app-source knowledge +### 15.2 Raw HTTP: upload text knowledge -The raw HTTP form of [Knowledge from app sources](#knowledge-from-app-sources). `app_knowledge` must be a JSON string in multipart form data. +Upload text with the supported `documents` and `document_metadata` form fields. For app content, use a connector. -```bash -curl -s -X POST 'https://api.hydradb.com/context/ingest' \ +```bash cURL +printf 'Authentication controls are reviewed quarterly.\n' | \ +curl -X POST 'https://api.hydradb.com/context/ingest' \ -H "Authorization: Bearer $HYDRADB_API_KEY" \ -H "API-Version: 2" \ -F "type=knowledge" \ -F "database=acme_corp" \ - -F 'app_knowledge=[ - { - "id": "slack_C123_1715012345_000100", - "title": "Pricing discussion - Slack #product", - "kind": "message", - "provider": "slack", - "external_id": "1715012345.000100", - "url": "https://slack.com/archives/C123/p1715012345000100", - "timestamp": "2025-01-15T12:30:00Z", - "fields": { - "kind": "message", - "body": "We agreed on three tiers: Starter at $29, Pro at $79, Enterprise at $199.", - "author": "alice", - "thread_id": "1715012345.000100", - "created_at": "2025-01-15T12:30:00Z" - }, - "metadata": { - "channel": "product", - "workspace": "acme" - }, - "additional_metadata": { - "slack_ts": "1715012345.000100" - }, - "relations": { - "ids": ["slack_thread_root_001"] - } - } - ]' -``` - -Query it with app-aware retrieval: - -```bash -curl -s -X POST 'https://api.hydradb.com/query' \ - -H "Authorization: Bearer $HYDRADB_API_KEY" \ - -H "API-Version: 2" \ - -H "Content-Type: application/json" \ - -d '{ - "database": "acme_corp", - "query": "What pricing tiers did product agree on?", - "type": "knowledge", - "query_by": "hybrid", - "mode": "thinking", - "query_apps": true, - "graph_context": true - }' | jq '.data.chunks' + -F "collection=default" \ + -F "documents=@-;filename=auth-controls.txt;type=text/plain" \ + -F 'document_metadata=[{"id":"auth-controls-001","metadata":{"department":"security","priority":7,"summary_label":"quarterly access control review"},"additional_metadata":{"author":"alice","doc_version":3}}]' ``` ---- - ## 16. Navigation and support - Guides: `https://docs.hydradb.com/essentials/v2/context` and the other Core Concepts pages diff --git a/api-reference/v2/endpoint/ingest-context.mdx b/api-reference/v2/endpoint/ingest-context.mdx index 270b0a32..a9f11cf1 100644 --- a/api-reference/v2/endpoint/ingest-context.mdx +++ b/api-reference/v2/endpoint/ingest-context.mdx @@ -1,6 +1,6 @@ --- title: "Ingest Context" -description: "Store documents, app sources, and memories for your AI." +description: "Store documents and memories for your AI." openapi: "api-reference/v2/openapi.json POST /context/ingest" --- @@ -11,7 +11,6 @@ Ingest context into a database in one multipart request. Ingestion is asynchrono | Payload | Send | Use for | | --- | --- | --- | | Documents | `type: "knowledge"` and `documents` | Binary uploads that HydraDB should parse: PDFs, Office and iWork files, spreadsheets, images, and plain text. See [Supported file formats](#supported-file-formats). | -| App sources | `type: "knowledge"` and `app_knowledge` | Text and metadata your application has already extracted from an app (Slack threads, Notion pages, emails, tickets). See [Context](/essentials/v2/context#send-app-sources). | | Memories | `type: "memory"` and `memories` | Preferences, decisions, inferred behavior traits, and past conversations your agent should remember in future sessions. See [Context](/essentials/v2/context#2-save-memories). | @@ -62,11 +61,10 @@ curl -X POST 'https://api.hydradb.com/context/ingest' \ | | Replace existing sources with the same ID. Set to `false` to error on conflict: a document or app source whose ID exists comes back `failed` with `error_code: "E9003"`. (default=`true`) | | | Binary uploads, **knowledge only**. Required when `type=knowledge` and you want HydraDB to parse documents. Omit when ingesting memories. See [Supported file formats](#supported-file-formats). (default=`[]`) | | | One entry per file in `documents`, in the same order. The counts must match, or the request returns `400`. If omitted, documents index with inferred defaults such as filename/title. See [item fields](#examples-and-item-fields). | -| | Pre-extracted source objects (Slack, Notion, web pages, etc.), **knowledge only**. See [item fields](#examples-and-item-fields). | | | Map of source ID to your own entities and relations. Replaces LLM graph extraction for each keyed source. Works for `type=knowledge` and `type=memory`. See the "Bring your own graph" example in [item fields](#examples-and-item-fields) and the [Bring Your Own Graph](/essentials/v2/bring-your-own-graph#using-byog-without-cypher) guide. | | | Memory items, **memory only**. Required and non-empty when `type=memory`. The form field is plural `memories`, even though `type` is singular `memory`. See [item fields](#examples-and-item-fields). | -- **Multipart, not JSON:** This endpoint uses `multipart/form-data`. Stringify all JSON arrays (`document_metadata`, `app_knowledge`, `memories`) before placing them in the form field. A body that is neither a form nor JSON returns `415`. +- **Multipart, not JSON:** This endpoint uses `multipart/form-data`. Stringify all JSON arrays (`document_metadata`, `memories`) before placing them in the form field. A body that is neither a form nor JSON returns `415`. - **`202 Accepted` means queued, not indexed:** A successful response only confirms your sources were accepted, not that they are ready to query. Before querying, poll [`GET /context/status`](/api-reference/v2/endpoint/source-status) with the returned IDs until each source reaches `graph_creation` (searchable), `completed`, or `errored`. Alternatively, register a webhook for `indexing.status_changed` events (see [Webhooks](/api-reference/v2/endpoint/webhooks-overview)). - **Memory and knowledge:** Use `type: "memory"` for memory ingestion, listing, and deletion. Use `type: "all"` on `POST /query` when results should combine both. @@ -107,7 +105,7 @@ Files with no readable text fail with [`E2002`](/api-reference/v2/error-response | `.heic` `.heif` `.avif` | Export the photo as JPEG or PDF | | `.svg` `.ico` | Export as PNG or JPEG | | `.html` `.htm` `.xml` | Save the page as PDF | -| `.eml` `.msg` | Save the message as PDF, or send it as an app source | +| `.eml` `.msg` | Save the message as PDF, or sync it through a supported connector | | `.epub` `.wpd` | Convert to PDF or DOCX | | `.zip` | Upload the files individually | @@ -144,7 +142,7 @@ Files rejected with `E1002` have no ingestion status record. Handle the format e ## Shared item fields -Items in `document_metadata`, `app_knowledge`, and `memories` share three fields. The per-type tables under [Examples and item fields](#examples-and-item-fields) list only what differs. +Items in `document_metadata` and `memories` share three fields. The per-type tables under [Examples and item fields](#examples-and-item-fields) list only what differs. | Field | Description | | --- | --- | @@ -220,7 +218,7 @@ See [Metadata Filters](/essentials/v2/metadata#2-the-two-layers) for choosing me Those seven, plus the deprecated aliases `source_id` and `file_id` (for `id`) and `document_metadata` (for `additional_metadata`), are the only keys accepted. Anything else (including `title`, `type`, `url` and `timestamp`) is rejected with a `400` naming the unsupported key, rather than being silently dropped. - In particular, a document's **title is derived, not settable**. It defaults to the uploaded filename and is returned as `source_title` on query results and `title` on `/context/list`. It cannot be overridden at ingest, and [`PATCH /context/{id}/metadata`](/api-reference/v2/endpoint/update-source-metadata) only merges `additional_metadata` and `database_metadata`. Use `additional_metadata` for your own display fields, or ingest through `app_knowledge`, whose items carry an explicit `title`. + In particular, a document's **title is derived, not settable**. It defaults to the uploaded filename and is returned as `source_title` on query results and `title` on `/context/list`. It cannot be overridden at ingest, and [`PATCH /context/{id}/metadata`](/api-reference/v2/endpoint/update-source-metadata) only merges `additional_metadata` and `database_metadata`. Use `additional_metadata` for your own display fields. @@ -292,91 +290,9 @@ curl -X POST 'https://api.hydradb.com/context/ingest' \ - - - - ```python Python SDK - import json - - client.context.ingest( - type="knowledge", - database="acme_corp", - collection="team_docs", - app_knowledge=json.dumps([ - { - "id": "slack_thread_001", - "title": "Pricing discussion", - "kind": "message", - "provider": "slack", - "external_id": "1716213600.000100", - "fields": {"kind": "message", "body": "We agreed on three tiers...", "author": "alice"}, - "metadata": {"channel": "product"}, - } - ]), - ) - ``` - - ```typescript TypeScript SDK - await client.context.ingest({ - type: "knowledge", - database: "acme_corp", - collection: "team_docs", - appKnowledge: JSON.stringify([ - { - id: "slack_thread_001", - title: "Pricing discussion", - kind: "message", - provider: "slack", - external_id: "1716213600.000100", - fields: { kind: "message", body: "We agreed on three tiers...", author: "alice" }, - metadata: { channel: "product" }, - }, - ]), - }); - ``` - - ```bash cURL - curl -X POST 'https://api.hydradb.com/context/ingest' \ - -H "Authorization: Bearer " \ - -H "API-Version: 2" \ - -F "type=knowledge" \ - -F "database=acme_corp" \ - -F "collection=team_docs" \ - -F 'app_knowledge=[ - { - "id": "slack_thread_001", - "title": "Pricing discussion", - "kind": "message", - "provider": "slack", - "external_id": "1716213600.000100", - "fields": { "kind": "message", "body": "We agreed on three tiers...", "author": "alice" }, - "metadata": { "channel": "product" } - } - ]' - ``` - - +App content reaches HydraDB through [connectors](/essentials/v2/connectors). The current public ingest contract does not accept an app-source form field. Upload files with `documents` and `document_metadata`, or use `memories` with `type=memory`. - | Field | Description | - | --- | --- | - | | Required. Send an empty string to have one generated upstream. See [shared item fields](#shared-item-fields). | - | | Optional. If sent, must match the form-level `database`. | - | | Optional. If sent, must match the form-level `collection`. | - | | Short title or subject shown in query results. | - | | Optional long-form description. | - | | Canonical URL or reference link. | - | | ISO-8601 timestamp (creation or last-updated). | - | | App object kind: `email`, `message`, `ticket`, `knowledge_base`, `comment`, `meeting`, or `custom`. Selects the parser for `fields`. | - | | App namespace such as `slack`, `gmail`, `jira`, or `notion`. | - | | The provider's ID for this exact item. Enables exact lookup and relation resolution. | - | | App-native content and structure (`body`, `description`, `title`, or `data`, by `kind`). `fields.kind` must match `kind`. See [Context](/essentials/v2/context#send-app-sources). | - | | Older generic payload, `{ "text": "..." }`. Prefer `kind` and `fields`, which let app-aware retrieval see authors, threads, and parents. | - | | See [shared item fields](#shared-item-fields). | - | | See [shared item fields](#shared-item-fields). | - | | Optional related attachments. (default=`[]`) | - | | Relations to other sources: `{ "ids": [...] }` as on `document_metadata` items, or the typed `[{ "predicate", "target" }]` list described in [Context](/essentials/v2/context#6-link-sources-that-belong-together). | - | | Principals allowed to retrieve this source. Omit to leave it unrestricted. A malformed principal rejects the whole request with `400`. See [Query](/essentials/v2/query#6-query-on-behalf-of-a-user). | - +Connector app-source kinds are `email`, `message`, `ticket`, `knowledge_base`, `comment`, `meeting`, or `custom`. These describe synced sources, not an accepted ingest form field. @@ -581,7 +497,7 @@ curl -X POST 'https://api.hydradb.com/context/ingest' \ | Field | Description | | --- | --- | - | | Top-level key: a `document_metadata` id or `app_knowledge` item id for `type=knowledge`, or a memory `id` for `type=memory`. Value is that source's graph. A key matching no source returns `400`. | + | | Top-level key: a `document_metadata` id for `type=knowledge`, or a memory `id` for `type=memory`. Value is that source's graph. A key matching no source returns `400`. | | | Map keyed by a caller-local id; each value is an entity. The key is only a handle for `relations` to reference. It is not stored. | | | Entity name. Normalized (lowercased) server-side so it matches at query time. At most 256 chars. | | | Entity type (e.g. `PERSON`, `POLICY`). Stored as supplied. | diff --git a/api-reference/v2/endpoint/update-source-metadata.mdx b/api-reference/v2/endpoint/update-source-metadata.mdx index 99edf7ca..6591fa9e 100644 --- a/api-reference/v2/endpoint/update-source-metadata.mdx +++ b/api-reference/v2/endpoint/update-source-metadata.mdx @@ -4,6 +4,8 @@ description: "Merge database metadata and additional metadata into one existing openapi: "api-reference/v2/openapi.json PATCH /context/{id}/metadata" --- +import { Field } from "/snippets/field.jsx"; + Update one existing source's metadata or ACL without re-ingesting its content. Changes also apply to the indexed chunks used by Query and List Context. See [Metadata Filters](/essentials/v2/metadata#6-update-metadata-without-re-ingesting) for the metadata workflow. ```http @@ -123,18 +125,23 @@ curl -X PATCH 'https://api.hydradb.com/context/policy_main/metadata' \ ## Request rules - `collection` is required. This endpoint does not default it. -- At least one of `database_metadata`, `additional_metadata`, `acl`, or `acl_inherit: true` is required. -- `acl` combined with `acl_inherit: true` is invalid. `acl_inherit: false` or omitted is a no-op and can accompany `acl`. Inheritance is rejected for uploads and sources without connector resource attribution. +- Send a supported metadata edit or an explicit ACL replacement. The current public contract does not expose an inheritance-restoration flag. - `database_metadata` merges into the source's `metadata`, and its keys must satisfy the database metadata schema when one exists. `additional_metadata` merges into the source's free-form `additional_metadata`. - The endpoint does not accept `metadata` or `document_metadata`. +| Field | Update behavior | +| --- | --- | +| | Merge values into the source's declared metadata fields; omitted keys are preserved. | +| | Merge free-form values; omitted keys are preserved. | +| | Replace the complete ACL. Omit to keep it; `[]` or `null` makes the source private. This does not restore connector-resource inheritance. | + ## How updates apply - Metadata keys included in the request are added or overwritten. Omitted keys keep their existing values. - Sending `acl` replaces the entire stored ACL, so send the complete new list. `[]` or `null` revokes access for everyone. Omit `acl` to keep the stored list. See [Query](/essentials/v2/query#6-query-on-behalf-of-a-user). -- Sending `acl_inherit: true` removes the source's own ACL and immediately uses its connector resource permissions. This can widen access. Later connector syncs can replace the ACL because ACL writes use last-writer-wins behavior. See [Restore resource permissions](/essentials/v2/connectors#restore-resource-permissions). +- An explicit ACL replacement is not a request to restore connector-resource inheritance. See [Update a source's access rule](/essentials/v2/connectors#restore-resource-permissions). - The source must already exist. This endpoint does not create sources. - The endpoint edits one source at a time. Bulk metadata edits are not supported. - Updated metadata is visible to [`/query`](/api-reference/v2/endpoint/query) metadata filters and [`/context/list`](/api-reference/v2/endpoint/list-context) filters. diff --git a/essentials/v2/connectors.mdx b/essentials/v2/connectors.mdx index efbb8d6c..e6688ecc 100644 --- a/essentials/v2/connectors.mdx +++ b/essentials/v2/connectors.mdx @@ -5,7 +5,7 @@ description: "Connect Slack, GitHub, Notion, or any of 70 apps, and HydraDB keep HydraDB syncs data from 70 apps into your database without ingestion code on your side. You connect an account once, choose which resources (channels, repositories, pages) to sync, and HydraDB keeps them indexed as searchable [app sources](/essentials/v2/context#send-app-sources). The catalog includes Slack, Gmail, Google Drive, Notion, Jira, Confluence, GitHub, Linear, HubSpot, Zendesk, Supabase, Microsoft Teams, Outlook, Zoom, Gong, and Fireflies. It grows often; call [`GET /connectors/providers`](/api-reference/v2/endpoint/list-connector-providers) for the current list. -If an app is not in the catalog, or you already have your own integration, ingest its data yourself as [app sources](/essentials/v2/context#send-app-sources). +If an app is not in the catalog, or you already have your own integration, [upload text your application owns as a file](/essentials/v2/context#upload-files). The public ingest contract does not accept a provider-shaped app-source payload. @@ -593,27 +593,11 @@ The change applies to already-synced sources on the next query, with no re-sync. If HydraDB cannot read a resource ACL from the provider, [Get Connector Status](/api-reference/v2/endpoint/get-connector-status) reports an `acl_warning` until the next successful read. Your own resource rule still applies; a resource with no rule is readable by everyone. -### Restore resource permissions + -To remove a source's own ACL and use its connector resource permissions again, send `acl_inherit: true` without `acl` to [Update Source Metadata](/api-reference/v2/endpoint/update-source-metadata). Use the ID of a source synced by a configured connector. Uploads and manually ingested sources have no connector resource to inherit from. +### Update a source's access rule -```bash cURL -curl -X PATCH 'https://api.hydradb.com/context/confluence-page-9f62/metadata' \ - -H "Authorization: Bearer $HYDRADB_API_KEY" \ - -H "API-Version: 2" \ - -H "Content-Type: application/json" \ - -d '{ - "database": "acme_corp", - "collection": "engineering", - "acl_inherit": true - }' -``` - -`acl` combined with `acl_inherit: true` is invalid. `acl_inherit: false` or an omitted `acl_inherit` is a no-op and can accompany `acl`. HydraDB rejects inheritance for uploads and sources without connector resource attribution. - - -Inheritance takes effect immediately and can widen access if the resource allows more people than the source's own ACL. The source then follows future permission changes from that resource. Provider-specific source permissions can replace the inherited state on a later sync because ACL writes use last-writer-wins behavior. - +[Update Source Metadata](/api-reference/v2/endpoint/update-source-metadata) accepts an explicit `acl` replacement. The current public contract does not expose a flag for restoring connector-resource inheritance. Do not send an inheritance flag or treat an empty ACL as a request to restore inheritance; use the endpoint's documented ACL semantics. Deleting a connector resource rule does not widen access on its own. To open a restricted resource, set its ACL to `["__public__"]`. diff --git a/essentials/v2/context.mdx b/essentials/v2/context.mdx index c5cb8ea2..a4add403 100644 --- a/essentials/v2/context.mdx +++ b/essentials/v2/context.mdx @@ -130,92 +130,9 @@ The key list is closed. Any other key, including `title`, `type`, `url`, and `ti ### Send app sources -When your application already holds the text and fields of a Slack message, a Jira ticket, a Notion page, or a CRM record, send it as an **app source** instead of a file. HydraDB keeps the app's structure: the author, the thread, the ticket's status, and the links between records. +Use [connectors](/essentials/v2/connectors) to sync messages, tickets, pages and CRM records from supported apps. The current public ingest contract does not accept an app-source form field. To ingest text your application owns, [upload a text file](#upload-files); the upload is a file source, not a provider-shaped message or ticket. -The request goes to the same endpoint, with `app_knowledge` in place of `documents`. One request can carry both. `kind` says what the record is (`email`, `message`, `ticket`, `knowledge_base`, `comment`, `meeting`, or `custom`), and `fields` carries its content. An app source can also carry an `acl`, the list of principals allowed to retrieve it. The [field reference](#field-reference) lists the keys each kind takes in `fields`. - - - -```python Python SDK -import json - -result = client.context.ingest( - type="knowledge", - database="acme_corp", - app_knowledge=json.dumps([ - { - "id": "slack_C01_1716213600_000100", - "title": "Pricing discussion - Slack #product", - "kind": "message", - "provider": "slack", - "external_id": "1716213600.000100", - "fields": { - "kind": "message", - "body": "We agreed on three tiers: Starter at $29, Pro at $79, Enterprise at $199.", - "author": "alice", - "thread_id": "1716213600.000100", - "created_at": "2026-05-20T10:00:00Z", - }, - "metadata": {"channel": "product", "status": "finalized"}, - "additional_metadata": {"slack_ts": "1716213600.000100"}, - } - ]), -) -``` -```typescript TypeScript SDK -const result = await client.context.ingest({ - type: "knowledge", - database: "acme_corp", - appKnowledge: JSON.stringify([ - { - id: "slack_C01_1716213600_000100", - title: "Pricing discussion - Slack #product", - kind: "message", - provider: "slack", - external_id: "1716213600.000100", - fields: { - kind: "message", - body: "We agreed on three tiers: Starter at $29, Pro at $79, Enterprise at $199.", - author: "alice", - thread_id: "1716213600.000100", - created_at: "2026-05-20T10:00:00Z", - }, - metadata: { channel: "product", status: "finalized" }, - additional_metadata: { slack_ts: "1716213600.000100" }, - }, - ]), -}); -``` -```bash cURL -curl -X POST 'https://api.hydradb.com/context/ingest' \ - -H "Authorization: Bearer $HYDRADB_API_KEY" \ - -H "API-Version: 2" \ - -F "type=knowledge" \ - -F "database=acme_corp" \ - -F 'app_knowledge=[ - { - "id": "slack_C01_1716213600_000100", - "title": "Pricing discussion - Slack #product", - "kind": "message", - "provider": "slack", - "external_id": "1716213600.000100", - "fields": { - "kind": "message", - "body": "We agreed on three tiers: Starter at $29, Pro at $79, Enterprise at $199.", - "author": "alice", - "thread_id": "1716213600.000100", - "created_at": "2026-05-20T10:00:00Z" - }, - "metadata": { "channel": "product", "status": "finalized" }, - "additional_metadata": { "slack_ts": "1716213600.000100" } - } - ]' -``` - - -The response has the same shape as a file upload, with one entry per app source in `data.results`. - - +Connector app-source kinds are `email`, `message`, `ticket`, `knowledge_base`, `comment`, `meeting`, or `custom`. Their fields describe synced sources; they are not a form field accepted by the public ingest endpoint. ## 2. Save memories @@ -607,73 +524,52 @@ Forceful relations are links you declare between knowledge sources when you inge This is separate from the context graph HydraDB builds on its own. Use forceful relations for documents that belong together when the text does not say so: a contract and its addendum, or a runbook and its troubleshooting guide. They link whole **sources**. To declare the entity and relation graph within one document, replacing extraction for it, use [Bring Your Own Graph](/essentials/v2/bring-your-own-graph#using-byog-without-cypher). -On a file, set `relations.ids` on its `document_metadata` item. On an app source, set `relations.ids` the same way, and name the relationship in `app_relations` so the link also carries a predicate. `relations.ids` is what makes the linked text come back with query results; a named relationship alone connects the sources without requesting their text. +On a file, set `relations.ids` on its `document_metadata` item. Connector relationships are managed by the connector; do not send app-source payloads to the public ingest endpoint. -This Notion guide links to a troubleshooting page already ingested with the HydraDB `id` `auth-troubleshooting`. Ingest that page first and wait for `completed`. +This text-file guide links to a troubleshooting source already ingested with id `auth-troubleshooting`. Ingest that source first and wait for `completed`. ```python Python SDK +import io +import json + client.context.ingest( type="knowledge", database="acme_corp", - app_knowledge=json.dumps([ - { - "id": "auth-guide", - "title": "Authentication Guide", - "kind": "knowledge_base", - "provider": "notion", - "external_id": "AUTH-GUIDE", - "fields": {"kind": "knowledge_base", "title": "Authentication Guide", "body": "..."}, - "relations": {"ids": ["auth-troubleshooting"]}, - "app_relations": [ - {"predicate": "linked_to", "target": {"source_id": "auth-troubleshooting"}}, - ], - } - ]), + collection="default", + documents=[("auth-controls.txt", io.BytesIO(b"Authentication controls are reviewed quarterly."), "text/plain")], + document_metadata=json.dumps([{ + "id": "auth-guide", "relations": {"ids": ["auth-troubleshooting"]}, + "metadata": {"department": "security", "priority": 7, "summary_label": "quarterly access control review"}, + "additional_metadata": {"author": "alice", "doc_version": 3}, + }]), ) ``` ```typescript TypeScript SDK await client.context.ingest({ type: "knowledge", database: "acme_corp", - appKnowledge: JSON.stringify([ - { - id: "auth-guide", - title: "Authentication Guide", - kind: "knowledge_base", - provider: "notion", - external_id: "AUTH-GUIDE", - fields: { kind: "knowledge_base", title: "Authentication Guide", body: "..." }, - relations: { ids: ["auth-troubleshooting"] }, - app_relations: [ - { predicate: "linked_to", target: { source_id: "auth-troubleshooting" } }, - ], - }, - ]), + collection: "default", + documents: [{ filename: "auth-controls.txt", contentType: "text/plain", data: Buffer.from("Authentication controls are reviewed quarterly.", "utf-8") }], + documentMetadata: JSON.stringify([{ + id: "auth-guide", relations: { ids: ["auth-troubleshooting"] }, + metadata: { department: "security", priority: 7, summary_label: "quarterly access control review" }, + additional_metadata: { author: "alice", doc_version: 3 }, + }]), }); ``` ```bash cURL +printf 'Authentication controls are reviewed quarterly.\n' | \ curl -X POST 'https://api.hydradb.com/context/ingest' \ -H "Authorization: Bearer $HYDRADB_API_KEY" \ -H "API-Version: 2" \ -F "type=knowledge" \ -F "database=acme_corp" \ - -F 'app_knowledge=[ - { - "id": "auth-guide", - "title": "Authentication Guide", - "kind": "knowledge_base", - "provider": "notion", - "external_id": "AUTH-GUIDE", - "fields": { "kind": "knowledge_base", "title": "Authentication Guide", "body": "..." }, - "relations": { "ids": ["auth-troubleshooting"] }, - "app_relations": [ - { "predicate": "linked_to", "target": { "source_id": "auth-troubleshooting" } } - ] - } - ]' + -F "collection=default" \ + -F "documents=@-;filename=auth-controls.txt;type=text/plain" \ + -F 'document_metadata=[{"id":"auth-guide","relations":{"ids":["auth-troubleshooting"]},"metadata":{"department":"security","priority":7,"summary_label":"quarterly access control review"},"additional_metadata":{"author":"alice","doc_version":3}}]' ``` @@ -697,7 +593,6 @@ curl -X POST 'https://api.hydradb.com/context/ingest' \ | | default collection | The collection to save into. If omitted, context goes to the database's default collection, which a query naming another `collection` does not read. | | | None | Knowledge only. Files for HydraDB to parse. | | | None | Knowledge only. One item per file in `documents`, in the same order. | -| | None | Knowledge only. App sources. | | | None | Memories only. Memory items. | | | `true` | Replace existing context with the same `id`. | @@ -755,7 +650,7 @@ Set `kind` on the app source and repeat it as `fields.kind`. Every other key in | Querying with the wrong `type` | Nothing returned: the other type was searched | Use the matching `type`, or `"all"`. | | Omitting `collection` for per-user memories | The memory lands in the default collection and may surface in the wrong scope | Use the user's ID as `collection` to keep each user separate. | | Querying before indexing finishes | Results are empty, or a new collection returns `400` as not existing | Wait for `indexing_status` to reach `completed`. | -| Sending `document_metadata`, `app_knowledge`, or `memories` as a JSON object | `multipart/form-data` validation fails | Send each as a JSON string. | +| Sending `document_metadata` or `memories` as a JSON object | `multipart/form-data` validation fails | Send each as a JSON string. | | Sending pre-extracted facts with `infer: true` | HydraDB may re-derive the memory and change the original phrasing | Use `infer: false` for already-structured facts. | | Extracting preferences yourself instead of sending the raw logs | You duplicate work HydraDB can do for you | Send the raw signal with `infer: true`. | | Pointing a forceful relation from knowledge to a memory | Nothing is returned: relations stay within one type | Link knowledge to knowledge. | diff --git a/essentials/v2/metadata.mdx b/essentials/v2/metadata.mdx index 317872b0..f064ca08 100644 --- a/essentials/v2/metadata.mdx +++ b/essentials/v2/metadata.mdx @@ -82,35 +82,23 @@ curl -X POST 'https://api.hydradb.com/databases' \ After creating the database, wait for [`GET /databases/status`](/api-reference/v2/endpoint/database-status) to report `infra.ready_for_ingestion: true` before ingesting. -Send `metadata` and `additional_metadata` on each `app_knowledge[]` item, or on each `document_metadata[]` item when you upload files. For `type=memory`, the `memories` field is already a JSON string, and each memory item's `metadata` and `additional_metadata` are plain objects inside it; do not stringify them a second time. +Send `metadata` and `additional_metadata` on each `document_metadata[]` item when you upload files. Use connectors for app content. For `type=memory`, the `memories` field is already a JSON string, and each memory item's `metadata` and `additional_metadata` are plain objects inside it; do not stringify them a second time. ```python Python SDK +import io import json client.context.ingest( type="knowledge", database="acme_corp", collection="default", - app_knowledge=json.dumps([ - { - "database": "acme_corp", - "collection": "default", - "id": "auth-controls-001", - "kind": "knowledge_base", - "fields": { - "kind": "knowledge_base", - "title": "Authentication controls", - "body": "Authentication controls are reviewed quarterly for SOC2.", - }, - "metadata": { - "department": "security", - "priority": 7, - "summary_label": "quarterly access control review", - }, - "additional_metadata": {"author": "alice", "doc_version": 3}, - } - ]), + documents=[("auth-controls.txt", io.BytesIO(b"Authentication controls are reviewed quarterly."), "text/plain")], + document_metadata=json.dumps([{ + "id": "auth-controls-001", + "metadata": {"department": "security", "priority": 7, "summary_label": "quarterly access control review"}, + "additional_metadata": {"author": "alice", "doc_version": 3}, + }]), ) ``` ```typescript TypeScript SDK @@ -118,56 +106,24 @@ await client.context.ingest({ type: "knowledge", database: "acme_corp", collection: "default", - appKnowledge: JSON.stringify([ - { - database: "acme_corp", - collection: "default", - id: "auth-controls-001", - kind: "knowledge_base", - fields: { - kind: "knowledge_base", - title: "Authentication controls", - body: "Authentication controls are reviewed quarterly for SOC2.", - }, - metadata: { - department: "security", - priority: 7, - summary_label: "quarterly access control review", - }, - additional_metadata: { author: "alice", doc_version: 3 }, - }, - ]), + documents: [{ filename: "auth-controls.txt", contentType: "text/plain", data: Buffer.from("Authentication controls are reviewed quarterly.", "utf-8") }], + documentMetadata: JSON.stringify([{ + id: "auth-controls-001", + metadata: { department: "security", priority: 7, summary_label: "quarterly access control review" }, + additional_metadata: { author: "alice", doc_version: 3 }, + }]), }); ``` ```bash cURL +printf 'Authentication controls are reviewed quarterly.\n' | \ curl -X POST 'https://api.hydradb.com/context/ingest' \ -H "Authorization: Bearer $HYDRADB_API_KEY" \ -H "API-Version: 2" \ -F "type=knowledge" \ -F "database=acme_corp" \ -F "collection=default" \ - -F 'app_knowledge=[ - { - "database": "acme_corp", - "collection": "default", - "id": "auth-controls-001", - "kind": "knowledge_base", - "fields": { - "kind": "knowledge_base", - "title": "Authentication controls", - "body": "Authentication controls are reviewed quarterly for SOC2." - }, - "metadata": { - "department": "security", - "priority": 7, - "summary_label": "quarterly access control review" - }, - "additional_metadata": { - "author": "alice", - "doc_version": 3 - } - } - ]' + -F "documents=@-;filename=auth-controls.txt;type=text/plain" \ + -F 'document_metadata=[{"id":"auth-controls-001","metadata":{"department":"security","priority":7,"summary_label":"quarterly access control review"},"additional_metadata":{"author":"alice","doc_version":3}}]' ``` @@ -527,8 +483,8 @@ curl -X PATCH 'https://api.hydradb.com/context/auth-controls-001/metadata' \ - **The source must already exist:** this endpoint does not create sources, and `collection` is required. -- **At least one of `database_metadata`, `additional_metadata`, `acl`, or `acl_inherit: true` is required:** `tenant_metadata` is a deprecated alias for `database_metadata`; `document_metadata` is rejected. -- **Metadata merges:** sent keys are inserted or overwritten; omitted keys are preserved. `acl` is the exception: when sent, it replaces the stored list, and an `acl`-only body is a valid edit. To remove a connector source's own ACL, send `acl_inherit: true` without `acl`. This can widen access. See [Restore resource permissions](/essentials/v2/connectors#restore-resource-permissions) for eligibility and validation rules. +- **Use supported edit fields:** `database_metadata`, `additional_metadata` and `acl` are documented update fields; `tenant_metadata` is a deprecated alias for `database_metadata`, and `document_metadata` is rejected. +- **Metadata merges:** sent keys are inserted or overwritten; omitted keys are preserved. `acl` is the exception: when sent, it replaces the stored list. The current public contract has no inheritance-restoration flag; an empty ACL makes the source private rather than restoring resource permissions. See [Update a source's access rule](/essentials/v2/connectors#restore-resource-permissions). - **The edit is visible to filters and listing right away:** if no edited field has an embedding flag, the vector store is untouched and the response reports `vector_sync_required: false`. - **Searchable fields sync synchronously:** if an edited field has `enable_dense_embedding` or `enable_sparse_embedding`, HydraDB refreshes that field's search lane and reports `vector_sync_required` and `vector_synced` in the response (the `milvus_sync_required` and `milvus_synced` aliases are still emitted, deprecated). Such a field rejects `null`, because it would leave stale metadata vectors behind. @@ -625,7 +581,7 @@ Limits: | A range or fuzzy filter does not work | Only `equals`, `contains`, and `contains_any` are supported | Move the constraint into the `query` text, or post-process in your application. | | An `additional_metadata` filter is slow | It could not be resolved up front, so it is checked [after retrieval](#2-the-two-layers) | Move the hot field into `metadata` and declare it in the schema. | | A schema change does not take effect, or you need a searchable field after creation | The schema is [additive only](#5-add-schema-fields-later), and added fields cannot take embedding flags | Create a new database with the corrected schema and re-ingest. There is no in-place migration for existing fields. | -| A metadata edit returns `400` | Unknown key, wrong type, oversized payload, too-deep nesting, reserved key, missing `collection`, `null` on a searchable field, `acl` combined with `acl_inherit: true`, or inheritance without connector resource attribution | Check the schema, the [size limits](#4-size-limits), and the [edit rules](#6-update-metadata-without-re-ingesting); send a valid metadata edit or one ACL action. For a searchable field, set a non-null value or re-ingest. | +| A metadata edit returns `400` | Unknown key, wrong type, oversized payload, too-deep nesting, reserved key, missing `collection`, or `null` on a searchable field | Check the schema, the [size limits](#4-size-limits), and the [edit rules](#6-update-metadata-without-re-ingesting); send a supported metadata edit or explicit ACL replacement. For a searchable field, set a non-null value or re-ingest. | ## Related From 3b99fce4390a2ad2eb3e2bdde6fe08fca9fc2616 Mon Sep 17 00:00:00 2001 From: adityashrivastavaa <288670127+adityashrivastavaa@users.noreply.github.com> Date: Thu, 19 Nov 2026 05:27:30 +0000 Subject: [PATCH 2/2] docs: hide inheritance guidance and repair app-source links Signed-off-by: adityashrivastavaa <288670127+adityashrivastavaa@users.noreply.github.com> Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --- api-reference/v2/endpoint/context-overview.mdx | 2 +- api-reference/v2/endpoint/update-source-metadata.mdx | 5 ++--- cookbooks/v2/chief-of-staff.mdx | 2 +- cookbooks/v2/competitive-intelligence.mdx | 2 +- cookbooks/v2/cursor.mdx | 2 +- cookbooks/v2/glean.mdx | 2 +- cookbooks/v2/support-agent.mdx | 2 +- essentials/v2/connectors.mdx | 10 ++-------- essentials/v2/metadata.mdx | 2 +- essentials/v2/query.mdx | 2 +- 10 files changed, 12 insertions(+), 19 deletions(-) diff --git a/api-reference/v2/endpoint/context-overview.mdx b/api-reference/v2/endpoint/context-overview.mdx index 45a51afd..4457e40a 100644 --- a/api-reference/v2/endpoint/context-overview.mdx +++ b/api-reference/v2/endpoint/context-overview.mdx @@ -27,7 +27,7 @@ SDK methods are listed by their Python names. The TypeScript SDK uses the same n | To ingest | Send | Guide | | :-- | :-- | :-- | | PDFs, DOCX, CSVs, and other documents HydraDB should parse | `type=knowledge` and `documents` | [Context](/essentials/v2/context) | -| Slack messages, Notion pages, Gmail threads, or web pages with pre-extracted text | `type=knowledge` and `app_knowledge` | [Context](/essentials/v2/context#send-app-sources) | +| Slack messages, Notion pages, Gmail threads, or web pages with pre-extracted text | `type=knowledge` and `app_knowledge` | [Connectors](/essentials/v2/connectors) | | User preferences, conversation history, or inline notes | `type=memory` and `memories` | [Context](/essentials/v2/context#2-save-memories) | You can send `documents` and `app_knowledge` in the same request. diff --git a/api-reference/v2/endpoint/update-source-metadata.mdx b/api-reference/v2/endpoint/update-source-metadata.mdx index 6591fa9e..fdfe7f10 100644 --- a/api-reference/v2/endpoint/update-source-metadata.mdx +++ b/api-reference/v2/endpoint/update-source-metadata.mdx @@ -125,7 +125,7 @@ curl -X PATCH 'https://api.hydradb.com/context/policy_main/metadata' \ ## Request rules - `collection` is required. This endpoint does not default it. -- Send a supported metadata edit or an explicit ACL replacement. The current public contract does not expose an inheritance-restoration flag. +- Send a supported metadata edit or an explicit ACL replacement. - `database_metadata` merges into the source's `metadata`, and its keys must satisfy the database metadata schema when one exists. `additional_metadata` merges into the source's free-form `additional_metadata`. - The endpoint does not accept `metadata` or `document_metadata`. @@ -133,7 +133,7 @@ curl -X PATCH 'https://api.hydradb.com/context/policy_main/metadata' \ | --- | --- | | | Merge values into the source's declared metadata fields; omitted keys are preserved. | | | Merge free-form values; omitted keys are preserved. | -| | Replace the complete ACL. Omit to keep it; `[]` or `null` makes the source private. This does not restore connector-resource inheritance. | +| | Replace the complete ACL. Omit to keep it; `[]` or `null` makes the source private. | @@ -141,7 +141,6 @@ curl -X PATCH 'https://api.hydradb.com/context/policy_main/metadata' \ - Metadata keys included in the request are added or overwritten. Omitted keys keep their existing values. - Sending `acl` replaces the entire stored ACL, so send the complete new list. `[]` or `null` revokes access for everyone. Omit `acl` to keep the stored list. See [Query](/essentials/v2/query#6-query-on-behalf-of-a-user). -- An explicit ACL replacement is not a request to restore connector-resource inheritance. See [Update a source's access rule](/essentials/v2/connectors#restore-resource-permissions). - The source must already exist. This endpoint does not create sources. - The endpoint edits one source at a time. Bulk metadata edits are not supported. - Updated metadata is visible to [`/query`](/api-reference/v2/endpoint/query) metadata filters and [`/context/list`](/api-reference/v2/endpoint/list-context) filters. diff --git a/cookbooks/v2/chief-of-staff.mdx b/cookbooks/v2/chief-of-staff.mdx index b91aafac..71a41bf1 100644 --- a/cookbooks/v2/chief-of-staff.mdx +++ b/cookbooks/v2/chief-of-staff.mdx @@ -33,7 +33,7 @@ create_database(DATABASE) ## 2. Ingest meetings and email as knowledge -Meetings and email are [app sources](/essentials/v2/context#send-app-sources). The `meeting` and `email` kinds keep participants, senders, and dates, which is what lets a query answer "what did Priya agree to on the September call". +Meetings and email are [app sources](/essentials/v2/connectors). The `meeting` and `email` kinds keep participants, senders, and dates, which is what lets a query answer "what did Priya agree to on the September call". ```python chief_of_staff.py records = [ diff --git a/cookbooks/v2/competitive-intelligence.mdx b/cookbooks/v2/competitive-intelligence.mdx index 2a32406d..76a3ce50 100644 --- a/cookbooks/v2/competitive-intelligence.mdx +++ b/cookbooks/v2/competitive-intelligence.mdx @@ -42,7 +42,7 @@ create_database(DATABASE, schema=[text_field("competitor"), text_field("signal") ## 2. Ingest signals with stable IDs -Send each page as an [app source](/essentials/v2/context#send-app-sources) with the competitor and signal type in `metadata`. Build the `id` from the page, not from the day you fetched it: ingesting the same `id` again replaces the stored version, because `upsert` defaults to `true`. +Send each page as an [app source](/essentials/v2/connectors) with the competitor and signal type in `metadata`. Build the `id` from the page, not from the day you fetched it: ingesting the same `id` again replaces the stored version, because `upsert` defaults to `true`. ```python intel.py def signal(source_id, competitor, kind_of_signal, title, body, fetched_at, url): diff --git a/cookbooks/v2/cursor.mdx b/cookbooks/v2/cursor.mdx index 89c46ce5..1a3d75d2 100644 --- a/cookbooks/v2/cursor.mdx +++ b/cookbooks/v2/cursor.mdx @@ -164,5 +164,5 @@ Indexing a few hundred files takes a few minutes. The answer should name specifi ## Next steps - [Query: API Reference](/api-reference/v2/endpoint/query): the fields of `graph_context`. -- [Context](/essentials/v2/context#send-app-sources): add pull requests and Slack threads, so the assistant can answer why code was written the way it was. +- [Connectors](/essentials/v2/connectors): add pull requests and Slack threads, so the assistant can answer why code was written the way it was. - [Claude Code](/plugins/claude-code) and [Cursor](/plugins/cursor) plugins: give an existing coding agent HydraDB memory without building your own. diff --git a/cookbooks/v2/glean.mdx b/cookbooks/v2/glean.mdx index d3cd1713..2f05807c 100644 --- a/cookbooks/v2/glean.mdx +++ b/cookbooks/v2/glean.mdx @@ -31,7 +31,7 @@ create_database(DATABASE) ## 2. Ingest sources from each app -Send records your code already holds as [app sources](/essentials/v2/context#send-app-sources). `kind` tells HydraDB what the record is, `fields` carries its content, and `acl` lists who may see it. The samples include an outdated wiki page and the Slack message that replaced it, and a ticket only the finance lead can see. +Send records your code already holds as [app sources](/essentials/v2/connectors). `kind` tells HydraDB what the record is, `fields` carries its content, and `acl` lists who may see it. The samples include an outdated wiki page and the Slack message that replaced it, and a ticket only the finance lead can see. ```python glean.py sources = [ diff --git a/cookbooks/v2/support-agent.mdx b/cookbooks/v2/support-agent.mdx index d2feb26a..4c005df6 100644 --- a/cookbooks/v2/support-agent.mdx +++ b/cookbooks/v2/support-agent.mdx @@ -125,7 +125,7 @@ The billing answer should combine both sources: the refund was requested on Sept ## Use real data -Sync the public help center into the shared collection with a [connector](/essentials/v2/connectors). Put only public content there: every customer's query reads that collection, and it is not filtered by `acl`. A customer's past tickets are private, so ingest each one into that customer's collection as a `ticket` [app source](/essentials/v2/context#send-app-sources). Keep step 3 in your application, called when a conversation closes. If each of your customers is a company with its own private knowledge, give each company its own database. See [Databases and Collections](/essentials/v2/databases-and-collections). +Sync the public help center into the shared collection with a [connector](/essentials/v2/connectors). Put only public content there: every customer's query reads that collection, and it is not filtered by `acl`. A customer's past tickets are private, so ingest each one into that customer's collection as a `ticket` [app source](/essentials/v2/connectors). Keep step 3 in your application, called when a conversation closes. If each of your customers is a company with its own private knowledge, give each company its own database. See [Databases and Collections](/essentials/v2/databases-and-collections). ## Common mistakes diff --git a/essentials/v2/connectors.mdx b/essentials/v2/connectors.mdx index e6688ecc..903a3707 100644 --- a/essentials/v2/connectors.mdx +++ b/essentials/v2/connectors.mdx @@ -3,7 +3,7 @@ title: "Connectors" description: "Connect Slack, GitHub, Notion, or any of 70 apps, and HydraDB keeps their data synced into your database." --- -HydraDB syncs data from 70 apps into your database without ingestion code on your side. You connect an account once, choose which resources (channels, repositories, pages) to sync, and HydraDB keeps them indexed as searchable [app sources](/essentials/v2/context#send-app-sources). The catalog includes Slack, Gmail, Google Drive, Notion, Jira, Confluence, GitHub, Linear, HubSpot, Zendesk, Supabase, Microsoft Teams, Outlook, Zoom, Gong, and Fireflies. It grows often; call [`GET /connectors/providers`](/api-reference/v2/endpoint/list-connector-providers) for the current list. +HydraDB syncs data from 70 apps into your database without ingestion code on your side. You connect an account once, choose which resources (channels, repositories, pages) to sync, and HydraDB keeps them indexed as searchable [app sources](/essentials/v2/connectors). The catalog includes Slack, Gmail, Google Drive, Notion, Jira, Confluence, GitHub, Linear, HubSpot, Zendesk, Supabase, Microsoft Teams, Outlook, Zoom, Gong, and Fireflies. It grows often; call [`GET /connectors/providers`](/api-reference/v2/endpoint/list-connector-providers) for the current list. If an app is not in the catalog, or you already have your own integration, [upload text your application owns as a file](/essentials/v2/context#upload-files). The public ingest contract does not accept a provider-shaped app-source payload. @@ -593,12 +593,6 @@ The change applies to already-synced sources on the next query, with no re-sync. If HydraDB cannot read a resource ACL from the provider, [Get Connector Status](/api-reference/v2/endpoint/get-connector-status) reports an `acl_warning` until the next successful read. Your own resource rule still applies; a resource with no rule is readable by everyone. - - -### Update a source's access rule - -[Update Source Metadata](/api-reference/v2/endpoint/update-source-metadata) accepts an explicit `acl` replacement. The current public contract does not expose a flag for restoring connector-resource inheritance. Do not send an inheritance flag or treat an empty ACL as a request to restore inheritance; use the endpoint's documented ACL semantics. - Deleting a connector resource rule does not widen access on its own. To open a restricted resource, set its ACL to `["__public__"]`. @@ -622,7 +616,7 @@ All of them can sync into the same collection, so one query searches every accou ## Related - [Connectors API reference](/api-reference/v2/endpoint/connectors-overview): every endpoint, and which one changes what -- [Context](/essentials/v2/context#send-app-sources): the ingestion model synced sources use, and how to ingest from your own integration +- [Connectors](/essentials/v2/connectors): the ingestion model synced sources use, and how to ingest from your own integration - [Metadata](/essentials/v2/metadata): schema-backed and free-form metadata - [Databases and Collections](/essentials/v2/databases-and-collections): routing resources to databases and collections - [Query](/essentials/v2/query): querying connector-synced data diff --git a/essentials/v2/metadata.mdx b/essentials/v2/metadata.mdx index f064ca08..c41d1d2e 100644 --- a/essentials/v2/metadata.mdx +++ b/essentials/v2/metadata.mdx @@ -484,7 +484,7 @@ curl -X PATCH 'https://api.hydradb.com/context/auth-controls-001/metadata' \ - **The source must already exist:** this endpoint does not create sources, and `collection` is required. - **Use supported edit fields:** `database_metadata`, `additional_metadata` and `acl` are documented update fields; `tenant_metadata` is a deprecated alias for `database_metadata`, and `document_metadata` is rejected. -- **Metadata merges:** sent keys are inserted or overwritten; omitted keys are preserved. `acl` is the exception: when sent, it replaces the stored list. The current public contract has no inheritance-restoration flag; an empty ACL makes the source private rather than restoring resource permissions. See [Update a source's access rule](/essentials/v2/connectors#restore-resource-permissions). +- **Metadata merges:** sent keys are inserted or overwritten; omitted keys are preserved. `acl` is the exception: when sent, it replaces the stored list. - **The edit is visible to filters and listing right away:** if no edited field has an embedding flag, the vector store is untouched and the response reports `vector_sync_required: false`. - **Searchable fields sync synchronously:** if an edited field has `enable_dense_embedding` or `enable_sparse_embedding`, HydraDB refreshes that field's search lane and reports `vector_sync_required` and `vector_synced` in the response (the `milvus_sync_required` and `milvus_synced` aliases are still emitted, deprecated). Such a field rejects `null`, because it would leave stale metadata vectors behind. diff --git a/essentials/v2/query.mdx b/essentials/v2/query.mdx index 6f0f7444..596b908e 100644 --- a/essentials/v2/query.mdx +++ b/essentials/v2/query.mdx @@ -208,7 +208,7 @@ Three fields bring in context beyond the chunks that matched. All three are on b - **`graph_context`:** the relationships HydraDB extracted from your context, such as "Payments team owns billing service", in `data.graph_context`. `false` drops it, but only in fast mode; thinking always includes it. The [Query API reference](/api-reference/v2/endpoint/query) describes its fields. - **`query_forceful_relations`:** forceful relations (links you declare between sources at ingest with `relations.ids`), such as a contract and its addendum, returned in `data.additional_context`. Thinking mode only; fast mode skips it without an error. [Context](/essentials/v2/context#6-link-sources-that-belong-together) shows how to declare the links. -- **`query_apps`:** for [app sources](/essentials/v2/context#send-app-sources), an extra lane that rebuilds Slack threads, follows ticket and parent links, and matches exact ids and people. It still searches everything else, and has no effect on memories. +- **`query_apps`:** for [app sources](/essentials/v2/connectors), an extra lane that rebuilds Slack threads, follows ticket and parent links, and matches exact ids and people. It still searches everything else, and has no effect on memories. ## 6. Query on behalf of a user