Home › RAG & vector databases › Pinecone vector database AGENTS.md

Pinecone vector database AGENTS.md

AGENTS.md for apps using Pinecone serverless indexes: namespaces, metadata filters, upserts, and integrated embedding.

AGENTS.mdRAG & vector databases

How to use

Save this as AGENTS.md in your repository root, commit it, and your agent will pick it up automatically. Edit the commands to match your project.

AGENTS.mdDownload  
# AGENTS.md: Pinecone

## Setup
- Client created once with `PINECONE_API_KEY` from env. Index names and hosts come from config; target an index by host (`pc.Index(host=...)`) in production.
- Index dimension and metric must match the embedding model. If the index uses integrated embedding/inference, send text records and let Pinecone embed; don't mix in client-side vectors from another model.

## Data model
- Use namespaces for multitenancy (one per tenant or workspace). Every query sets the namespace; never query across tenants.
- Record ids are deterministic (`<docId>#<chunkNo>`), so re-ingestion overwrites instead of duplicating.
- Metadata: small, flat, filterable fields (`source`, `doc_id`, `updated_at`, `lang`). Keep chunk text in metadata only if size limits allow; otherwise store it in your DB keyed by id.

## Operations
- Upsert in batches (around 100-1000 records or per the SDK's limits), with retries on 429/5xx.
- Delete by id prefix or metadata filter when a document is removed; ingestion must be idempotent.
- Query: `top_k` small (5-50), `include_metadata=True`, metadata `filter` for permissions and freshness. Rerank (Pinecone rerank or your own) before sending to an LLM.
- Writes are eventually consistent; don't assume a just-upserted record is instantly queryable in tests.

## Don't
- Don't delete or recreate indexes, or delete whole namespaces, without approval.
- Don't run tests against the production index; use a dedicated test index or mock the client.

## Done
Unit tests mock the client; an optional integration test runs against a test index when `PINECONE_TEST_INDEX` is set.

More: all RAG & vector databases rules · all AGENTS.md rules

Related rules

pgvector rules

Cursor rules for vector search in PostgreSQL with pgvector: column types, HNSW indexes, filtering, and hybrid queries.

CursorRAG & vector databases

Qdrant vector search rules

Cursor rules for Qdrant collections: vector config, payload indexes, filtered search, hybrid vectors, and snapshots.

CursorRAG & vector databases

RAG pipeline CLAUDE.md

CLAUDE.md for retrieval-augmented generation apps: chunking, embeddings, hybrid search, citations, and RAG evals.

Claude Code (CLAUDE.md)RAG & vector databases

CrewAI multi-agent AGENTS.md

AGENTS.md for CrewAI 1.x projects: YAML agents and tasks, crews and flows, tools, and cost-aware runs.

AGENTS.mdLLM apps & agents

dbt analytics engineering AGENTS.md

AGENTS.md for dbt projects (dbt Core / Fusion 1.9+): staging/marts layering, tests, docs, and selective runs.

AGENTS.mddbt

LLM app (Python) AGENTS.md

AGENTS.md for Python apps that call LLM APIs (OpenAI, Anthropic, Gemini): prompts, structured output, evals, and cost.

AGENTS.mdLLM apps & agents

Get new rules weekly

One email a week: fresh rule files, agent tips, and what's changing in Cursor, Claude Code and Copilot. Free, unsubscribe anytime.

Opens the Rulestack Newsletter on beehiiv in a new tab. Or subscribe directly on beehiiv.