# Knowledge retrieval tool Node

### Overview

The Knowledge Retrieval Tool Node creates a tool that enables agents to search and retrieve information from vector store collections. It provides semantic search capabilities with customizable filtering options and can be used to integrate knowledge bases into agent-based flows.

Usage cost: 1 credit

### Configuration

#### Settings

1. **Collection Settings**
   * Collection\*: Select the vector store collection to search
   * Number of Documents\*: Specify how many documents to retrieve (minimum 1)
2. **Tool Configuration**
   * Tool Name\*: Unique identifier for the tool (no spaces)
   * Tool Description\*: Explanation of when and how to use the tool
   * Filtering: Optional conditions to filter search results

#### Output Ports

* `retrieval_tool` (Tool): A tool object that:
  * Searches the specified collection
  * Returns relevant documents
  * Applies configured filters
  * Maintains metadata

### Best Practices

1. **Tool Configuration**
   * Use clear, descriptive tool names
   * Write comprehensive descriptions
   * Set appropriate document limits
   * Consider search context
2. **Filter Design**
   * Follow vector store syntax
   * Test filters thoroughly
   * Use variables strategically
3. **Performance**
   * Optimize document count
   * Design efficient filters

### Common Issues

* Invalid filter syntax
* Excessive document retrieval
* Filter parsing errors
* Collection connectivity issues

For vector store specific filter syntax, refer to:

* Milvus: [Filtering Documentation](https://milvus.io/docs/boolean.md)
* Zilliz: [Filtering Documentation](https://docs.zilliz.com/docs/filtering)
* Qdrant: [Filtering Documentation](https://qdrant.tech/documentation/concepts/filtering/)
* Chroma: [Where Filters Documentation](https://docs.trychroma.com/docs/querying-collections/metadata-filtering)
* Pinecone: [Metadata Filtering Guide](https://docs.pinecone.io/guides/data/filter-with-metadata#metadata-query-language)


---

# Agent Instructions: 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:

```
GET https://docs.waterflai.ai/studio/studio-builders/flow-components-nodes/knowledge-retrieval-tool-node.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
