Pinecone Assistant
PineconeOfficialPublished by Pinecone
- Skill
- Tool integration
- Data and AI
- MIT
- Low risk
- Has scripts
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
Pinecone Assistant is a managed RAG service that enables users to upload documents and perform natural language queries with citations. This skill provides a set of scripts to automate the lifecycle of these assistants, including creation, file management, document synchronization, conversational Q&A, and raw context retrieval. It simplifies the integration by handling the underlying infrastructure, allowing users to focus on querying their data.
What it does
- Create and configure new Pinecone Assistants.
- Upload and index documents for knowledge base population.
- Synchronize local files with the assistant's knowledge base.
- Perform conversational Q&A with cited responses.
- Retrieve raw context snippets for debugging or custom workflows.
- List and manage existing assistants.
When to use it
- When you need to build a RAG-enabled assistant without managing embedding pipelines.
- When you want to query specific documentation or local files using natural language.
- When you need to verify the relevance of indexed content through raw context retrieval.
- When you want to automate the synchronization of local document folders with a cloud assistant.
Advantages
- Fully managed infrastructure eliminates the need for manual embedding pipelines.
- Provides cited answers for improved transparency and verification.
- Supports incremental synchronization to keep knowledge bases up to date.
- Enables both conversational chat and raw data retrieval for flexible use cases.
Usage examples
- “Create an assistant called docs-bot and upload my ./docs folder.”
- The agent initializes a new Pinecone Assistant named docs-bot and indexes all files found in the specified local directory.
- “Ask my assistant about the main features of the project.”
- The agent sends the query to the active assistant and returns a conversational response with relevant citations.
- “Find context about authentication in my assistant.”
- The agent retrieves and displays raw text snippets related to authentication from the assistant's knowledge base.
- “Sync my docs with the assistant.”
- The agent performs an incremental update, ensuring the assistant's knowledge base reflects the current state of the local files.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/pinecone-io/pinecone-assistant/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip pinecone-assistant.zip -d .agents/skills
Documentation by Pinecone
Pinecone Assistant
Pinecone Assistant is a fully managed RAG service. Upload documents, ask questions, get cited answers. No embedding pipelines or infrastructure required.
All scripts are in
scripts/relative to this skill directory. Run with:uv run scripts/script_name.py [arguments]
<<clarify_style>>
Operations
| What to do | Script | Key args |
|---|---|---|
| Create an assistant | scripts/create.py | --name --instructions --region |
| Upload files | scripts/upload.py | --assistant --source --patterns |
| Sync files (incremental) | scripts/sync.py | --assistant --source --delete-missing --dry-run |
| Chat / ask a question | scripts/chat.py | --assistant --message |
| Get context snippets | scripts/context.py | --assistant --query --top-k |
| List assistants | scripts/list.py | --files --json |
For full workflow details on any operation, read the relevant file in references/.
Natural Language Recognition
Proactively handle these patterns without requiring explicit commands:
Create: "create an assistant", "make an assistant called X", "set up an assistant for my docs" → See references/create.md
Upload: "upload my docs", "add files to my assistant", "index my documentation" → See references/upload.md
Sync: "sync my docs", "update my assistant", "keep assistant in sync", "refresh from ./docs" → See references/sync.md
Chat: "ask my assistant about X", "what does my assistant know about X", "chat with X" → See references/chat.md
Context: "search my assistant for X", "find context about X" → See references/context.md
List: "show my assistants", "what assistants do I have"
→ Run uv run scripts/list.py
Conversation Memory
Track the last assistant used within the conversation:
When a user creates or first uses an assistant, remember its name
If user says "my assistant", "it", or "the assistant" → use the last one
Briefly confirm which assistant you're using: "Asking docs-bot..."
If ambiguous and multiple exist → ask the user to clarify
Multi-Step Requests
Handle chained requests naturally. Example:
"Create an assistant called docs-bot, upload my ./docs folder, and ask what the main features are"
uv run scripts/create.py --name docs-botuv run scripts/upload.py --assistant docs-bot --source ./docsuv run scripts/chat.py --assistant docs-bot --message "what are the main features?"
Prerequisites
PINECONE_API_KEYmust be available: <<api_key_setup>>uvmust be installed — install uvGet a free API key at: https://app.pinecone.io/?sessionType=signup
Files
- ATTRIBUTION.mdAdded by AutoGineer865 B
- LICENSELicence file added by AutoGineer1.0 KiB
- SKILL.md3.1 KiB
- references/chat.md1.2 KiB
- references/context.md1.5 KiB
- references/create.md1.5 KiB
- references/list.md713 B
- references/sync.md1.9 KiB
- references/upload.md1.7 KiB
- scripts/chat.pyScript4.9 KiB
- scripts/context.pyScript5.8 KiB
- scripts/create.pyScript3.7 KiB
- scripts/list.pyScript8.3 KiB
- scripts/sync.pyScript13.2 KiB
- scripts/upload.pyScript7.4 KiB
scripts/context.py
#!/usr/bin/env python3
# /// script
# requires-python = ">=3.10"
# dependencies = [
# "pinecone==9.1.0",
# "typer>=0.15.0",
# "rich>=13.0.0",
# ]
# ///
"""
Retrieve context snippets from a Pinecone Assistant's knowledge base.
Usage:
uv run context.py --assistant NAME --query "search text" [--top-k 5] [--json]
Environment Variables:
PINECONE_API_KEY: Required Pinecone API key
Output:
Relevant context snippets with file sources, page numbers, and relevance scores
"""
import os
import json as json_module
import typer
from rich.console import Console
from rich.panel import Panel
from rich.table import Table
from rich.text import Text
from pinecone import Pinecone
from pinecone.models.assistant import TextSnippet
app = typer.Typer()
console = Console()
@app.command()
def main(
assistant: str = typer.Option(..., "--assistant", "-a", help="Name of the assistant"),
query: str = typer.Option(..., "--query", "-q", help="Search query text"),
top_k: int = typer.Option(5, "--top-k", "-k", help="Number of results to return (max 16)"),
snippet_size: int = typer.Option(1024, "--snippet-size", "-s", help="Maximum tokens per snippet"),
json: bool = typer.Option(False, "--json", help="Output in JSON format"),
):
"""Retrieve relevant context snippets from an assistant's knowledge base."""
# Check for API key
api_key = os.environ.get("PINECONE_API_KEY")
if not api_key:
console.print("[red]Error: PINECONE_API_KEY environment variable not set[/red]")
console.print("\nGet your API key from: https://app.pinecone.io/?sessionType=signup")
raise typer.Exit(1)
try:
# Initialize Pinecone client
pc = Pinecone(api_key=api_key, source_tag="pinecone_skills:assistant")
# Display query
if not json:
console.print(Panel(f"[bold cyan]Query:[/bold cyan] {query}", border_style="cyan"))
# Retrieve context
with console.status("[bold blue]Searching knowledge base...[/bold blue]", spinner="dots"):
response = pc.assistants.context(
assistant_name=assistant, query=query, top_k=top_k, snippet_size=snippet_size
)
# Get snippets from response
snippets = response.snippets if hasattr(response, 'snippets') else []
if json:
# JSON output
results = []
for snippet in snippets:
file_name = "Unknown"
pages = []
if hasattr(snippet, 'reference') and snippet.reference:
ref = snippet.reference
if hasattr(ref, 'file') and hasattr(ref.file, 'name'):
file_name = ref.file.name
if hasattr(ref, 'pages') and ref.pages:
pages = ref.pages
results.append({
"file_name": file_name,
"pages": pages,
"content": getattr(snippet, 'content', ''),
"score": getattr(snippet, 'score', 0.0),
# SDK 9 encodes the snippet kind as a msgspec tag, not an
# instance attribute, so getattr(snippet, 'type') silently
# returned the default for every snippet.
"type": "text" if isinstance(snippet, TextSnippet) else "multimodal",
})
print(json_module.dumps({"snippets": results, "count": len(results)}, indent=2))
else:
# Rich formatted output
if not snippets or len(snippets) == 0:
console.print("[yellow]No context found for this query[/yellow]")
return
console.print(f"\n[bold]Found {len(snippets)} relevant snippet(s):[/bold]\n")
for idx, snippet in enumerate(snippets, 1):
# Extract file info from reference
file_name = "Unknown"
pages = []
if hasattr(snippet, 'reference') and snippet.reference:
ref = snippet.reference
if hasattr(ref, 'file') and hasattr(ref.file, 'name'):
file_name = ref.file.name
if hasattr(ref, 'pages') and ref.pages:
pages = ref.pages
score = getattr(snippet, 'score', 0.0)
content = getattr(snippet, 'content', '')
# Create header
header = f"#{idx} - {file_name}"
if pages:
pages_str = ", ".join(str(p) for p in pages)
header += f" (Page {pages_str})"
header += f" - Score: {score:.3f}" if isinstance(score, (int, float)) else f" - Score: {score}"
console.print(Panel(
content,
title=header,
border_style="blue",
subtitle=f"[dim]Relevance: {score:.2%}[/dim]" if isinstance(score, (int, float)) else None
))
console.print()
# Suggest next action
next_action = f"""[bold]Next steps:[/bold]
<<next_after_context>>"""
console.print(Panel(next_action, title="What's Next?", border_style="green"))
except AttributeError as e:
# Handle case where context method doesn't exist or response structure is different
console.print(f"[red]Error: Context retrieval failed[/red]")
console.print(f"[dim]Details: {e}[/dim]")
console.print("\n[yellow]Note:[/yellow] Context API requires SDK version with assistant.context() support")
console.print("\n[yellow]Try using chat instead:[/yellow]")
console.print(f" <<next_chat_fallback>>")
raise typer.Exit(1)
except Exception as e:
console.print(f"[red]Error: {e}[/red]")
raise typer.Exit(1)
if __name__ == "__main__":
app()
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs an API key, Needs Python
Security
What our scanner noticed· Low risk
- Instructions that use the network
- Scripts that your agent may run
This skill includes scripts that your agent may run. Read them before you use it.
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- Pinecone
- Publisher
- Pinecone (Official)
- Source
- pinecone-io/skills · skills/pinecone-assistant · commit 885dc53
- Licence
- MIT License (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Pinecone or Pinecone.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download pinecone-assistant.zip