sources = client.context.list(
database="acme_corp",
collection="team_docs",
type="knowledge",
page=1,
page_size=50,
filters={
"metadata": {"department": "legal"},
"source_fields": {"title": "Compliance"},
},
include_fields=["title", "type", "timestamp", "additional_metadata"],
)
const sources = await client.context.list({
database: "acme_corp",
collection: "team_docs",
type: "knowledge",
page: 1,
pageSize: 50,
filters: {
metadata: { department: "legal" },
sourceFields: { title: "Compliance" },
},
includeFields: ["title", "type", "timestamp", "additional_metadata"],
});
curl -X POST 'https://api.hydradb.com/context/list' \
-H "Authorization: Bearer <your_api_key>" \
-H "API-Version: 2" \
-H "Content-Type: application/json" \
-d '{
"database": "acme_corp",
"collection": "team_docs",
"type": "knowledge",
"page": 1,
"page_size": 50,
"filters": {
"metadata": { "department": "legal" },
"source_fields": { "title": "Compliance" }
},
"include_fields": ["title", "type", "timestamp", "additional_metadata"]
}'
{
"success": true,
"data": {
"success": true,
"message": "Successfully fetched sources",
"sources": [
{
"id": "policy_main",
"database": "acme_corp",
"collection": "team_docs",
"tenant_id": "acme_corp",
"sub_tenant_id": "team_docs",
"title": "Compliance Policy",
"type": "pdf",
"timestamp": "2026-05-12T08:14:00Z",
"additional_metadata": { "author": "Compliance Team" }
}
],
"total": 318,
"pagination": {
"page": 1,
"page_size": 50,
"total": 318,
"total_pages": 7,
"has_next": true,
"has_previous": false
}
},
"error": null,
"meta": {
"request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
"latency_ms": 12.3
}
}
{
"success": true,
"data": {
"success": true,
"message": "Successfully fetched sources",
"user_memories": [
{
"memory_id": "mem_user_alex_tone",
"database": "acme_corp",
"collection": "team_docs",
"tenant_id": "acme_corp",
"sub_tenant_id": "team_docs",
"title": "Tone preference",
"type": "memory",
"metadata": { "user_id": "alex" }
}
],
"total": 1,
"pagination": {
"page": 1,
"page_size": 50,
"total": 1,
"total_pages": 1,
"has_next": false,
"has_previous": false
}
},
"error": null,
"meta": {
"request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
"latency_ms": 12.3
}
}
{
"success": false,
"data": null,
"error": {
"code": "DATABASE_NOT_FOUND",
"message": "Database not found"
},
"meta": {
"request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
"latency_ms": 4.8
}
}
Context
List Context
Page through knowledge sources or memories, with optional filters.
POST
/
context
/
list
sources = client.context.list(
database="acme_corp",
collection="team_docs",
type="knowledge",
page=1,
page_size=50,
filters={
"metadata": {"department": "legal"},
"source_fields": {"title": "Compliance"},
},
include_fields=["title", "type", "timestamp", "additional_metadata"],
)
const sources = await client.context.list({
database: "acme_corp",
collection: "team_docs",
type: "knowledge",
page: 1,
pageSize: 50,
filters: {
metadata: { department: "legal" },
sourceFields: { title: "Compliance" },
},
includeFields: ["title", "type", "timestamp", "additional_metadata"],
});
curl -X POST 'https://api.hydradb.com/context/list' \
-H "Authorization: Bearer <your_api_key>" \
-H "API-Version: 2" \
-H "Content-Type: application/json" \
-d '{
"database": "acme_corp",
"collection": "team_docs",
"type": "knowledge",
"page": 1,
"page_size": 50,
"filters": {
"metadata": { "department": "legal" },
"source_fields": { "title": "Compliance" }
},
"include_fields": ["title", "type", "timestamp", "additional_metadata"]
}'
{
"success": true,
"data": {
"success": true,
"message": "Successfully fetched sources",
"sources": [
{
"id": "policy_main",
"database": "acme_corp",
"collection": "team_docs",
"tenant_id": "acme_corp",
"sub_tenant_id": "team_docs",
"title": "Compliance Policy",
"type": "pdf",
"timestamp": "2026-05-12T08:14:00Z",
"additional_metadata": { "author": "Compliance Team" }
}
],
"total": 318,
"pagination": {
"page": 1,
"page_size": 50,
"total": 318,
"total_pages": 7,
"has_next": true,
"has_previous": false
}
},
"error": null,
"meta": {
"request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
"latency_ms": 12.3
}
}
{
"success": true,
"data": {
"success": true,
"message": "Successfully fetched sources",
"user_memories": [
{
"memory_id": "mem_user_alex_tone",
"database": "acme_corp",
"collection": "team_docs",
"tenant_id": "acme_corp",
"sub_tenant_id": "team_docs",
"title": "Tone preference",
"type": "memory",
"metadata": { "user_id": "alex" }
}
],
"total": 1,
"pagination": {
"page": 1,
"page_size": 50,
"total": 1,
"total_pages": 1,
"has_next": false,
"has_previous": false
}
},
"error": null,
"meta": {
"request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
"latency_ms": 12.3
}
}
{
"success": false,
"data": null,
"error": {
"code": "DATABASE_NOT_FOUND",
"message": "Database not found"
},
"meta": {
"request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
"latency_ms": 4.8
}
}
Page through the sources stored in one database and collection, for example to find IDs or audit what was ingested.
type selects what to list: knowledge (the default: documents and app sources), memory, or all for both.
Narrow results with ids and filters, and return only the fields you need with include_fields. See Metadata Filters for the metadata workflow.
sources = client.context.list(
database="acme_corp",
collection="team_docs",
type="knowledge",
page=1,
page_size=50,
filters={
"metadata": {"department": "legal"},
"source_fields": {"title": "Compliance"},
},
include_fields=["title", "type", "timestamp", "additional_metadata"],
)
const sources = await client.context.list({
database: "acme_corp",
collection: "team_docs",
type: "knowledge",
page: 1,
pageSize: 50,
filters: {
metadata: { department: "legal" },
sourceFields: { title: "Compliance" },
},
includeFields: ["title", "type", "timestamp", "additional_metadata"],
});
curl -X POST 'https://api.hydradb.com/context/list' \
-H "Authorization: Bearer <your_api_key>" \
-H "API-Version: 2" \
-H "Content-Type: application/json" \
-d '{
"database": "acme_corp",
"collection": "team_docs",
"type": "knowledge",
"page": 1,
"page_size": 50,
"filters": {
"metadata": { "department": "legal" },
"source_fields": { "title": "Compliance" }
},
"include_fields": ["title", "type", "timestamp", "additional_metadata"]
}'
{
"success": true,
"data": {
"success": true,
"message": "Successfully fetched sources",
"sources": [
{
"id": "policy_main",
"database": "acme_corp",
"collection": "team_docs",
"tenant_id": "acme_corp",
"sub_tenant_id": "team_docs",
"title": "Compliance Policy",
"type": "pdf",
"timestamp": "2026-05-12T08:14:00Z",
"additional_metadata": { "author": "Compliance Team" }
}
],
"total": 318,
"pagination": {
"page": 1,
"page_size": 50,
"total": 318,
"total_pages": 7,
"has_next": true,
"has_previous": false
}
},
"error": null,
"meta": {
"request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
"latency_ms": 12.3
}
}
{
"success": true,
"data": {
"success": true,
"message": "Successfully fetched sources",
"user_memories": [
{
"memory_id": "mem_user_alex_tone",
"database": "acme_corp",
"collection": "team_docs",
"tenant_id": "acme_corp",
"sub_tenant_id": "team_docs",
"title": "Tone preference",
"type": "memory",
"metadata": { "user_id": "alex" }
}
],
"total": 1,
"pagination": {
"page": 1,
"page_size": 50,
"total": 1,
"total_pages": 1,
"has_next": false,
"has_previous": false
}
},
"error": null,
"meta": {
"request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
"latency_ms": 12.3
}
}
{
"success": false,
"data": null,
"error": {
"code": "DATABASE_NOT_FOUND",
"message": "Database not found"
},
"meta": {
"request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d",
"latency_ms": 4.8
}
}
Filters
filters accepts three categories:
{
"filters": {
"metadata": { "department": "Finance", "region": "US" },
"additional_metadata": { "author": "Alice Smith" },
"source_fields": { "app_provider": "slack", "title": "standup notes" }
}
}
metadata: schema-backed metadata fields.additional_metadata: free-form metadata. No schema declaration is required.source_fields: built-in and connector fields. Supported keys aretype,title,description,url,timestamp,app_provider,app_kind,app_external_id, andapp_parent_id. Unsupported keys return400. Pair external IDs withapp_provider.
- Values must match exactly, except
source_fields.title, which matches a case-insensitive prefix. - All filter pairs combine with AND. When
idsis non-empty, filters apply only to those IDs, and pagination still applies. - Range, contains, and OR operators are not supported. For OR behavior, run separate calls and combine the results in your application.
- A
nullfilter value returns400.
Field projection
Passinclude_fields to keep response payloads small. Only the listed fields are populated, plus id, database, and collection, which are always returned. Treat omitted fields as unavailable in that response. Omit include_fields or pass null to return everything.
- Allowed values are
title,type,description,note,timestamp,metadata,additional_metadata, andrelations, plus the deprecated aliasestenant_metadataanddocument_metadata. content,url, andattachmentsare not valid values. They are stripped from list responses, and requesting one returns400. Fetch them per source with Inspect Context.- Projection applies only to
type=knowledge.
Behavior notes
- Memories: For
type=memory, readdata.user_memories[]. Each entry includes amemory_id, source details, and metadata. Read the memory text andinferred_contentwith Inspect Context. - Memory listing unavailable: If the memory store cannot be read, the call still returns
200with an emptyuser_memoriesandmessageset to"Memories temporarily unavailable". Checkmessagebefore you treat an empty list as “no memories”. - Access control:
acllists the principals to list as. Omitting it, or sending[]or["*"], disables caller-supplied filtering. It is ignored fortype=memory. For enforced connectors, the authenticated caller is used instead; see ACL enforcement. - Limits:
idsaccepts at most100IDs.page_sizeranges from1to100(default50), andpagestarts at1.
Related resources
- Before this: Ingest Context: store the sources to list
- After this: Inspect Context: read one source’s content
- After this: Delete Context: remove sources by ID
- Related: Query: retrieve chunks by relevance instead of listing sources
- Guide: Metadata Filters
Authorizations
Body
application/json
List request
Exact-match filters on metadata, additional_metadata and built-in source_fields. All pairs must match.
Show child attributes
Show child attributes
Example:
{ "additional_metadata": { "author": "ada" }, "metadata": { "department": "finance" }, "source_fields": { "app_external_id": "C0123456789", "app_kind": "slack", "app_provider": "slack", "description": "Internal overview of the Project Phoenix rollout.", "timestamp": "2026-07-02T10:00:00Z", "title": "Project Phoenix Overview", "type": "knowledge", "url": "https://docs.hydradb.com/phoenix" } }
Response
OK
Show child attributes
Show child attributes
Example:
{ "message": "Success", "pagination": { "has_next": true, "has_previous": false, "page": 1, "page_size": 50, "total": 128, "total_pages": 3 }, "sources": [ { "additional_metadata": { "author": "ada", "doc_version": 3 }, "app_external_id": "C0123456789", "app_kind": "slack", "app_provider": "slack", "collection": "team_docs", "comments_truncated": true, "database": "acme_corp", "description": "Internal overview of the Project Phoenix rollout.", "id": "HydraDoc1234", "metadata": { "department": "finance", "priority": 7 }, "note": "Superseded by the Q3 rollout plan.", "sub_tenant_id": "sub_tenant_4567", "tenant_id": "tenant_1234", "timestamp": "2026-07-02T10:00:00Z", "title": "Project Phoenix Overview", "type": "knowledge" } ], "success": true, "total": 128, "user_memories": [ { "additional_metadata": { "author": "ada", "doc_version": 3 }, "app_external_id": "C0123456789", "app_kind": "slack", "app_provider": "slack", "collection": "team_docs", "database": "acme_corp", "description": "Internal overview of the Project Phoenix rollout.", "memory_id": "memory_1234", "metadata": { "department": "finance", "priority": 7 }, "note": "Superseded by the Q3 rollout plan.", "sub_tenant_id": "sub_tenant_4567", "tenant_id": "tenant_1234", "timestamp": "2026-07-02T10:00:00Z", "title": "Project Phoenix Overview", "type": "knowledge" } ] }
Show child attributes
Show child attributes
Example:
{ "collection": "team_docs", "database": "acme_corp", "latency_ms": 12.3, "request_id": "9d13aef4-02f4-4e73-8c62-4c2601d04f9d", "source_type": "file", "sub_tenant_id": "sub_tenant_4567", "tenant_id": "tenant_1234", "warnings": [ { "code": "acl_ignored_by_connector_enforcement", "collections": ["team_docs", "engineering"], "message": "This connector enforces ACL, so the request's acl was ignored." } ] }
Was this page helpful?
