Skip to main content

Index a single PDF


Index multiple files


Index a directory


Custom chunking

For long-form content (legal documents, books), larger chunks preserve more context:
For short Q&A content (FAQs, product specs), smaller chunks improve precision:

Using namespaces

Namespaces let a single Pinecone index serve multiple document collections:

Build a knowledge base script

A complete script to build a fresh knowledge base:
Run with:

Watch for changes (polling)

For development, re-index when files change: