> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2-service-account.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Knowledge Tools

The `KnowledgeTools` toolkit enables Agents to search, retrieve, and analyze information from knowledge bases. This toolkit integrates with `Knowledge` and provides a structured workflow for finding and evaluating relevant information before responding to users.

The toolkit implements a "Think → Search → Analyze" cycle that allows an Agent to:

1. Think through the problem and plan search queries
2. Search the knowledge base for relevant information
3. Analyze the results to determine if they are sufficient or if additional searches are needed

This approach significantly improves an Agent's ability to provide accurate information by giving it tools to find, evaluate, and synthesize knowledge.

The toolkit includes the following tools:

* `think`: A scratchpad for planning, brainstorming keywords, and refining approaches. These thoughts remain internal to the Agent and are not shown to users.
* `search_knowledge`: Executes queries against the knowledge base to retrieve relevant documents.
* `analyze`: Evaluates whether the returned documents are correct and sufficient, determining if further searches are needed.

## Example

Here's an example of how to use the `KnowledgeTools` toolkit:

```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 OpenAIResponses
from agno.tools.knowledge import KnowledgeTools
from agno.vectordb.lancedb import LanceDb, SearchType

# Create a knowledge base containing information from a URL
agno_docs = Knowledge(
    # Use LanceDB as the vector database and store embeddings in the `agno_docs` table
    vector_db=LanceDb(
        uri="tmp/lancedb",
        table_name="agno_docs",
        search_type=SearchType.hybrid,
        embedder=OpenAIEmbedder(id="text-embedding-3-small"),
    ),
)
agno_docs.insert(
    url="https://docs.agno.com/llms-full.txt"
)

knowledge_tools = KnowledgeTools(
    knowledge=agno_docs,
    enable_think=True,
    enable_search=True,
    enable_analyze=True,
    add_few_shot=True,
)

agent = Agent(
    model=OpenAIResponses(id="gpt-5.2"),
    tools=[knowledge_tools],
    markdown=True,
)

if __name__ == "__main__":
    agent.print_response("How do I build multi-agent teams with Agno?", stream=True)
```

The toolkit comes with default instructions and optional few-shot examples to help the Agent use the tools effectively. Here is how you can configure them:

```python theme={null}
from agno.tools.knowledge import KnowledgeTools

knowledge_tools = KnowledgeTools(
    knowledge=my_knowledge_base,
    enable_think=True,         # Enable the think tool (true by default)
    enable_search=True,        # Enable the search tool (true by default)
    enable_analyze=True,       # Enable the analyze tool (true by default)
    add_instructions=True,     # Add default instructions
    add_few_shot=True,         # Add few-shot examples (false by default)
    few_shot_examples=None,    # Optional custom few-shot examples
)
```
