Documentation Index
Fetch the complete documentation index at: https://docs.datris.ai/llms.txt
Use this file to discover all available pages before exploring further.
The Search API provides REST endpoints for semantic search across vector databases. Each endpoint converts a natural language query into an embedding vector, searches the specified vector database, and returns the most similar results with relevance scores.
All search endpoints use embedding and vector database connection details stored in HashiCorp Vault. Secret names can be passed per-request or configured as server defaults in application.yaml.
Common Parameters
All search endpoints share these parameters:
| Field | Type | Required | Default | Description |
|---|
query | string | Yes | | Natural language search query |
embeddingSecretName | string | No | ai.embedding.secretName | Optional override of the embedding Vault secret. Defaults to the server-level ai.embedding.secretName (oss/embedding), which is seeded automatically by vault-init.sh. The secret is self-describing: provider, endpoint, model, apiKey, and (optionally) version. |
topK | integer | No | 5 | Number of results to return |
All search endpoints return:
{
"results": [
{
"text": "document chunk content",
"chunk_index": 0,
"source_pipeline": "pipeline_name",
"filename": "document.pdf",
"_score": 0.89
}
],
"count": 1
}
The _score field indicates relevance (higher is more similar, normalized to 0–1 where applicable).
Search Qdrant
POST /api/v1/search/qdrant
| Field | Type | Required | Default | Description |
|---|
collection | string | No | financial_documents | Qdrant collection name |
qdrantSecretName | string | No | Server default | Vault secret (must contain host, optionally port, apiKey). Uses server default if omitted. |
curl -X POST http://localhost:8080/api/v1/search/qdrant \
-H "Content-Type: application/json" \
-d '{
"query": "quarterly revenue projections",
"collection": "financial_documents",
"qdrantSecretName": "oss/qdrant",
"topK": 5
}'
Search Weaviate
POST /api/v1/search/weaviate
| Field | Type | Required | Default | Description |
|---|
className | string | No | FinancialDocuments | Weaviate class name (PascalCase) |
weaviateSecretName | string | No | Server default | Vault secret (must contain host, optionally port, scheme, apiKey). Uses server default if omitted. |
curl -X POST http://localhost:8080/api/v1/search/weaviate \
-H "Content-Type: application/json" \
-d '{
"query": "quarterly revenue projections",
"className": "FinancialDocuments",
"weaviateSecretName": "oss/weaviate",
"topK": 5
}'
Search Milvus
POST /api/v1/search/milvus
| Field | Type | Required | Default | Description |
|---|
collection | string | No | financial_documents | Milvus collection name |
milvusSecretName | string | No | Server default | Vault secret (must contain host, optionally port, apiKey). Uses server default if omitted. |
curl -X POST http://localhost:8080/api/v1/search/milvus \
-H "Content-Type: application/json" \
-d '{
"query": "quarterly revenue projections",
"collection": "financial_documents",
"milvusSecretName": "oss/milvus",
"topK": 5
}'
Search Chroma
POST /api/v1/search/chroma
| Field | Type | Required | Default | Description |
|---|
collection | string | No | financial_documents | Chroma collection name |
chromaSecretName | string | No | Server default | Vault secret (must contain host, optionally port). Uses server default if omitted. |
curl -X POST http://localhost:8080/api/v1/search/chroma \
-H "Content-Type: application/json" \
-d '{
"query": "quarterly revenue projections",
"collection": "financial_documents",
"chromaSecretName": "oss/chroma",
"topK": 5
}'
Search pgvector
POST /api/v1/search/pgvector
| Field | Type | Required | Default | Description |
|---|
table | string | No | financial_documents | PostgreSQL table name |
schema | string | No | public | PostgreSQL schema |
postgresSecretName | string | No | Server default | Vault secret (must contain jdbcUrl, optionally username, password). Uses server default if omitted. |
curl -X POST http://localhost:8080/api/v1/search/pgvector \
-H "Content-Type: application/json" \
-d '{
"query": "quarterly revenue projections",
"table": "financial_documents",
"schema": "public",
"postgresSecretName": "oss/pgvector",
"topK": 5
}'
Natural Language Query
Ask a question in plain English — the AI generates and executes a SQL query against PostgreSQL.
POST /api/v1/query/natural
| Field | Type | Required | Default | Description |
|---|
question | string | Yes | | Natural language question |
table | string | Yes | | Target table name |
schema | string | No | public | PostgreSQL schema |
database | string | No | datris | PostgreSQL database |
limit | integer | No | 100 | Maximum rows to return |
curl -X POST http://localhost:8080/api/v1/query/natural \
-H "Content-Type: application/json" \
-d '{
"question": "What are the top 5 stocks by volume?",
"table": "stock_prices"
}'
Returns the AI-generated SQL query and its results.
AI Answer (RAG)
Answer a question using AI based on provided context — typically used after a vector search to generate a natural language answer from retrieved chunks.
| Field | Type | Required | Description |
|---|
query | string | Yes | The question to answer |
context | string | Yes | Context text (e.g., concatenated search results) |
curl -X POST http://localhost:8080/api/v1/ai/answer \
-H "Content-Type: application/json" \
-d '{
"query": "What was Apple'\''s revenue last quarter?",
"context": "Apple reported revenue of $94.9 billion for Q1 2026..."
}'
Returns the AI-generated answer based on the provided context.
Vault Secret Structure
Embedding Secret
Self-describing — the resolver reads provider, endpoint, model, apiKey, and (optionally) version from inside the secret. See AI Configuration.
{
"provider": "openai",
"endpoint": "https://api.openai.com/v1/embeddings",
"model": "text-embedding-3-small",
"apiKey": "sk-..."
}
For Anthropic-only deployments, the bundled TEI sidecar serves bge-m3 and vault-init.sh seeds the embedding secret to point at it (provider: "tei", endpoint: "http://tei:80/v1/embeddings", model: "BAAI/bge-m3").
Vector Database Secrets
Qdrant:
{ "host": "localhost", "port": "6334", "apiKey": "" }
Weaviate:
{ "host": "localhost", "port": "8079", "scheme": "http", "apiKey": "" }
Milvus:
{ "host": "localhost", "port": "19530", "apiKey": "" }
Chroma:
{ "host": "localhost", "port": "8000" }
pgvector:
{ "jdbcUrl": "jdbc:postgresql://localhost:5432/datris", "username": "postgres", "password": "postgres" }