vector-databaseslisted
Install: claude install-skill claude-dev-suite/claude-dev-suite
# Vector Databases
## Pinecone
```typescript
import { Pinecone } from '@pinecone-database/pinecone';
const pc = new Pinecone({ apiKey: process.env.PINECONE_API_KEY! });
const index = pc.index('my-index');
// Upsert
await index.namespace('docs').upsert([
{ id: 'doc-1', values: embedding, metadata: { source: 'manual', topic: 'auth' } },
]);
// Query with metadata filter
const results = await index.namespace('docs').query({
vector: queryEmbedding,
topK: 5,
filter: { topic: { $eq: 'auth' } },
includeMetadata: true,
});
```
## ChromaDB (local/self-hosted)
```python
import chromadb
client = chromadb.PersistentClient(path="./chroma_db")
collection = client.get_or_create_collection(
name="documents",
metadata={"hnsw:space": "cosine"},
)
# Add documents (auto-embeds with default model)
collection.add(
ids=["doc1", "doc2"],
documents=["Auth guide content", "API reference content"],
metadatas=[{"source": "manual"}, {"source": "api"}],
)
# Query
results = collection.query(query_texts=["how does login work?"], n_results=5)
```
## pgvector (PostgreSQL extension)
```sql
CREATE EXTENSION IF NOT EXISTS vector;
CREATE TABLE documents (
id SERIAL PRIMARY KEY,
content TEXT NOT NULL,
embedding vector(1536),
metadata JSONB DEFAULT '{}'
);
CREATE INDEX ON documents USING hnsw (embedding vector_cosine_ops);
-- Similarity search
SELECT id, content, 1 - (embedding <=> $1::vector) AS similarity
FROM documents
WHERE metadata->>'source' = 'manual'
ORDE