Skip to content

Commit 1bc19cb

Browse files
authored
Merge pull request #2 from pinecone-io/sync/skills-23154564948
Finalized plugin with validation.
2 parents af5d985 + c800f1c commit 1bc19cb

30 files changed

Lines changed: 2898 additions & 37 deletions

File tree

.cursor-plugin/plugin.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{
22
"name": "pinecone",
3-
"description": "Pinecone vector database integration. Streamline your Pinecone development with powerful tools for managing vector indexes, querying data, and rapid prototyping. Use slash commands like /quickstart to generate AGENTS.md files and initialize Python projects and /query to quickly explore indexes. Access the Pinecone MCP server for creating, describing, upserting and querying indexes with Cursor. Perfect for developers building semantic search, RAG applications, recommendation systems, and other vector-based applications with Pinecone.",
3+
"description": "Pinecone vector database integration. Streamline your Pinecone development with powerful tools for managing vector indexes, querying data, and rapid prototyping. Use slash commands like /quickstart to learn how to build with Pinecone and /query to quickly explore indexes. Access the Pinecone MCP server for creating, describing, upserting and querying indexes with Cursor. Perfect for developers building semantic search, RAG applications, recommendation systems, and other vector-based applications with Pinecone.",
44
"version": "1.0.0",
55
"author": {
66
"name": "Pinecone"
77
},
8+
"logo": "assets/logo.svg",
89
"keywords": [
910
"pinecone",
1011
"semantic search",

.github/workflows/contextualize-skills.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Contextualize Incoming Skills
22

33
on:
44
pull_request:
5-
types: [opened, synchronize]
5+
types: [opened]
66

77
jobs:
88
contextualize:

.mcp.json

Lines changed: 0 additions & 14 deletions
This file was deleted.

README.md

Lines changed: 74 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,84 @@
11
# Pinecone Cursor Plugin
22

3-
Official Pinecone plugin for Cursor. Provides skills, rules, and a Pinecone MCP server integration for building with Pinecone.
3+
Official [Pinecone](https://www.pinecone.io) plugin for [Cursor](https://cursor.com). Build semantic search, RAG, recommendation systems, and other vector-based applications with Pinecone — directly from your editor.
44

5-
## Skills
5+
## What's included
66

7-
| Skill | Description |
7+
### Skills
8+
9+
Skills are specialized agent capabilities invoked automatically by Cursor Agent or manually via `/skill-name` in chat.
10+
11+
| Skill | What it does |
812
|-------|-------------|
9-
| `quickstart` | Onboarding — create an index, upload data, run your first search |
10-
| `query` | Natural language search across Pinecone indexes via MCP |
11-
| `cli` | Pinecone CLI (`pc`) for index and vector management |
12-
| `assistant` | Pinecone Assistants for document Q&A with citations |
13-
| `mcp` | Reference docs for all MCP server tools and parameters |
14-
| `docs` | Organized links to official Pinecone documentation |
15-
| `help` | Overview of all skills and getting-started guidance |
13+
| `/quickstart` | Step-by-step onboarding — create an index, upload data, and run your first search. Choose between a **Database** path (vector search) or **Assistant** path (document Q&A). |
14+
| `/query` | Search integrated indexes using natural language text via the Pinecone MCP server. |
15+
| `/cli` | Use the Pinecone CLI (`pc`) for terminal-based index and vector management. |
16+
| `/assistant` | Create, manage, and chat with Pinecone Assistants for document Q&A with citations. Includes scripts for uploading files, syncing changes, and retrieving context. |
17+
| `/mcp` | Reference documentation for all Pinecone MCP server tools and their parameters. |
18+
| `/docs` | Curated links to official Pinecone documentation, organized by topic. |
19+
| `/help` | Overview of all available skills and what you need to get started. |
20+
21+
### MCP Server
22+
23+
The plugin bundles the [Pinecone MCP server](https://github.com/pinecone-io/pinecone-mcp) (`@pinecone-database/mcp`), giving Cursor Agent direct access to your Pinecone resources:
1624

17-
## MCP Server
25+
- Create, describe, and delete indexes
26+
- Upsert and query vectors
27+
- Search Pinecone documentation
28+
- Manage index configurations
1829

19-
The plugin bundles the [Pinecone MCP server](https://github.com/pinecone-io/pinecone-mcp) (`@pinecone-database/mcp`). Requires a `PINECONE_API_KEY` environment variable.
30+
### Bundled Scripts
31+
32+
Several skills include Python scripts (run via [`uv`](https://docs.astral.sh/uv/)) for operations beyond what MCP provides:
33+
34+
| Script | Skill | Purpose |
35+
|--------|-------|---------|
36+
| `upsert.py` | quickstart | Seed an index with sample data |
37+
| `quickstart_complete.py` | quickstart | Standalone end-to-end quickstart |
38+
| `create.py` | assistant | Create a new Pinecone Assistant |
39+
| `upload.py` | assistant | Upload files to an assistant |
40+
| `chat.py` | assistant | Chat with an assistant |
41+
| `context.py` | assistant | Retrieve context snippets from an assistant |
42+
| `list.py` | assistant | List all assistants in your account |
43+
| `sync.py` | assistant | Sync local files to an assistant |
2044

2145
## Prerequisites
2246

23-
- [Pinecone account](https://app.pinecone.io) (free)
24-
- Pinecone API key
25-
- Node.js v18+ (for the MCP server)
47+
- **Pinecone account** — free at [app.pinecone.io](https://app.pinecone.io/?sessionType=signup)
48+
- **API key** — create one in the Pinecone console, then set it:
49+
```bash
50+
export PINECONE_API_KEY="your-key"
51+
```
52+
- **Node.js v18+** — required for the MCP server (`npx`)
53+
54+
### Optional
55+
56+
| Tool | What it enables | Install |
57+
|------|----------------|---------|
58+
| [Pinecone CLI](https://docs.pinecone.io/guides/operations/pinecone-cli) (`pc`) | Terminal-based index management, batch operations | `brew tap pinecone-io/tap && brew install pinecone-io/tap/pinecone` |
59+
| [uv](https://docs.astral.sh/uv/) | Run the bundled Python scripts | [Install guide](https://docs.astral.sh/uv/getting-started/installation/) |
60+
61+
## Getting started
62+
63+
1. Install the plugin from the [Cursor Marketplace](https://cursor.com/marketplace)
64+
2. Set your `PINECONE_API_KEY` environment variable
65+
3. Open Cursor Agent chat and type `/quickstart` to get started
66+
4. Verify the MCP server is connected: Cursor Settings > Features > Model Context Protocol
67+
68+
## Verifying the installation
69+
70+
| Component | Where to check |
71+
|-----------|---------------|
72+
| Skills | Cursor Settings > Rules — listed under "Agent Decides" |
73+
| MCP Server | Cursor Settings > Features > Model Context Protocol |
74+
| Commands | Type `/` in Agent chat and search |
75+
76+
## Links
77+
78+
- [Pinecone Documentation](https://docs.pinecone.io)
79+
- [Pinecone MCP Server](https://github.com/pinecone-io/pinecone-mcp)
80+
- [Pinecone Discord](https://discord.gg/pinecone)
81+
82+
## License
83+
84+
[Apache-2.0](LICENSE)

assets/logo.svg

Lines changed: 3 additions & 0 deletions
Loading

scripts/validate-plugin.mjs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -185,15 +185,17 @@ async function main() {
185185
}
186186
}
187187

188-
// 7. Check MCP config
189-
const mcpPath = path.join(repoRoot, ".mcp.json");
190-
if (await pathExists(mcpPath)) {
191-
const mcp = await readJsonFile(mcpPath, "MCP config");
188+
// 7. Check MCP config (mcp.json or .mcp.json)
189+
const mcpPath = path.join(repoRoot, "mcp.json");
190+
const mcpPathDot = path.join(repoRoot, ".mcp.json");
191+
const mcpFile = (await pathExists(mcpPath)) ? mcpPath : (await pathExists(mcpPathDot)) ? mcpPathDot : null;
192+
if (mcpFile) {
193+
const mcp = await readJsonFile(mcpFile, "MCP config");
192194
if (mcp && !mcp.mcpServers) {
193-
addError('.mcp.json missing "mcpServers" key');
195+
addError(`${path.basename(mcpFile)} missing "mcpServers" key`);
194196
}
195197
} else {
196-
addWarning("No .mcp.json found");
198+
addWarning("No mcp.json found");
197199
}
198200

199201
// 8. Check hooks

skills/assistant/SKILL.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
---
2+
name: assistant
3+
description: Create, manage, and chat with Pinecone Assistants for document Q&A with citations. Handles all assistant operations - create, upload, sync, chat, context retrieval, and list. Recognizes natural language like "create an assistant from my docs", "ask my assistant about X", or "upload my docs to Pinecone".
4+
---
5+
6+
# Pinecone Assistant
7+
8+
Pinecone Assistant is a fully managed RAG service. Upload documents, ask questions, get cited answers. No embedding pipelines or infrastructure required.
9+
10+
> All scripts are in `scripts/` relative to this skill directory.
11+
> Run with: `uv run scripts/script_name.py [arguments]`
12+
13+
## Operations
14+
15+
| What to do | Script | Key args |
16+
|---|---|---|
17+
| Create an assistant | `scripts/create.py` | `--name` `--instructions` `--region` |
18+
| Upload files | `scripts/upload.py` | `--assistant` `--source` `--patterns` |
19+
| Sync files (incremental) | `scripts/sync.py` | `--assistant` `--source` `--delete-missing` `--dry-run` |
20+
| Chat / ask a question | `scripts/chat.py` | `--assistant` `--message` |
21+
| Get context snippets | `scripts/context.py` | `--assistant` `--query` `--top-k` |
22+
| List assistants | `scripts/list.py` | `--files` `--json` |
23+
24+
For full workflow details on any operation, read the relevant file in `references/`.
25+
26+
---
27+
28+
## Natural Language Recognition
29+
30+
Proactively handle these patterns without requiring explicit commands:
31+
32+
**Create:** "create an assistant", "make an assistant called X", "set up an assistant for my docs"
33+
→ See [references/create.md](references/create.md)
34+
35+
**Upload:** "upload my docs", "add files to my assistant", "index my documentation"
36+
→ See [references/upload.md](references/upload.md)
37+
38+
**Sync:** "sync my docs", "update my assistant", "keep assistant in sync", "refresh from ./docs"
39+
→ See [references/sync.md](references/sync.md)
40+
41+
**Chat:** "ask my assistant about X", "what does my assistant know about X", "chat with X"
42+
→ See [references/chat.md](references/chat.md)
43+
44+
**Context:** "search my assistant for X", "find context about X"
45+
→ See [references/context.md](references/context.md)
46+
47+
**List:** "show my assistants", "what assistants do I have"
48+
→ Run `uv run scripts/list.py`
49+
50+
---
51+
52+
## Conversation Memory
53+
54+
Track the last assistant used within the conversation:
55+
- When a user creates or first uses an assistant, remember its name
56+
- If user says "my assistant", "it", or "the assistant" → use the last one
57+
- Briefly confirm which assistant you're using: "Asking docs-bot..."
58+
- If ambiguous and multiple exist → ask the user to clarify
59+
60+
---
61+
62+
## Multi-Step Requests
63+
64+
Handle chained requests naturally. Example:
65+
66+
> "Create an assistant called docs-bot, upload my ./docs folder, and ask what the main features are"
67+
68+
1. `uv run scripts/create.py --name docs-bot`
69+
2. `uv run scripts/upload.py --assistant docs-bot --source ./docs`
70+
3. `uv run scripts/chat.py --assistant docs-bot --message "what are the main features?"`
71+
72+
---
73+
74+
## Prerequisites
75+
76+
- `PINECONE_API_KEY` must be available — terminal: `export PINECONE_API_KEY="your-key"`, or add to a `.env` file and run scripts with `uv run --env-file .env scripts/...`
77+
- `uv` must be installed — [install uv](https://docs.astral.sh/uv/getting-started/installation/)
78+
- Get a free API key at: https://app.pinecone.io/?sessionType=signup
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Chat with Assistant
2+
3+
Send a message to an assistant and receive a cited response.
4+
5+
## Arguments
6+
7+
- `--assistant` (required): Assistant name
8+
- `--message` (required): The question or message
9+
- `--stream` (optional flag): Enable streaming for faster perceived response
10+
11+
## Workflow
12+
13+
1. Parse arguments. If assistant missing, run `uv run scripts/list.py --json` and ask the user to select.
14+
2. If message missing, prompt user for their question.
15+
3. Execute:
16+
```bash
17+
uv run scripts/chat.py \
18+
--assistant "assistant-name" \
19+
--message "user's question"
20+
```
21+
4. Display:
22+
- Assistant's response
23+
- Citations table: citation number, source file, page numbers, position
24+
- Token usage statistics
25+
26+
**Note:** File URLs in citations are temporary signed links (~1 hour). They are not displayed in output.
27+
28+
## Troubleshooting
29+
30+
**Assistant not found** — run list command, check for typos.
31+
**No response or timeout** — verify assistant has files uploaded and status is "ready" (not "indexing").
32+
**Empty or poor responses** — assistant may lack relevant documents; suggest upload.
33+
**PINECONE_API_KEY not set** — export the variable or add to a `.env` file, then restart your IDE/agent session.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Retrieve Context Snippets
2+
3+
Get raw context snippets from an assistant's knowledge base without generating a full chat response. Useful for debugging, custom RAG workflows, or quick lookups.
4+
5+
## Arguments
6+
7+
- `--assistant` (required): Assistant name
8+
- `--query` (required): Search query text
9+
- `--top-k` (optional): Number of snippets — default `5`, max `16`
10+
- `--snippet-size` (optional): Max tokens per snippet — default `2048`
11+
- `--json` (optional flag): JSON output
12+
13+
## Workflow
14+
15+
1. Parse arguments. If missing, list assistants and prompt for selection.
16+
2. Execute:
17+
```bash
18+
uv run scripts/context.py \
19+
--assistant "assistant-name" \
20+
--query "search text" \
21+
--top-k 5
22+
```
23+
3. Display snippets: file name, page numbers, relevance score, content.
24+
25+
## Context vs Chat
26+
27+
**Use context when:** you want raw snippets, are debugging knowledge, need source material, or are building custom workflows.
28+
**Use chat when:** you want synthesized answers, citations in a conversational response, or multi-turn Q&A.
29+
30+
## Interpreting Results
31+
32+
- **Score:** Higher (closer to 1.0) = more relevant
33+
- **Low scores (<0.5):** Weak match, assistant may need more relevant documents, or query is too broad/specific
34+
35+
## Troubleshooting
36+
37+
**No results** — try broader search terms; suggest uploading more documents.
38+
**context method not available** — update SDK: `pip install --upgrade pinecone` (requires v8.0.0+).
39+
**Assistant not found** — check name for typos, run list command.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Create Assistant
2+
3+
Create a new Pinecone Assistant with custom configuration.
4+
5+
## Arguments
6+
7+
- `--name` (required): Unique name for the assistant
8+
- `--instructions` (optional): Behavior directive (tone, format, language)
9+
- `--region` (optional): `us` or `eu` — default `us`
10+
- `--timeout` (optional): Seconds to wait for ready status — default `30`
11+
12+
## Workflow
13+
14+
1. Parse arguments. If name is missing, prompt the user.
15+
2. Ask the user about region preference — US or EU.
16+
3. Ask if user wants custom instructions. Offer examples:
17+
- "Use professional technical tone and cite sources"
18+
- "Respond in Spanish with formal language"
19+
4. Execute:
20+
```bash
21+
uv run scripts/create.py \
22+
--name "assistant-name" \
23+
--instructions "instructions" \
24+
--region "us"
25+
```
26+
5. Show assistant name, status, and host URL.
27+
6. Offer to run upload next.
28+
29+
## Naming Conventions
30+
31+
Suggest: `{purpose}-{type}` — e.g. `docs-qa`, `support-bot`, `api-helper`
32+
Avoid: `test`, `assistant1`, `my-assistant`
33+
34+
## Post-Creation
35+
36+
- Save the assistant host URL shown in output (needed for MCP config)
37+
- View and manage at: https://app.pinecone.io/organizations/-/projects/-/assistant/
38+
39+
## Troubleshooting
40+
41+
**Assistant name already exists** — list assistants and suggest a different name or delete the existing one.
42+
**Timeout** — increase `--timeout 60`, check network connectivity.
43+
**PINECONE_API_KEY not set** — export the variable or add to a `.env` file, then restart your IDE/agent session.

0 commit comments

Comments
 (0)