Skip to main content
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:
FieldTypeRequiredDefaultDescription
querystringYesNatural language search query
embeddingSecretNamestringNoServer defaultVault secret name for the embedding provider (must contain endpoint, model, and optionally apiKey). Uses server default from application.yaml if omitted.
topKintegerNo5Number of results to return

Common Response Format

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
FieldTypeRequiredDefaultDescription
collectionstringNofinancial_documentsQdrant collection name
qdrantSecretNamestringNoServer defaultVault 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",
    "embeddingSecretName": "oss/openai-embedding",
    "qdrantSecretName": "oss/qdrant",
    "topK": 5
  }'

Search Weaviate

POST /api/v1/search/weaviate
FieldTypeRequiredDefaultDescription
classNamestringNoFinancialDocumentsWeaviate class name (PascalCase)
weaviateSecretNamestringNoServer defaultVault 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",
    "embeddingSecretName": "oss/openai-embedding",
    "weaviateSecretName": "oss/weaviate",
    "topK": 5
  }'

Search Milvus

POST /api/v1/search/milvus
FieldTypeRequiredDefaultDescription
collectionstringNofinancial_documentsMilvus collection name
milvusSecretNamestringNoServer defaultVault 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",
    "embeddingSecretName": "oss/openai-embedding",
    "milvusSecretName": "oss/milvus",
    "topK": 5
  }'

Search Chroma

POST /api/v1/search/chroma
FieldTypeRequiredDefaultDescription
collectionstringNofinancial_documentsChroma collection name
chromaSecretNamestringNoServer defaultVault 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",
    "embeddingSecretName": "oss/openai-embedding",
    "chromaSecretName": "oss/chroma",
    "topK": 5
  }'

Search pgvector

POST /api/v1/search/pgvector
FieldTypeRequiredDefaultDescription
tablestringNofinancial_documentsPostgreSQL table name
schemastringNopublicPostgreSQL schema
postgresSecretNamestringNoServer defaultVault 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",
    "embeddingSecretName": "oss/openai-embedding",
    "postgresSecretName": "oss/pgvector",
    "topK": 5
  }'

Vault Secret Structure

Embedding Secret

{
  "endpoint": "https://api.openai.com/v1/embeddings",
  "model": "text-embedding-3-small",
  "apiKey": "sk-..."
}

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" }