NativeVectorSearchSkill
Search documents using vector similarity and keyword matching. Supports three modes:
- In-memory (TF-IDF) — supply a
documentsarray in config; the skill tokenizes and indexes at startup (TypeScript-specific fast path). - Local (SQLite) — point
index_fileat a.swsearchindex, or setbuild_index: trueandsource_dirto index at startup. - Remote (network) — point
remote_urlat a search server and optionally name the index viaindex_name. Validated by the SSRF guard before each request; health check uses a 5-second timeout.
Class: NativeVectorSearchSkill
Tools: search_knowledge (default — tool_name override supported)
Env vars: None
Multi-instance: yes (distinguished by tool_name + index_file)
Core Parameters
tool_name
Custom tool name for this skill instance. Required when registering multiple instances on the same agent.
index_file
Path to a local .swsearch SQLite index file.
build_index
Whether to build the index from source files at startup.
source_dir
Directory containing documents to index. Required when build_index is
true.
remote_url
URL of a remote search server (network mode). Validated by the SSRF guard — private, loopback, and cloud-metadata endpoints are rejected.
index_name
Name of the index on a remote server. Only used with remote_url.
documents
In-memory array of documents to index (TypeScript-specific). Each entry has
id (string), text (string), optional metadata (object), and optional
tags (string[]).
Search Parameters
count
Number of search results to return (range 1-20).
similarity_threshold
Minimum similarity score for results (0.0 — no limit, 1.0 — exact match).
keyword_weight
Manual keyword weight in the hybrid TF-IDF + keyword score
(range 0.0-1.0). Overrides the automatic default of 0.3.
model_name
Embedding model for remote/SQLite modes. Shortcuts: "mini" (fastest,
384 dims), "base" or "large" (768 dims). Full model names also accepted.
Content Parameters
tags
Tag filter applied to search queries. Only documents carrying at least one matching tag are returned.
global_tags
Tags applied to every document at index-build time.
file_types
File extensions to include when building an index from source_dir.
exclude_patterns
Glob patterns excluded from index builds. Defaults include
**/node_modules/**, **/.git/**, **/dist/**, **/build/**.
max_content_length
Maximum total response size in characters (distributed across all results).
Response Parameters
no_results_message
Message returned when no results match. Supports a {query} placeholder
that is substituted with the user’s query text.
response_prefix
Text prepended to the search response.
response_postfix
Text appended to the search response.
response_format_callback
Optional callback to transform the final response. Receives
{ response, agent, query, results, args, count, skill } and must return a
string.
description
Description of the search tool presented to the AI.
hints
Additional speech recognition hints for the tool.
NLP Parameters
nlp_backend
NLP backend for query processing: "basic", "spacy", or "nltk".
Deprecated — use query_nlp_backend and index_nlp_backend instead.
query_nlp_backend
NLP backend for query expansion: "basic", "spacy", or "nltk".
index_nlp_backend
NLP backend for indexing: "basic", "spacy", or "nltk".
Backend Parameters
backend
Storage backend for local database mode: "sqlite" or "pgvector". Ignored
when remote_url is set. SQLite and pgvector backends require native
Python-only dependencies; configurations written for the Python SDK remain
valid but the TypeScript SDK only exercises the in-memory (documents) and
remote (remote_url) paths.
connection_string
PostgreSQL connection string. Required when backend="pgvector".
collection_name
PostgreSQL collection name. Required when backend="pgvector".
Other Parameters
verbose
Enable verbose logging during indexing and search.
overwrite
Overwrite existing pgvector collection when building the index.