Embedding Resource
The embedding executor is a native capability compiled into the kdeps binary. It provides a SQLite-backed keyword store for indexing, searching, upserting, and deleting text documents. Use it as the storage layer for RAG pipelines that run fully on-prem.
Configuration
yaml
run:
embedding:
operation: "index" # required: index | search | upsert | delete
text: "document content here" # required for index/search/upsert (optional for delete-all)
collection: "default" # optional namespace (default: "default")
dbPath: "/data/kdeps-store.db" # optional path (default: "kdeps-embedding.db")
limit: 10 # optional max search results (default: 10)1
2
3
4
5
6
7
2
3
4
5
6
7
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
operation | string | yes | — | index, search, upsert, or delete |
text | string | yes* | — | Text to index, query, or delete. *Optional for delete (omit to delete entire collection) |
collection | string | no | "default" | Namespace for documents |
dbPath | string | no | "kdeps-embedding.db" | SQLite database file path |
limit | integer | no | 10 | Max results for search |
Operations
| Operation | Description |
|---|---|
index | Insert text (ignored if duplicate) |
upsert | Insert or replace text |
search | Case-insensitive keyword search via LIKE |
delete | Delete by text, or whole collection if text is empty |
Output
| Key | Type | Description |
|---|---|---|
operation | string | The operation that was performed |
collection | string | The collection used |
success | bool | true on success |
results | []string | Matching texts (search only) |
count | integer | Number of results (search only) |
affected | integer | Rows deleted (delete only) |
json | string | Full result as JSON string |
Examples
Build a RAG pipeline
yaml
# Step 1: Scrape content
metadata:
actionId: fetch
run:
scraper:
url: "{{ get('url') }}"
# Step 2: Index it
metadata:
actionId: storeDoc
requires: [fetch]
run:
embedding:
operation: "index"
text: "{{ output('fetch').content }}"
collection: "knowledge"
dbPath: "/data/store.db"
# Step 3: Search on user query
metadata:
actionId: findDocs
run:
embedding:
operation: "search"
text: "{{ get('query') }}"
collection: "knowledge"
dbPath: "/data/store.db"
limit: 5
# Step 4: Answer with context
metadata:
actionId: answer
requires: [findDocs]
run:
chat:
model: llama3.2:1b
prompt: |
Context: {{ output('findDocs').results }}
Question: {{ get('query') }}
apiResponse:
response: "{{ output('answer') }}"1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Collections
Use collection to namespace documents — useful for multi-tenant or multi-topic stores:
yaml
# Index into separate collections
embedding:
operation: "index"
text: "..."
collection: "contracts"
# Search only within one collection
embedding:
operation: "search"
text: "termination clause"
collection: "contracts"1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
Note: This uses keyword (LIKE) matching, not vector similarity. For OpenAI vector embeddings, install the component:
bashkdeps registry install embedding1
Next Steps
- Scraper Resource - Fetch content to index
- Search Local Resource - Search local files by keyword or glob
- LLM Resource - Use search results as context