Documentation Index
Fetch the complete documentation index at: https://docs.ivory.finance/llms.txt
Use this file to discover all available pages before exploring further.
Overview
POST /v1/documents/search runs a hybrid search — BM25 keyword matching combined with KNN vector similarity — over your tenant’s private document index. The two result sets are merged so that documents matching either meaning or exact terms rank highly.
IAM pre-filtering is mandatory on every query. Before the search runs, the caller’s identity, roles, and barrier memberships are evaluated against each document’s visibility, allowed_identity_ids, allowed_roles, and barrier_id fields. A document the caller cannot access returns zero results — it appears not to exist.
How hybrid search works
IAM filter logic
The search applies this filter before executing the BM25/KNN query:caller_roles and crossed_barrier_ids to unlock the full filter. Omitting them restricts results to tenant_wide documents only.
Request
Natural language or keyword search query.
Your tenant UUID.
The identity UUID of the user performing the search. Used for
deal_private visibility checks.Comma-separated role slugs the caller holds. Used for
team_only visibility checks. Example: analyst,bankerComma-separated barrier UUIDs the caller has crossed. Documents behind uncrossed barriers are excluded.
Scope the search to documents associated with a specific entity (deal, company, or person UUID).
Filter by document type:
cim · nda · management_accounts · dd_report · board_pack · research_note · legal_agreement · pitch · otherMaximum number of chunks to return. Each result is one chunk — multiple chunks from the same document may appear.
Response
The original query string.
Number of results returned.
Array of matching chunks, ordered by relevance score.
Examples
Using results with the agent
Passdoc_id values from search results into POST /v1/rag/answer/agent as document_ids. The agent will blend document chunks with SEC filings and web results, citing documents as [D1], [D2], … inline.
