Skip to content

Migrate vector database from Pinecone to Qdrant#27

Open
hunterbryant wants to merge 8 commits intomainfrom
claude/replace-pinecone-hosting-j0W3V
Open

Migrate vector database from Pinecone to Qdrant#27
hunterbryant wants to merge 8 commits intomainfrom
claude/replace-pinecone-hosting-j0W3V

Conversation

@hunterbryant
Copy link
Owner

@hunterbryant hunterbryant commented Mar 9, 2026

Summary

This PR migrates the vector database backend from Pinecone to Qdrant Cloud for the RAG pipeline. All embedding operations and vector retrieval have been updated to use Qdrant's API instead of Pinecone's.

Key Changes

  • Removed Pinecone integration: Deleted src/lib/utilities/pinecone.ts utility file and removed all Pinecone client initialization code
  • Updated vector store operations: Replaced PineconeStore with QdrantVectorStore across all embedding endpoints:
    • src/routes/api/embed/texts/+server.ts
    • src/routes/api/embed/notion-file/+server.ts
    • src/routes/api/embed/notion-url/+server.ts
    • src/routes/api/embed/urls/+server.ts
  • Updated RAG retrieval: Modified src/lib/utilities/context.ts to use QdrantVectorStore.fromExistingCollection() instead of PineconeStore.fromExistingIndex()
  • Updated environment variables: Replaced PINECONE_API_KEY and PINECONE_INDEX with QDRANT_URL, QDRANT_API_KEY, and QDRANT_COLLECTION
  • Updated documentation: Modified CLAUDE.md to reflect Qdrant as the vector database and updated architecture diagrams and setup instructions
  • Updated dependencies: Replaced @langchain/pinecone and @pinecone-database/pinecone with @langchain/qdrant and @qdrant/js-client-rest
  • Relaxed Node version constraint: Updated package.json to allow Node >= 20.0.0 (removed upper bound)

Implementation Details

  • All embedding operations now use Qdrant's configuration format: url, apiKey, and collectionName
  • Removed maxConcurrency parameter from embedding operations (Qdrant handles concurrency differently)
  • Return type of getContext() simplified from Promise<string | ScoredVector[]> to Promise<string>
  • All four embedding endpoints (URLs, Notion API, Notion files, text files) now consistently use the same Qdrant configuration pattern

https://claude.ai/code/session_01M6Bh7NH98wXMiEeAKJMEAu


Note

Medium Risk
Switches the RAG/embedding backend to Qdrant and updates required environment variables/dependencies, which can break retrieval or embedding jobs if configuration or collection semantics differ. Node engine constraint loosening may also allow untested Node 21+ runtimes in some environments.

Overview
Migrates the vector DB integration from Pinecone to Qdrant Cloud for RAG retrieval and embedding workflows, including updating the documented pipeline/embedding guidance and required env vars to QDRANT_URL/QDRANT_API_KEY/QDRANT_COLLECTION.

Updates package.json to drop Pinecone-related packages in favor of @langchain/qdrant + @qdrant/js-client-rest, and relaxes the Node engines constraint to >= 20.0.0 (removing the previous <21 upper bound).

Written by Cursor Bugbot for commit 3c84d7b. This will update automatically on new commits. Configure here.

Pinecone's free tier was discontinued. Migrated to Qdrant Cloud (1GB free
tier) which uses the same LangChain vector store interface pattern.

- Swap @langchain/pinecone + @pinecone-database/pinecone for @langchain/qdrant + @qdrant/js-client-rest
- Rewrite context.ts to use QdrantVectorStore.fromExistingCollection()
- Update all 4 embed endpoints to use QdrantVectorStore.fromDocuments()
- Delete unused pinecone.ts utility (was dead code)
- Update CLAUDE.md to reflect new stack and env vars (QDRANT_URL, QDRANT_API_KEY, QDRANT_COLLECTION)

https://claude.ai/code/session_01M6Bh7NH98wXMiEeAKJMEAu
@vercel
Copy link

vercel bot commented Mar 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
huntbot Ready Ready Preview, Comment Mar 9, 2026 6:40am

The LangChain NotionAPILoader was throwing AggregateErrors when pages
were moved or had access issues. This rewrites the endpoint to use
@notionhq/client directly, giving better error handling (skips
individual pages that fail instead of crashing) and clearer logging.

https://claude.ai/code/session_01M6Bh7NH98wXMiEeAKJMEAu
The endpoint now streams progress via SSE instead of returning a single
JSON response. The admin page shows a live progress bar with page names,
count, and status (loading/embedding/done/error). The Index button is
disabled while running.

https://claude.ai/code/session_01M6Bh7NH98wXMiEeAKJMEAu
Previously all 2000+ pages were loaded into memory then uploaded in one
batch at the end. Now each page is fetched, chunked, and uploaded to
Qdrant immediately so progress is saved incrementally. The admin UI also
shows a running chunk count alongside the page progress.
@hunterbryant hunterbryant marked this pull request as ready for review March 9, 2026 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants