Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
127 changes: 16 additions & 111 deletions AGENTS.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

---

## 1. Critical rules for LLMs

Check warning on line 21 in AGENTS.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cortex-e852fafe) - vale-spellcheck

AGENTS.mdx#L21

Did you really mean 'LLMs'?

### API versioning and auth

Expand All @@ -26,7 +26,7 @@
- Raw HTTP calls must include:
- `Authorization: Bearer <api_key>`
- `API-Version: 2`
- Official SDKs set `API-Version: 2` automatically.

Check warning on line 29 in AGENTS.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cortex-e852fafe) - vale-spellcheck

AGENTS.mdx#L29

Did you really mean 'SDKs'?
- Use `HYDRADB_API_KEY` as the environment variable in examples.

### Response envelope
Expand Down Expand Up @@ -60,7 +60,7 @@

- `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).

Expand Down Expand Up @@ -163,7 +163,7 @@

#### Failed requests are not feedback

**"Did not give me what I needed" is not the same as "errored".** A query that returned `200` with unhelpful results is what this endpoint is for. A query that never returned (`4xx`/`5xx`, or the SDK raised) is not: a failed request has no retrieval result to judge. Fix the request instead: a `404` means the database name is wrong, a `429` means back off, a `400` means the body was malformed.

Check warning on line 166 in AGENTS.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cortex-e852fafe) - vale-spellcheck

AGENTS.mdx#L166

Did you really mean 'errored'?

#### Request fields and limits

Expand Down Expand Up @@ -197,7 +197,7 @@

### Knowledge

Knowledge is the documents, app sources, and facts your AI reasons over: PDFs, Markdown, CSVs, Slack threads, Notion pages, Gmail threads, tickets, webpages, and so on. Ingest and query it with `type: "knowledge"`.

Check warning on line 200 in AGENTS.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cortex-e852fafe) - vale-spellcheck

AGENTS.mdx#L200

Did you really mean 'PDFs'?

Check warning on line 200 in AGENTS.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cortex-e852fafe) - vale-spellcheck

AGENTS.mdx#L200

Did you really mean 'CSVs'?

Check warning on line 200 in AGENTS.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cortex-e852fafe) - vale-spellcheck

AGENTS.mdx#L200

Did you really mean 'webpages'?

- It can be private: restrict sources with `acl` (see [Access control](#access-control)).
- Mutability is explicit: re-ingest with the same ID and `upsert: true`, edit metadata in place with `PATCH /context/{id}/metadata`, or delete.
Expand Down Expand Up @@ -234,15 +234,15 @@
```

- 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.

Check warning on line 245 in AGENTS.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cortex-e852fafe) - vale-spellcheck

AGENTS.mdx#L245

Did you really mean 'Jira'?
- Principals: an email (`grace@acme.com`), `domain:acme.com`, `group:<provider>:<id>`, 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.
- A source with no `acl` is unrestricted.
Expand All @@ -251,7 +251,7 @@

### 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.

Check warning on line 254 in AGENTS.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cortex-e852fafe) - vale-spellcheck

AGENTS.mdx#L254

Did you really mean 'Jira'?

Check warning on line 254 in AGENTS.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cortex-e852fafe) - vale-spellcheck

AGENTS.mdx#L254

Did you really mean 'Zendesk'?

Setup is four calls, made once:

Expand Down Expand Up @@ -350,9 +350,9 @@

SDK naming:

- Python methods and fields are snake_case: `databases.get_metadata_schema()`, `page_size`, `query_by`.

Check warning on line 353 in AGENTS.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cortex-e852fafe) - vale-spellcheck

AGENTS.mdx#L353

Did you really mean 'snake_case'?
- TypeScript methods and fields are camelCase: `databases.getMetadataSchema()`, `pageSize`, `queryBy`.

Check warning on line 354 in AGENTS.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cortex-e852fafe) - vale-spellcheck

AGENTS.mdx#L354

Did you really mean 'camelCase'?
- 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.

Check warning on line 355 in AGENTS.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cortex-e852fafe) - vale-spellcheck

AGENTS.mdx#L355

Did you really mean 'snake_case'?

Check warning on line 355 in AGENTS.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cortex-e852fafe) - vale-spellcheck

AGENTS.mdx#L355

Did you really mean 'stringified'?

Check warning on line 355 in AGENTS.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cortex-e852fafe) - vale-spellcheck

AGENTS.mdx#L355

Did you really mean 'SDKs'?

---

