***

title: NativeVectorSearchSkill
slug: /reference/typescript/agents/skills/native-vector-search
description: In-memory document search using TF-IDF-like word overlap scoring.
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

[add-skill]: /docs/server-sdks/reference/typescript/agents/agent-base/add-skill

In-memory document search using TF-IDF-like word overlap scoring. No external
dependencies or API keys required. Documents are provided via config and indexed
at construction time.

**Class:** `NativeVectorSearchSkill`

**Tools:** `search_documents`

**Env vars:** None

**Multi-instance:** Yes

<ParamField path="tool_name" type="string" toc={true}>
  Custom tool name for this instance. Required when using multiple instances.
</ParamField>

<ParamField path="documents" type={"Record<string, unknown>[]"} toc={true}>
  Array of documents to index. Each object has:

  * `id` (string, required) -- Unique document identifier.
  * `text` (string, required) -- Full text content of the document.
  * `metadata` (object, optional) -- Metadata associated with the document.
</ParamField>

<ParamField path="num_results" type="number" default="3" toc={true}>
  Default number of top results to return.
</ParamField>

<ParamField path="distance_threshold" type="number" default="0" toc={true}>
  Minimum relevance score threshold.
</ParamField>

```typescript {6-13}
import { AgentBase, NativeVectorSearchSkill } from '@signalwire/sdk';

const agent = new AgentBase({ name: 'assistant', route: '/assistant' });
agent.setPromptText('You are a helpful assistant.');

await agent.addSkill(new NativeVectorSearchSkill({
  tool_name: 'search_faqs',
  documents: [
    { id: 'faq-1', text: 'To reset your password, visit the settings page...' },
    { id: 'faq-2', text: 'Refund requests must be submitted within 30 days...' },
  ],
  num_results: 3,
}));

agent.run();
```