Skip to content

Vector store resource

The vectorStore: resource adds documents to, and runs similarity search against, an external vector database. Unlike embedding: (SQLite keyword/vector index built into kdeps), vectorStore: talks to a real vector database service - Qdrant, Chroma, Pinecone, pgvector, and more - for production-scale RAG.

Where it runs

Both workflow mode and agent mode.

Basic usage

yaml
# resources/index.yaml
actionId: index
name: Index Documents
vectorStore:
  provider: qdrant
  url: http://localhost:6333
  collection: docs
  operation: add_documents
  documents:
    - content: "kdeps is a YAML-based AI agent framework."
      metadata: { source: readme }
  embedModel: text-embedding-3-small
yaml
# resources/search.yaml
actionId: search
name: Semantic Search
requires: [index]
vectorStore:
  provider: qdrant
  url: http://localhost:6333
  collection: docs
  operation: similarity_search
  query: "{{ get('q') }}"
  topK: 5
  embedModel: text-embedding-3-small

Supported providers

providerConnection via url
qdrant (default)http://localhost:6333
chromahttp://localhost:8000 (default if url is empty)
pineconehttps://<index-host>.svc.<env>.pinecone.io
azureaisearchhttps://<service>.search.windows.net, or AZURE_AI_SEARCH_ENDPOINT env var
opensearch / elasticsearchhttp://localhost:9200
weaviatehttp://localhost:8080
pgvector / postgres / postgresql / alloydb / cloudsqlPostgreSQL DSN, e.g. postgres://user:pass@localhost/db
mariadb / dolt / mysqlMySQL DSN, e.g. user:pass@tcp(localhost:3306)/dbname
mongodb / mongoMongoDB URI, e.g. mongodb://localhost:27017
redisRedis URI, e.g. redis://localhost:6379 (default if url is empty). collection is the Redis index name
bedrockAWS Bedrock Knowledge Base - collection is the knowledge base ID; no url or embedModel needed, embedding happens server-side. Uses the standard AWS SDK credential chain (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION)

Configuration options

OptionOperationDescription
providerallVector store backend (see table above)
urlallEndpoint or DSN for the store
collectionallCollection / index / table name (required)
apiKeyallAuth token. For mongodb/mongo, used as the database name instead (default "kdeps"). For opensearch/elasticsearch, format "user:pass"
operationalladd_documents or similarity_search (required)
documentsadd_documentsList of { content, metadata } documents to upsert
querysimilarity_searchNatural language search query
topKsimilarity_searchNumber of results to return (default: 5)
embedModelallEmbedding model used to vectorize documents/queries, e.g. text-embedding-3-small (required)
embedBackendallEmbedding provider: openai, ollama, google
embedBaseURLallCustom base URL for an OpenAI-compatible embedding backend

Output

add_documents:

json
{ "success": true, "upserted": 1 }

similarity_search:

json
{
  "success": true,
  "results": [
    { "content": "kdeps is a YAML-based AI agent framework.", "metadata": { "source": "readme" }, "score": 0.91 }
  ]
}

Feeding from a loader

loader:'s output documents map directly onto vectorStore:'s documents: field - see the Loader Resource for the full load-then-index pipeline.

See also

Released under the Apache 2.0 License.