Expand Down Expand Up @@ -554,7 +554,6 @@
| `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
Expand All @@ -566,7 +565,7 @@
| Documents | `.pdf` `.doc` `.docx` `.docm` `.dot` `.dotx` `.odt` `.ott` `.rtf` |
| Spreadsheets | `.xls` `.xlsx` `.xlsm` `.xlsb` `.ods` `.ots` `.csv` `.tsv` |
| Presentations | `.ppt` `.pptx` `.pptm` `.odp` `.otp` |
| Apple iWork | `.pages` `.numbers` `.key` |

Check warning on line 568 in AGENTS.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cortex-e852fafe) - vale-spellcheck

AGENTS.mdx#L568

Did you really mean 'iWork'?
| Images (text is read with OCR) | `.png` `.jpg` `.jpeg` `.tif` `.tiff` `.webp` `.gif` `.bmp` |
| Plain text | `.txt` `.md` `.markdown` `.json` |

Expand Down Expand Up @@ -596,66 +595,16 @@

| `document_metadata` item field | Purpose |
|---|---|
| `id` | stable source ID / upsert key for the uploaded file; HydraDB assigns one if omitted |

Check warning on line 598 in AGENTS.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cortex-e852fafe) - vale-spellcheck

AGENTS.mdx#L598

Did you really mean 'upsert'?
| `metadata` | schema-aligned fields for this file (max 16 KiB compact JSON) |
| `additional_metadata` | free-form fields for this file (max 1 KiB compact JSON) |
| `relations` | relations you declare to other sources, e.g. `{ "ids": [...] }` |

### 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

Expand Down Expand Up @@ -686,7 +635,7 @@

| Field | Description |
|---|---|
| `id` | optional stable upsert key |

Check warning on line 638 in AGENTS.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cortex-e852fafe) - vale-spellcheck

AGENTS.mdx#L638

Did you really mean 'upsert'?
| `title` | label for listing and result display |
| `text` | raw text or Markdown; required unless `user_assistant_pairs` provided |
| `user_assistant_pairs` | dialogue pairs `{ user, assistant }`; useful for implied preferences |
Expand All @@ -694,7 +643,7 @@
| `infer` | `true`: the input is raw signal and HydraDB extracts the durable preference or fact. `false`: the memory is already structured and is stored verbatim |
| `custom_instructions` | guide inference when `infer: true` |
| `user_name` | helps inference |
| `metadata` | schema-aligned fields, as an object (do not stringify it again inside `memories`). `tenant_metadata` is not read on memory items. |

Check warning on line 646 in AGENTS.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cortex-e852fafe) - vale-spellcheck

AGENTS.mdx#L646

Did you really mean 'stringify'?
| `additional_metadata` | free-form fields; keep as objects |

---
Expand Down Expand Up @@ -786,7 +735,7 @@
Rules:

- The webhook URL must be public HTTPS; localhost and private networks are blocked.
- Store `delivery_id` to deduplicate retries.

Check warning on line 738 in AGENTS.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cortex-e852fafe) - vale-spellcheck

AGENTS.mdx#L738

Did you really mean 'deduplicate'?
- Verify `X-HydraDB-Signature` with a constant-time comparison. Use `verify_webhook_signature` (Python SDK) or `verifyWebhookSignature` (TypeScript SDK) from the SDK helpers module.
- Fail closed: reject the request when the signing secret is absent from the environment, instead of skipping verification.

Expand All @@ -808,7 +757,7 @@
| `acl` | list of principals | who is asking; see [Send `acl` on user queries](#send-acl-on-user-queries) |
| `query_by` | `hybrid`, `text` | default `hybrid` (semantic + BM25); `text` is BM25 keyword/phrase search |
| `operator` | `or`, `and`, `phrase` | only for `query_by: "text"` |
| `mode` | `fast`, `thinking`, `auto` | applies to hybrid; omitted means `auto`, which picks fast or thinking per query (thinking when unsure). `fast` is low latency. `thinking` adds query expansion, reranking, richer graph traversal, and forceful-relation expansion; it improves quality but adds latency |

Check warning on line 760 in AGENTS.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cortex-e852fafe) - vale-spellcheck

AGENTS.mdx#L760

Did you really mean 'reranking'?
| `max_results` | integer/null | default 10; max 250 |
| `alpha` | `0.0` to `1.0`, or `auto` | hybrid weight; `1.0` semantic, `0.0` BM25 |
| `recency_bias` | `0.0` to `1.0` | boost newer content; omitted means `0.4`, send `0` to disable |
Expand Down Expand Up @@ -923,7 +872,7 @@

Each chunk's `id` is the ID of the source it came from, and `source_title` is that source's title: cite with these. The public result has no `sources` array.

Use `chunks` as the primary LLM context. Preserve server order, which is the ranking; do not re-sort unless you have a deliberate reranking step.

Check warning on line 875 in AGENTS.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cortex-e852fafe) - vale-spellcheck

AGENTS.mdx#L875

Did you really mean 'reranking'?

---

Expand Down Expand Up @@ -1050,8 +999,8 @@

Rules:

- Plan hot filter fields before the first ingest. `PATCH /databases/{database}/metadata-schema` can add fields later, but cannot rename, retype, or reflag existing ones, and rejects `enable_dense_embedding` / `enable_sparse_embedding` (declare those at database creation). Changing an existing field definition requires a new database and re-ingestion.

Check warning on line 1002 in AGENTS.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cortex-e852fafe) - vale-spellcheck

AGENTS.mdx#L1002

Did you really mean 'reflag'?
- Top-level `metadata_filters` keys must be declared in the metadata schema. They support `equals`, `contains`, and `contains_any`. Range and fuzzy matching belong in the query or a downstream reranker.

Check warning on line 1003 in AGENTS.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cortex-e852fafe) - vale-spellcheck

AGENTS.mdx#L1003

Did you really mean 'reranker'?
- To change metadata on an indexed source, call `PATCH /context/{id}/metadata` (merges keys), or re-ingest with the same `id` and `upsert: true`.
- Do not rename metadata keys without re-ingesting the affected sources.

Expand Down Expand Up @@ -1095,8 +1044,8 @@
| Mode | Returns |
|---|---|
| `content` | parsed text or base64 for binary files |
| `url` | presigned URL |

Check warning on line 1047 in AGENTS.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cortex-e852fafe) - vale-spellcheck

AGENTS.mdx#L1047

Did you really mean 'presigned'?
| `both` | content plus presigned URL |

Check warning on line 1048 in AGENTS.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cortex-e852fafe) - vale-spellcheck

AGENTS.mdx#L1048

Did you really mean 'presigned'?

### Inspect graph relations

Expand Down Expand Up @@ -1142,14 +1091,14 @@
| `409` | conflict, e.g. existing database or source ID | Usually no |
| `413` | upload too large | No |
| `422` | semantic validation failure, including `TENANT_INFRA_NOT_READY` | Only for `TENANT_INFRA_NOT_READY`, after polling readiness |
| `429` | rate limited | Yes with backoff |

Check warning on line 1094 in AGENTS.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cortex-e852fafe) - vale-spellcheck

AGENTS.mdx#L1094

Did you really mean 'backoff'?
| `500` | internal error | Yes with backoff |

Check warning on line 1095 in AGENTS.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cortex-e852fafe) - vale-spellcheck

AGENTS.mdx#L1095

Did you really mean 'backoff'?
| `502` | upstream dependency error (`BACKEND_ERROR`) | Yes with backoff |

Check warning on line 1096 in AGENTS.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cortex-e852fafe) - vale-spellcheck

AGENTS.mdx#L1096

Did you really mean 'backoff'?
| `503` | temporary unavailability | Yes with backoff |

Check warning on line 1097 in AGENTS.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cortex-e852fafe) - vale-spellcheck

AGENTS.mdx#L1097

Did you really mean 'backoff'?

Retry only `429`, `500`, `502`, and `503`, with bounded exponential backoff and jitter.

Check warning on line 1099 in AGENTS.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cortex-e852fafe) - vale-spellcheck

AGENTS.mdx#L1099

Did you really mean 'backoff'?

The SDKs already retry `408`, `429`, and `5xx` responses twice with exponential backoff before raising, and the Python SDK also retries `409`. Do not wrap SDK calls in a second retry loop: raise the count with `request_options={"max_retries": 5}` on a Python call, or `maxRetries` on the TypeScript client or call.

Check warning on line 1101 in AGENTS.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cortex-e852fafe) - vale-spellcheck

AGENTS.mdx#L1101

Did you really mean 'SDKs'?

Check warning on line 1101 in AGENTS.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cortex-e852fafe) - vale-spellcheck

AGENTS.mdx#L1101

Did you really mean 'backoff'?

### Common error codes

Expand Down Expand Up @@ -1243,7 +1192,7 @@
Section 1, critical rules:

- [ ] Forgetting `API-Version: 2` in raw HTTP calls.
- [ ] Reading a payload from the top level instead of `data`, in raw HTTP or in the SDKs.

Check warning on line 1195 in AGENTS.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cortex-e852fafe) - vale-spellcheck

AGENTS.mdx#L1195

Did you really mean 'SDKs'?
- [ ] Writing with one `collection` and reading with another, or omitting `collection` for user memories.
- [ ] Splitting a company brain into many collections instead of one collection with `metadata_filters` and `acl`.
- [ ] Querying on behalf of a user without `acl`, which returns everything in scope.
Expand All @@ -1252,7 +1201,7 @@
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.
Expand All @@ -1269,7 +1218,7 @@
- [ ] Expecting `query_forceful_relations` to work in `mode: "fast"`.
- [ ] Setting `graph_context: false` and expecting graph fields.
- [ ] Reading `data.sources`, which the public result does not return; cite from each chunk's `id` and `source_title`.
- [ ] Re-sorting chunks before prompting without a deliberate reranker.

Check warning on line 1221 in AGENTS.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cortex-e852fafe) - vale-spellcheck

AGENTS.mdx#L1221

Did you really mean 'reranker'?
- [ ] Passing raw result JSON or too many chunks to the LLM.
- [ ] Putting hot filters in free-form metadata instead of the metadata schema.

Expand All @@ -1277,7 +1226,7 @@

## 15. SDK method reference

Every method is on the client: `client.<method>` in both SDKs. Return shapes are in [Response envelope](#response-envelope); naming is in [3. Installation and client setup](#3-installation-and-client-setup).

Check warning on line 1229 in AGENTS.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cortex-e852fafe) - vale-spellcheck

AGENTS.mdx#L1229

Did you really mean 'SDKs'?

| Group | Python | TypeScript | Endpoint | Purpose |
|---|---|---|---|---|
Expand All @@ -1293,7 +1242,7 @@
| Context | `context.ingest()` | `context.ingest()` | `POST /context/ingest` | Ingest files, app sources, or memories |
| Context | `context.status()` | `context.status()` | `GET /context/status` | Check indexing status |
| Context | `context.list()` | `context.list()` | `POST /context/list` | Browse knowledge or memories |
| Context | `context.inspect()` | `context.inspect()` | `GET /context/inspect` | Original content or a presigned URL |

Check warning on line 1245 in AGENTS.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cortex-e852fafe) - vale-spellcheck

AGENTS.mdx#L1245

Did you really mean 'presigned'?
| Context | `context.update_source_metadata()` | `context.updateSourceMetadata()` | `PATCH /context/{id}/metadata` | Edit metadata or `acl` without re-ingesting |
| Context | `context.relations()` | `context.relations()` | `GET /context/relations` | Graph relations for a source or collection |
| Context | `context.subgraph()` | `context.subgraph()` | `GET /context/{id}/subgraph` | Sources connected to one source |
Expand Down Expand Up @@ -1375,66 +1324,22 @@
| 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
Expand Down
2 changes: 1 addition & 1 deletion api-reference/v2/endpoint/context-overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

## Endpoint references

SDK methods are listed by their Python names. The TypeScript SDK uses the same names in camelCase, such as `context.updateSourceMetadata`.

Check warning on line 10 in api-reference/v2/endpoint/context-overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cortex-e852fafe) - vale-spellcheck

api-reference/v2/endpoint/context-overview.mdx#L10

Did you really mean 'camelCase'?

| Endpoint | SDK method | Purpose |
| --- | --- | --- |
Expand All @@ -26,8 +26,8 @@

| To ingest | Send | Guide |
| :-- | :-- | :-- |
| PDFs, DOCX, CSVs, and other documents HydraDB should parse | `type=knowledge` and `documents` | [Context](/essentials/v2/context) |

Check warning on line 29 in api-reference/v2/endpoint/context-overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cortex-e852fafe) - vale-spellcheck

api-reference/v2/endpoint/context-overview.mdx#L29

Did you really mean 'PDFs'?

Check warning on line 29 in api-reference/v2/endpoint/context-overview.mdx

View check run for this annotation

Mintlify / Mintlify Validation (cortex-e852fafe) - vale-spellcheck

api-reference/v2/endpoint/context-overview.mdx#L29

Did you really mean 'CSVs'?
| 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.
Expand Down
Loading
Loading