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

# Query Pinecone Tool

> Search vector embeddings in Pinecone for semantic similarity and document retrieval

## What it does

The Query Pinecone tool searches vector embeddings in your Pinecone database to find semantically similar documents. Perfect for RAG (Retrieval-Augmented Generation), semantic search, recommendation systems, and finding relevant content based on meaning rather than keywords.

<Note>
  **Requires Pinecone Integration**: You need to set up a [Pinecone integration](/integrations/pinecone) before agents can use this tool.
</Note>

## Key features

* Semantic search using vector embeddings
* Search within specific namespaces for organized data
* Configurable result limits for performance optimization
* Access to similarity scores and metadata
* High-performance vector similarity matching

## Parameters

| Parameter   | Type   | Required | Description                                |
| ----------- | ------ | -------- | ------------------------------------------ |
| `query`     | string | Yes      | The search query to find similar documents |
| `namespace` | string | Yes      | The namespace within Pinecone to search    |
| `top_k`     | number | No       | Number of results to return (default: 5)   |

## Common use cases

### Document retrieval for RAG

```
query: "How to implement authentication in web applications"
namespace: "documentation"
top_k: 10
```

Find relevant documentation for answering user questions.

### Content recommendation

```
query: "machine learning tutorials for beginners"
namespace: "educational_content"
top_k: 5
```

Recommend similar content based on user interests.

### Semantic search

```
query: "customer complaints about product quality"
namespace: "support_tickets"
top_k: 15
```

Find semantically similar support tickets or feedback.

### Research assistance

```
query: "climate change impact on agriculture"
namespace: "research_papers"
top_k: 20
```

Discover relevant research papers and studies.

### Product matching

```
query: "wireless bluetooth headphones with noise cancellation"
namespace: "product_catalog"
top_k: 8
```

Find similar products in your catalog.

### Knowledge base search

```
query: "troubleshooting network connectivity issues"
namespace: "internal_kb"
top_k: 12
```

Search internal knowledge bases for solutions.

## Understanding namespaces

Namespaces in Pinecone help organize your vector data:

* **Separate datasets**: Keep different types of content isolated
* **Access control**: Control which data agents can search
* **Performance**: Search within smaller, focused datasets
* **Organization**: Logical grouping of related documents

Common namespace patterns:

* `documents` - General document storage
* `products` - Product catalogs and descriptions
* `support` - Support tickets and solutions
* `research` - Research papers and studies
* `user_content` - User-generated content

## What you get back

* **Similarity Score**: How closely each result matches your query (0-1 scale)
* **Document Metadata**: Associated information about each document
* **Match Ranking**: Results ordered by relevance/similarity
* **Vector IDs**: Unique identifiers for each matched document

## Best practices

* Use descriptive, natural language queries for better semantic matching
* Choose appropriate namespaces to focus your search
* Adjust `top_k` based on your use case (more results = broader coverage)
* Include relevant context in your queries for better matches
* Monitor similarity scores to understand result quality
* Organize your Pinecone data with meaningful namespaces

## Troubleshooting

**"Namespace not found"**

* Verify the namespace exists in your Pinecone index
* Check the namespace spelling (case-sensitive)
* Ensure the namespace has been populated with data

**"No results found"**

* Try broader or different query terms
* Check if the namespace contains relevant data
* Increase the `top_k` value to get more results

**"Integration not configured"**

* Set up the Pinecone integration first
* Verify your API key and host configuration
* Check that the integration is active and connected

**"Low similarity scores"**

* Your query might not match the indexed content well
* Try rephrasing your query with different terms
* Check if the right namespace is being searched

## Related tools

* [Scrape URL](/tools/scrape_url) - Extract content to add to Pinecone
* [Run Code](/tools/execute_python) - Process and analyze search results
* [Send Email](/tools/send_email) - Share relevant documents found
