For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Log inSign up
Support
GuidesReference
GuidesReference
    • Core
      • Overview
    • Agents
      • Overview
      • AgentBase
      • AgentServer
      • BedrockAgent
      • CLI Tools
      • Configuration
      • ContextBuilder
      • DataMap
      • FunctionResult
      • Helper Functions
      • LiveWire
      • MCP Gateway
      • PomBuilder
      • Prefabs
      • Search
      • SkillBase
      • Skills
        • api_ninjas_trivia
        • claude_skills
        • Custom Skills
        • datasphere
        • datasphere_serverless
        • datetime
        • google_maps
        • info_gatherer
        • joke
        • math
        • mcp_gateway
        • native_vector_search
        • play_background_file
        • spider
        • swml_transfer
        • weather_api
        • web_search
        • wikipedia_search
      • SWAIGFunction
      • SWMLBuilder
      • SWMLService
      • WebService
    • RELAY
      • Overview
      • Actions
      • Call
      • Constants
      • Events
      • Message
      • RelayClient
      • RelayError
    • REST Client
      • Overview
      • Addresses
      • Calling
      • Chat
      • Compat
      • Datasphere
      • Fabric
      • Imported Numbers
      • Logs
      • Lookup
      • MFA
      • Number Groups
      • Phone Numbers
      • Project
      • PubSub
      • Queues
      • Recordings
      • Registry
      • RestClient
      • Short Codes
      • SignalWireRestError
      • SIP Profile
      • Verified Callers
      • Video
LogoLogoSignalWire Docs
Log inSign up
Support
On this page
  • Core Parameters
  • index_file
  • tool_name
  • build_index
  • source_dir
  • remote_url
  • index_name
  • Search Parameters
  • count
  • similarity_threshold
  • keyword_weight
  • model_name
  • Content Parameters
  • tags
  • global_tags
  • file_types
  • exclude_patterns
  • max_content_length
  • Response Parameters
  • no_results_message
  • response_prefix
  • response_postfix
  • response_format_callback
  • description
  • hints
  • NLP Parameters
  • nlp_backend
  • query_nlp_backend
  • index_nlp_backend
  • Backend Parameters
  • backend
  • connection_string
  • collection_name
  • Other Parameters
  • verbose
  • overwrite
AgentsSkills

native_vector_search

|View as Markdown|Open in Claude|
Was this page helpful?
Edit this page
Previous

play_background_file

Next
Built with

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-sdk[search]")

Multi-instance: Yes

Core Parameters

index_file
str

Path to the .swsearch index file (SQLite backend only).

tool_name
strDefaults to search_knowledge

Custom function name for this skill instance. Required when using multiple instances.

build_index
boolDefaults to False

Whether to build the index from source files on startup.

source_dir
str

Directory containing documents to index. Required when build_index=True.

remote_url
str

URL of a remote search server for network mode (e.g., http://localhost:8001).

index_name
strDefaults to default

Name of the index on a remote server. Only used with remote_url.

Search Parameters

count
intDefaults to 5

Number of search results to return (1–20).

similarity_threshold
floatDefaults to 0.0

Minimum similarity score for results (0.0–1.0).

keyword_weight
float

Manual keyword weight (0.0–1.0). Overrides automatic weight detection.

model_name
strDefaults to mini

Embedding model. Shortcuts: "mini" (fastest, 384 dims), "base" or "large" (768 dims). Full model names also accepted.

Content Parameters

tags
list[str]Defaults to []

Tags to filter search results.

global_tags
list[str]Defaults to []

Tags applied to all documents when building the index.

file_types
list[str]

File extensions to include when building the index.

exclude_patterns
list[str]

Glob patterns to exclude when building the index.

max_content_length
intDefaults to 32768

Maximum total response size in characters.

Response Parameters

no_results_message
str

Message returned when no results are found. Supports {query} placeholder.

response_prefix
str

Text prepended to the search response.

response_postfix
str

Text appended to the search response.

response_format_callback
callable

Optional callback to format the response. Must return a string.

description
strDefaults to Search the knowledge base for information

Description of the tool presented to the AI.

hints
list[str]Defaults to []

Additional speech recognition hints for the tool.

NLP Parameters

nlp_backend
strDefaults to basic

NLP backend for query processing: "basic", "spacy", or "nltk". Deprecated — use query_nlp_backend and index_nlp_backend instead.

query_nlp_backend
str

NLP backend for query expansion: "basic", "spacy", or "nltk".

index_nlp_backend
str

NLP backend for indexing: "basic", "spacy", or "nltk".

Backend Parameters

backend
strDefaults to sqlite

Storage backend: "sqlite" or "pgvector". Ignored when remote_url is set.

connection_string
str

PostgreSQL connection string. Required when backend="pgvector".

collection_name
str

PostgreSQL collection name. Required when backend="pgvector".

Other Parameters

verbose
boolDefaults to False

Enable verbose logging during indexing and search.

overwrite
boolDefaults to False

Overwrite existing pgvector collection when building the index.

1from signalwire import AgentBase
2
3class MyAgent(AgentBase):
4 def __init__(self):
5 super().__init__(name="assistant", route="/assistant")
6 self.set_prompt_text("You are a helpful assistant.")
7 self.add_skill("native_vector_search", {
8 "index_file": "/path/to/knowledge.swsearch",
9 "tool_name": "search_docs"
10 })
11
12agent = MyAgent()
13agent.serve()