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

kdeps-resource-search-local

v2.58.2

The `searchLocal` executor walks a local directory and returns matching files by filename glob pattern and/or content keyword. See [Search resources](https://kdeps.com/workflow/resources/search) for how it relates to `searchWeb`.

Usage

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

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

Documentation

searchLocal resource

The searchLocal executor walks a local directory and returns matching files by filename glob pattern and/or content keyword. See Search resources for how it relates to searchWeb.

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.

Configuration

# resources/search.yaml
searchLocal:
  path: "/data/documents"    # required: directory to search
  query: "invoice total"     # optional: keyword in file contents
  glob: "*.txt"              # optional: filename pattern
  limit: 10                  # optional: max results (0 = unlimited)
FieldTypeRequiredDefaultDescription
pathstringyes-Directory to search recursively
querystringno-Case-insensitive keyword to find in file contents
globstringno-Filename glob pattern (e.g. *.md, report_*.csv)
limitintegerno0Max results (0 = unlimited)

When both query and glob are set, a file must match both to be included.

Output

KeyTypeDescription
resultsarrayList of matching file objects
countintegerNumber of results
pathstringThe search root used
jsonstringFull result as JSON string

Each result object:

KeyTypeDescription
pathstringFull file path
namestringFilename
sizeintegerFile size in bytes
isDirboolAlways false

Examples

Find all Markdown files:

# resources/find-docs.yaml
actionId: findDocs
searchLocal:
  path: "/workspace/docs"
  glob: "*.md"

Find files containing a keyword:

# resources/find-invoices.yaml
actionId: findInvoices
searchLocal:
  path: "/data/uploads"
  query: "overdue"
  limit: 20

Feed results into an LLM:

# resources/find-files.yaml
actionId: findFiles
searchLocal:
  path: "/data/reports"
  query: "{{ get('query') }}"

---
actionId: answer
requires: [findFiles]
chat:
  model: llama3.2:1b
  prompt: "Files found: {{ output('findFiles').results }}. Summarize."

Indexed search (ranked results)

index: true switches searchLocal from a plain directory walk to a persistent TF-IDF inverted index, giving each result a relevance score instead of just a yes/no filename/content match. The index is built once (or incrementally reused) at ~/.kdeps/projects/<folder>-<hash>/index.db and speeds up repeated searches of the same folder. Nothing is written into the searched folder, so a git repository stays clean.

searchLocal:
  path: "/workspace/docs"
  query: "authentication flow"
  index: true                # build/use a persistent TF-IDF index instead of walking every search
  fuzzy: true                 # optional: Levenshtein fuzzy matching (requires index: true)
  maxDistance: 2               # optional: max edit distance for fuzzy matching, default 2
  indexDBPath: "/custom/index.db"  # optional: override the default ~/.kdeps/projects/<folder>-<hash>/index.db
  graphBoost: true             # optional: re-rank using the folder's link/topic graph (requires index: true)
FieldTypeRequiredDefaultDescription
indexboolnofalseBuild/use a persistent TF-IDF inverted index instead of a plain walk
fuzzyboolnofalseEnable Levenshtein fuzzy term matching (requires index: true)
maxDistanceintegerno2Max edit distance for fuzzy matching
indexDBPathstringno~/.kdeps/projects/<folder>-<hash>/index.dbWhere the TF-IDF index is stored (<hash> is from the folder's absolute path)
graphBoostboolnofalseRe-rank results using the same kartographer reference/topic graph codeIntelligence's indexFolder/graphAll builds - requires index: true

How graphBoost ranks results

searchLocal already ranks by TF-IDF. graphBoost additionally builds a graph of the folder - markdown links and shared topics:/tags: frontmatter - at ~/.kdeps/projects/<folder>-<hash>/graph.db (kept separate from indexDBPath). A result linked from, or sharing a topic with, a top-5 TF-IDF match gets boosted 25% before the final sort, so a lower-scoring-but-connected document can outrank a higher-scoring-but-isolated one - useful when the top match is a short "index" page.

# resources/search-graph.yaml
actionId: findRelatedDocs
searchLocal:
  path: "/workspace/docs"
  query: "{{ get('query') }}"
  index: true
  graphBoost: true

Indexed-mode output

Indexed-mode output rows add two fields on top of the base result shape:

KeyTypeDescription
scorefloatTF-IDF relevance score (post-boost when graphBoost is set)
matchCountintegerNumber of distinct query terms matched
snippetstringText excerpt around the match

See also

Versions

VersionPublishedStatus
2.58.210/12/2026active

Details

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

Tags

kdepsresourcesearchLocal