[GH-ISSUE #436] DOC: Missing Initialization of pineconeIndex in PineconeStore in the URL #15

Closed
opened 2026-02-17 17:18:59 -05:00 by yindo · 5 comments
Owner

Originally created by @codeapexdev on GitHub (Jan 28, 2025).
Original GitHub issue: https://github.com/langchain-ai/docs/issues/436

URL

https://js.langchain.com/docs/tutorials/rag/

Checklist

  • I added a very descriptive title to this issue.
  • I included a link to the documentation page I am referring to (if applicable).

Issue with current documentation:

The provided example code in the LangChain documentation for using PineconeStore is incomplete as it does not initialize or create the pineconeIndex variable.

import { PineconeStore } from "@langchain/pinecone";
import { Pinecone as PineconeClient } from "@pinecone-database/pinecone";

const pinecone = new PineconeClient();
const vectorStore = new PineconeStore(embeddings, {
  pineconeIndex,
  maxConcurrency: 5,
});

The variable pineconeIndex is used without being initialized or created. This will result in an error when running the code.

Image

Idea or request for content:

The code can be fixed by adding the initialization of pineconeIndex using the pinecone.Index()

import { PineconeStore } from "@langchain/pinecone";
import { Pinecone as PineconeClient } from "@pinecone-database/pinecone";

const PINECONE_API_KEY:any = process.env.PINECONE_API_KEY
const pinecone = new PineconeClient({
apiKey: PINECONE_API_KEY
});
const pineconeIndex = pinecone.Index("rag"); // Initialize the Pinecone index
const vectorStore = new PineconeStore(embeddings, {
pineconeIndex,
maxConcurrency: 5,
});

Also added the API key since it was not mentioned in the docs either.

Originally created by @codeapexdev on GitHub (Jan 28, 2025). Original GitHub issue: https://github.com/langchain-ai/docs/issues/436 ### URL https://js.langchain.com/docs/tutorials/rag/ ### Checklist - [x] I added a very descriptive title to this issue. - [x] I included a link to the documentation page I am referring to (if applicable). ### Issue with current documentation: The provided example code in the LangChain documentation for using PineconeStore is incomplete as it does not initialize or create the pineconeIndex variable. ``` import { PineconeStore } from "@langchain/pinecone"; import { Pinecone as PineconeClient } from "@pinecone-database/pinecone"; const pinecone = new PineconeClient(); const vectorStore = new PineconeStore(embeddings, { pineconeIndex, maxConcurrency: 5, }); ``` The variable pineconeIndex is used without being initialized or created. This will result in an error when running the code. ![Image](https://github.com/user-attachments/assets/0880b5c6-03dd-4a73-bc69-c7f0dd5c8755) ### Idea or request for content: The code can be fixed by adding the initialization of pineconeIndex using the pinecone.Index() import { PineconeStore } from "@langchain/pinecone"; import { Pinecone as PineconeClient } from "@pinecone-database/pinecone"; const PINECONE_API_KEY:any = process.env.PINECONE_API_KEY const pinecone = new PineconeClient({ apiKey: PINECONE_API_KEY }); const pineconeIndex = pinecone.Index("rag"); // Initialize the Pinecone index const vectorStore = new PineconeStore(embeddings, { pineconeIndex, maxConcurrency: 5, }); Also added the API key since it was not mentioned in the docs either.
yindo added the langchainjs/ts labels 2026-02-17 17:18:59 -05:00
yindo closed this issue 2026-02-17 17:18:59 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Apr 29, 2025):

Hi, @codeapexdev. I'm Dosu, and I'm helping the LangChain team manage their backlog. I'm marking this issue as stale.

Issue Summary:

  • You reported a documentation issue in the LangChain example code for PineconeStore.
  • The pineconeIndex variable is not initialized in the example.
  • Suggested fix includes initializing pineconeIndex with pinecone.Index() and adding API key setup.
  • No further comments or activity have been made on this issue.

Next Steps:

  • Please confirm if this issue is still relevant to the latest version of the LangChain repository. If so, you can keep the discussion open by commenting here.
  • If there is no response, this issue will be automatically closed in 7 days.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Apr 29, 2025): Hi, @codeapexdev. I'm [Dosu](https://dosu.dev), and I'm helping the LangChain team manage their backlog. I'm marking this issue as stale. **Issue Summary:** - You reported a documentation issue in the LangChain example code for PineconeStore. - The `pineconeIndex` variable is not initialized in the example. - Suggested fix includes initializing `pineconeIndex` with `pinecone.Index()` and adding API key setup. - No further comments or activity have been made on this issue. **Next Steps:** - Please confirm if this issue is still relevant to the latest version of the LangChain repository. If so, you can keep the discussion open by commenting here. - If there is no response, this issue will be automatically closed in 7 days. Thank you for your understanding and contribution!
Author
Owner

@codeapexdev commented on GitHub (May 5, 2025):

The issue is still there and can be confusing for the people who are trying to learn from your documentation

@codeapexdev commented on GitHub (May 5, 2025): The issue is still there and can be confusing for the people who are trying to learn from your documentation
Author
Owner

@dosubot[bot] commented on GitHub (May 5, 2025):

@eyurtsev, the user @codeapexdev has confirmed that the documentation issue regarding the uninitialized pineconeIndex variable is still relevant and can be confusing for learners. Could you please assist them with this issue?

@dosubot[bot] commented on GitHub (May 5, 2025): @eyurtsev, the user @codeapexdev has confirmed that the documentation issue regarding the uninitialized `pineconeIndex` variable is still relevant and can be confusing for learners. Could you please assist them with this issue?
Author
Owner

@eugeneo17 commented on GitHub (Jul 17, 2025):

I'd like to take this issue and submit a fix. Let me know if anyone is already working on it!

@eugeneo17 commented on GitHub (Jul 17, 2025): I'd like to take this issue and submit a fix. Let me know if anyone is already working on it!
Author
Owner

@mdrxy commented on GitHub (Oct 31, 2025):

Fixing

@mdrxy commented on GitHub (Oct 31, 2025): Fixing
yindo changed title from DOC: Missing Initialization of pineconeIndex in PineconeStore in the URL to [GH-ISSUE #436] DOC: Missing Initialization of pineconeIndex in PineconeStore in the URL 2026-06-05 17:24:34 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/docs#15