> For the complete documentation index, see [llms.txt](https://docs.uptiq.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.uptiq.ai/platform-resources/skill-library/data-skills-rag/vector-search.md).

# Vector Search

A database search finds exact matches — a transaction by ID, a client by surname. **Vector Search** finds things by *meaning*: it performs a semantic search against a vector database and returns the documents most relevant to the intent of your query, whether or not they contain your words.

{% hint style="info" %}
**Reference layer pending.** This page documents the skill's purpose and configuration as used in the builder. Its formal configuration schema, output schema, and error codes are not yet documented — see the [Skill Library](/platform-resources/skill-library.md) overview.
{% endhint %}

## Worked example: finding lender policies for a loan type

A workflow guides a user through a loan application. They ask what documents are required for a Small Business Line of Credit. The lender policies are stored as documents in a vector database.

**The problem.** The policies are long, and a keyword search for "SBLOC" misses every document that says *"small business credit facility"* instead — which is the same thing, written by someone else.

**The approach.** Query in natural language — *"What are the required documents for an SBLOC loan?"* — and let the semantic search find the relevant policies regardless of the terminology they happen to use.

**1. Choose the store.** Select the vector database holding your policies in **Vector Store ID**.

**2. Set the query.** Use the previous skill's output — the user's question.

**3. Set `k`.** How many of the top results to return. `5` or `10` is a reasonable starting point; go higher when the knowledge base is large or the relevant material is scattered.

**4. Filter (optional).** If your documents carry metadata, **Filters** takes a stringified JSON object to narrow the search: `{"document_type": "lender_policy"}`.

## Output

* **`retrievedDocs`** — the documents found. Each has `pageContent` and `metadata`.
* **`statusCode`** — `200` success · `400` invalid configuration · `500` service error.
* **`error`** — a descriptive message if the search failed.

Vector Search **retrieves**; it doesn't answer. Pass `retrievedDocs` to a [Prompt](/platform-resources/skill-library/ai-skills/prompt.md) skill to summarize or reason over them.

{% hint style="info" %}
**Vector Search or** [**RAG Query**](/platform-resources/skill-library/data-skills-rag/rag-query.md)**?** Vector Search returns documents and leaves the rest to you — right when you want to inspect, filter, or route based on what came back. RAG Query retrieves *and* generates an answer in one step — right when you just want the answer. Reach for RAG Query first; use Vector Search when you need the retrieved material itself.
{% endhint %}

***

For how retrieval works, see [Knowledge & Context](/core-concepts/knowledge-and-context.md). To add this skill to an agent, see [Adding a Skill to the Agent](/agent-builder/build/adding-a-skill-to-the-agent.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.uptiq.ai/platform-resources/skill-library/data-skills-rag/vector-search.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
