Skip to content

DOC: <Issue related to /docs/tutorials/rag/> #9143

@vlahanas

Description

@vlahanas

Problem

In the Typescript version of the documentation, the code sample that describes how to set up a RAG chain is missing a variable declaration, and throws an error. Specifically, the variable vectorStore is not defined.

Fix

What is missing is an import of some vector store and embeddings model, eg. for MemoryVectorStore with OpenAIEmbeddings this would be:

import { OpenAIEmbeddings } from "@langchain/openai";
import { MemoryVectorStore } from "langchain/vectorstores/memory";

and the definition of embeddings and vectorStore as :

const embeddings = new OpenAIEmbeddings({
    model: "text-embedding-3-large"
});

const vectorStore = new MemoryVectorStore(embeddings);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions