Documentation menu
Every chunk carries a metadata object. Any field you write — plus the system fields Anansi writes automatically — can be filtered at query time.
Filters are accepted on:
GET /v1/context— thefiltersquery param, JSON-encodedPOST /v1/search— thefiltersbody fieldGET /v1/memories— thesourceTypeconvenience param is a shorthand for a filter
Filter object shape
Equality filters
Match chunks where a metadata field equals an exact value.
Null check:
Numeric range filters
The field is cast to float before comparison, so it works for integers and decimals stored as JSON numbers.
Contains filter
Tests whether the metadata field's JSONB value contains the given value. Useful for arrays and nested objects.
Logical operators
Combine conditions with $and or $or at any level.
Filters nest up to 5 levels deep and accept up to 50 total conditions. Multiple keys inside one metadata object are ANDed:
System metadata fields
Anansi writes these fields on every chunk automatically. You can filter on any of them.
| Field | Type | Description |
|---|---|---|
| sourceType | string | The sourceType you passed on ingest (conversation, meeting, etc.) |
| author | string | The userId of the ingest caller, or overridden by metadata.author |
| authorId | string | Always the userId of the ingest caller |
| timestamp | string | ISO 8601 — metadata.timestamp if provided, otherwise ingest time |
| channelName | string | Always "api" for API ingests |
| sessionId | string | Only present if sessionId was provided on ingest |
| agentId | string | Only present if agentId was provided on ingest |
| embedding_source | string | "custom" when a bring-your-own embedding was used |
Usage examples
GET /v1/context — filter relevant chunks by source type
Or with a library:
POST /v1/search — search within a date range
Assuming you store a numeric timestamp in metadata.timestamp on ingest: