Alphakdeps.io is experimental and evolving — the registry and packages may change or reset.
ResourceBuilt-in resource

kdeps-resource-embedding

v2.65.0

The `embedding` component runs one embedding operation and returns a structured result: a SQLite keyword store for `index`, `search`, `upsert`, and `delete`, an embedding backend for `vectorize` and `embed_query`, and Cohere for `rerank`. It is a kdeps component from the `components` asset set: call it with a `component:` resource, no install step. Its call is the kdeps API's `embedding` tool, which runs the native embedding executor. A workflow that uses `embedding:` directly - primary or in a `before:`/`after:` step - is rejected.

Usage

Built into kdeps: no install. Add it to a resource under the embedding: key.

# resources/my-step.yaml actionId: myStep embedding: # options below

Documentation

embedding component

The embedding component runs one embedding operation and returns a structured result: a SQLite keyword store for index, search, upsert, and delete, an embedding backend for vectorize and embed_query, and Cohere for rerank. It is a kdeps component from the components asset set: call it with a component: resource, no install step. Its call is the kdeps API's embedding tool, which runs the native embedding executor. A workflow that uses embedding: directly - primary or in a before:/after: step - is rejected.

It works in both modes: as a DAG step in workflow mode, and inside any workflow the LLM calls as a tool in agent mode.

direction: right
call: "component: embedding" {shape: oval}
api: "POST /tools/embedding/call"
sqlite: "SQLite keyword store\nindex, search, upsert, delete"
backend: "embedding backend\nvectorize, embed_query"
cohere: "Cohere\nrerank"
out: "result map" {shape: oval}
call -> api
api -> sqlite: "operation index/search/upsert/delete"
api -> backend: "operation vectorize/embed_query"
api -> cohere: "operation rerank"
sqlite -> out
backend -> out
cohere -> out

Configuration

# resources/store.yaml
actionId: store
name: Store Document
component:
  name: embedding                   # from the components asset set; a components/embedding/ of your own wins
  with:
    operation: index                # required: index | search | upsert | delete | vectorize | embed_query | rerank
    text: "{{ get('text') }}"       # text to index, search for, upsert or delete
    collection: docs                # optional namespace (default: "default")
    dbPath: /data/store.db          # optional SQLite path; default from the kdeps embedding defaults
    limit: 5                        # optional max search results
InputTypeRequiredDefaultDescription
operationstringyes-index, search, upsert, delete, vectorize, embed_query, or rerank
textstringsee below-Text to index, search for, upsert, or delete. Required for index, search, and upsert; empty deletes the whole collection on delete
collectionstringno"default"Namespace inside the SQLite database
dbPathstringnokdeps embedding defaultSQLite database file path
limitnumbernokdeps embedding defaultMax results for search
inputsarrayyes for vectorize, embed_query-Texts to embed
modelstringnobackend defaultEmbedding model, e.g. text-embedding-3-small
backendstringnokdeps LLM backendopenai, ollama, or google
baseURLstringno-Custom base URL for an OpenAI-compatible backend
rerankQuerystringyes for rerank-Query the candidate documents are ranked against
rerankDocumentsarrayyes for rerank-Candidate documents to rerank
rerankTopNnumberno0 (all)Number of top reranked results

Operations

OperationBackingDescription
indexSQLiteInsert text (ignored if duplicate)
upsertSQLiteInsert or replace text
searchSQLiteCase-insensitive keyword search via LIKE
deleteSQLiteDelete by text, or the whole collection when text is empty
vectorizeembedding backendConvert inputs into vectors
embed_queryembedding backendConvert text into a query vector
rerankCohereRank rerankDocuments against rerankQuery

Output

{
  "operation": "search",
  "collection": "docs",
  "query": "compiled language",
  "results": ["Go is a statically typed, compiled programming language."],
  "count": 1,
  "json": "{\"collection\":\"docs\",...}"
}

Read fields with output('store').results, output('store').count, and so on.

KeyTypeDescription
operationstringThe operation that was performed
collectionstringThe collection used
successbooltrue on success
results[]stringMatching texts (search only)
countintegerNumber of results (search only)
affectedintegerRows deleted (delete only)
jsonstringFull result as a JSON string

A failed operation does not return this map: the call fails and onError: on the resource decides what happens next.

Examples

Build a RAG pipeline

# Step 1: Scrape content
actionId: fetch
component:
  name: web_scraper
  with:
    url: "{{ get('url') }}"

# Step 2: Index it
actionId: storeDoc
requires: [fetch]
component:
  name: embedding
  with:
    operation: index
    text: "{{ output('fetch').content }}"
    collection: knowledge
    dbPath: /data/store.db

# Step 3: Search on user query
actionId: findDocs
component:
  name: embedding
  with:
    operation: search
    text: "{{ get('query') }}"
    collection: knowledge
    dbPath: /data/store.db
    limit: 5

# Step 4: Answer with context
actionId: answer
requires: [findDocs]
chat:
  model: llama3.2:1b
  prompt: |
    Context: {{ output('findDocs').results }}
    Question: {{ get('query') }}
apiResponse:
  response: "{{ output('answer') }}"

Vector embeddings

# resources/embed.yaml
actionId: embed
component:
  name: embedding
  with:
    operation: vectorize
    inputs: ["{{ get('text') }}"]    # texts to embed
    model: text-embedding-3-small
    backend: openai                  # KDEPS_OPENAI_API_KEY or ~/.kdeps/config.yaml

Collections

Use collection to namespace documents - useful for multi-tenant or multi-topic stores:

# Index into separate collections
component:
  name: embedding
  with:
    operation: index
    text: "..."
    collection: contracts

# Search only within one collection
component:
  name: embedding
  with:
    operation: search
    text: termination clause
    collection: contracts

Note: index, search, upsert, and delete use keyword (LIKE) matching, not vector similarity. Use vectorize and embed_query with a backend for vector embeddings.

See also

Versions

VersionPublishedStatus
2.65.010/29/2026active
2.64.010/28/2026active
2.63.010/25/2026active
2.62.010/25/2026active
2.61.010/23/2026active
2.60.010/22/2026active
2.59.010/21/2026active
2.58.210/12/2026active

Details

Author
kdeps
License
Apache-2.0
Latest Version
2.65.0
Published
10/12/2026

Tags

kdepsresourceembedding