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://mp-staging.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/upload.py
#!/usr/bin/env python3
# /// script
# requires-python = ">=3.10"
# dependencies = [
# "pinecone==9.1.0",
# "typer>=0.15.0",
# "rich>=13.0.0",
# ]
# ///
"""
Upload files or repository contents to a Pinecone Assistant.
IMPORTANT: Only uploads DOCUMENTATION and DATA files.
Supported: DOCX (.docx), JSON (.json), Markdown (.md), PDF (.pdf), Text (.txt)
Code files are NOT supported by Pinecone Assistant.
Usage:
uv run upload.py --assistant NAME --source PATH [--patterns "*.md,*.pdf,*.docx"]
Environment Variables:
PINECONE_API_KEY: Required Pinecone API key
Output:
Progress updates and summary of uploaded files
"""
import os
import glob
from pathlib import Path
from typing import List
from datetime import datetime, timezone
import typer
from rich.console import Console
from rich.progress import Progress, SpinnerColumn, TextColumn, BarColumn, TaskProgressColumn
from rich.table import Table
from rich.panel import Panel
from pinecone import Pinecone
app = typer.Typer()
console = Console()
# Default file patterns - DOCUMENTATION ONLY
# Assistant supports: DOCX, JSON, Markdown, PDF, Text
DEFAULT_PATTERNS = ["**/*.md", "**/*.txt", "**/*.pdf", "**/*.docx", "**/*.json"]
# Default directories to exclude
DEFAULT_EXCLUDES = ["node_modules", ".venv", "venv", ".git", "build", "dist", "__pycache__", ".next", ".cache"]
def find_files(source_path: str, patterns: List[str], excludes: List[str]) -> List[Path]:
"""Find files matching patterns, excluding certain directories."""
source = Path(source_path)
if not source.exists():
console.print(f"[red]Error: Path '{source_path}' does not exist[/red]")
raise typer.Exit(1)
# If it's a single file, return it
if source.is_file():
return [source]
# Otherwise, scan directory
files = []
for pattern in patterns:
matched = glob.glob(str(source / pattern), recursive=True)
files.extend([Path(f) for f in matched])
# Filter out excluded directories
filtered_files = []
for file_path in files:
# Check if any exclude pattern is in the path
if not any(excl in str(file_path) for excl in excludes):
filtered_files.append(file_path)
return sorted(set(filtered_files))
@app.command()
def main(
assistant: str = typer.Option(..., "--assistant", "-a", help="Name of the assistant to upload to"),
source: str = typer.Option(..., "--source", "-s", help="File or directory path to upload"),
patterns: str = typer.Option(
",".join(DEFAULT_PATTERNS),
"--patterns",
"-p",
help="Comma-separated glob patterns for documentation files (e.g., '*.md,*.pdf')",
),
exclude: str = typer.Option(
",".join(DEFAULT_EXCLUDES),
"--exclude",
"-e",
help="Comma-separated directories to exclude",
),
metadata_json: str = typer.Option(
"",
"--metadata",
"-m",
help="Additional metadata as JSON string",
),
):
"""Upload documentation files to a Pinecone Assistant.
NOTE: Only documentation files (markdown, text, PDF) are supported.
Code files are not recommended for Pinecone Assistant.
"""
# 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)
# Parse patterns and excludes
pattern_list = [p.strip() for p in patterns.split(",")]
exclude_list = [e.strip() for e in exclude.split(",")]
# Parse additional metadata if provided
extra_metadata = {}
if metadata_json:
import json
try:
extra_metadata = json.loads(metadata_json)
except json.JSONDecodeError:
console.print("[red]Error: Invalid JSON in --metadata parameter[/red]")
raise typer.Exit(1)
try:
# Initialize Pinecone client
pc = Pinecone(api_key=api_key, source_tag="pinecone_skills:assistant")
# Find files to upload
console.print(f"\n[bold]Scanning for documentation files in:[/bold] {source}")
console.print(f"[dim]Patterns: {', '.join(pattern_list)}[/dim]\n")
files = find_files(source, pattern_list, exclude_list)
if not files:
console.print("[yellow]No documentation files found matching the specified patterns[/yellow]")
console.print("\n[dim]Tip: Pinecone Assistant works with .md, .txt, and .pdf files[/dim]")
return
console.print(f"[green]Found {len(files)} documentation file(s) to upload[/green]\n")
# Upload files with progress bar
uploaded = 0
failed = 0
failed_files = []
with Progress(
SpinnerColumn(),
TextColumn("[progress.description]{task.description}"),
BarColumn(),
TaskProgressColumn(),
console=console,
) as progress:
task = progress.add_task("[cyan]Uploading files...", total=len(files))
for file_path in files:
try:
# Build metadata
rel_path = os.path.relpath(str(file_path), source)
stat = file_path.stat()
metadata = {
"source": "upload_script",
"file_path": rel_path,
"file_type": file_path.suffix,
"content_type": "documentation",
"mtime": stat.st_mtime,
"size": stat.st_size,
"uploaded_at": datetime.now(timezone.utc).isoformat(),
**extra_metadata,
}
# Upload file
pc.assistants.upload_file(
assistant_name=assistant,
file_path=str(file_path),
metadata=metadata,
timeout=None,
)
uploaded += 1
progress.update(task, advance=1, description=f"[cyan]Uploaded: {rel_path}")
except Exception as e:
failed += 1
failed_files.append((str(file_path), str(e)))
progress.update(task, advance=1)
# Summary table
console.print()
summary = Table(show_header=False, box=None)
summary.add_column("Status", style="bold")
summary.add_column("Count")
summary.add_row("[green]✓ Uploaded[/green]", str(uploaded))
if failed > 0:
summary.add_row("[red]✗ Failed[/red]", str(failed))
console.print(Panel(summary, title="Upload Summary", border_style="blue"))
# Show failed files if any
if failed_files:
console.print("\n[bold red]Failed uploads:[/bold red]")
for file_path, error in failed_files:
console.print(f" • {file_path}: [red]{error}[/red]")
# Next steps
if uploaded > 0:
next_steps = f"""[bold]Next steps:[/bold]
<<next_after_upload>>
[dim]Note: Files are being processed and will be available shortly[/dim]"""
console.print(Panel(next_steps, title="What's Next?", border_style="green"))
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.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download pinecone-assistant.zip