> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agno.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Knowledge Tools

> KnowledgeTools provide intelligent search and analysis capabilities over knowledge bases with reasoning integration.

## Prerequisites

The following example requires the `agno`, `fastembed`, `openai`, and `qdrant-client` libraries. It connects to Qdrant on `localhost:6333`.

```shell theme={null}
uv pip install agno fastembed openai qdrant-client
docker run -d --name qdrant -p 6333:6333 qdrant/qdrant:latest
```

Set your OpenAI API key:

```shell theme={null}
export OPENAI_API_KEY=***
```

## Example

The following agent can search and analyze knowledge bases:

```python theme={null}
from agno.agent import Agent
from agno.knowledge.embedder.openai import OpenAIEmbedder
from agno.knowledge.knowledge import Knowledge
from agno.models.openai import OpenAIChat
from agno.tools.knowledge import KnowledgeTools
from agno.vectordb.qdrant import Qdrant
from agno.vectordb.search import SearchType

knowledge = Knowledge(
    vector_db=Qdrant(
        collection="knowledge_tools_demo",
        url="http://localhost:6333",
        search_type=SearchType.hybrid,
        embedder=OpenAIEmbedder(id="text-embedding-3-small"),
    ),
)
knowledge.insert(url="https://docs.agno.com/llms-full.txt")

agent = Agent(
    model=OpenAIChat(id="gpt-4o"),
    tools=[KnowledgeTools(knowledge=knowledge)],
    markdown=True,
)

agent.print_response("How do I build a team of agents in Agno?", stream=True)
```

## Toolkit Params

| Parameter           | Type            | Default | Description                                   |
| ------------------- | --------------- | ------- | --------------------------------------------- |
| `knowledge`         | `Knowledge`     | -       | Knowledge base instance (required).           |
| `enable_think`      | `bool`          | `True`  | Enable reasoning capabilities.                |
| `enable_search`     | `bool`          | `True`  | Enable knowledge search functionality.        |
| `enable_analyze`    | `bool`          | `True`  | Enable knowledge analysis capabilities.       |
| `instructions`      | `Optional[str]` | `None`  | Custom instructions for knowledge operations. |
| `add_instructions`  | `bool`          | `True`  | Whether to add instructions to the agent.     |
| `add_few_shot`      | `bool`          | `False` | Whether to include few-shot examples.         |
| `few_shot_examples` | `Optional[str]` | `None`  | Custom few-shot examples.                     |
| `all`               | `bool`          | `False` | Enable all functionality.                     |

## Toolkit Functions

| Function           | Description                                                          |
| ------------------ | -------------------------------------------------------------------- |
| `think`            | Scratchpad for reasoning about the question and planning searches.   |
| `search_knowledge` | Search the knowledge base for relevant information.                  |
| `analyze`          | Evaluate whether the retrieved documents are correct and sufficient. |

## Developer Resources

* [Tools Source](https://github.com/agno-agi/agno/blob/main/libs/agno/agno/tools/knowledge.py)
* [Knowledge overview](/knowledge/overview)
* [Vector stores](/knowledge/vector-stores/index)
