native_vector_search
native_vector_search
Search document indexes using vector similarity and keyword search. Supports three
modes: local SQLite (.swsearch files), local PostgreSQL via pgvector, and remote
search servers. Indexes are built with the sw-search CLI tool.
Tools: search_knowledge (default, customizable via tool_name)
Requirements: Search extras installed (pip install "signalwire[search]")
Multi-instance: Yes
Core Parameters
index_file
Path to the .swsearch index file (SQLite backend only).
tool_name
Custom function name for this skill instance. Required when using multiple instances.
build_index
Whether to build the index from source files on startup.
source_dir
Directory containing documents to index. Required when build_index=True.
remote_url
URL of a remote search server for network mode (e.g., http://localhost:8001).
index_name
Name of the index on a remote server. Only used with remote_url.
Search Parameters
count
Number of search results to return (1–20).
similarity_threshold
Minimum similarity score for results (0.0–1.0).
keyword_weight
Manual keyword weight (0.0–1.0). Overrides automatic weight detection.
model_name
Embedding model. Shortcuts: "mini" (fastest, 384 dims), "base" or "large"
(768 dims). Full model names also accepted.
Content Parameters
tags
Tags to filter search results.
global_tags
Tags applied to all documents when building the index.
file_types
File extensions to include when building the index.
exclude_patterns
Glob patterns to exclude when building the index.
max_content_length
Maximum total response size in characters.
Response Parameters
no_results_message
Message returned when no results are found. Supports {query} placeholder.
response_prefix
Text prepended to the search response.
response_postfix
Text appended to the search response.
response_format_callback
Optional callback to format the response. Must return a string.
description
Description of the 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: "sqlite" or "pgvector". Ignored when remote_url is set.
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.