Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This is a question not an issue. #1

Open
playground opened this issue Mar 19, 2024 · 2 comments
Open

This is a question not an issue. #1

playground opened this issue Mar 19, 2024 · 2 comments

Comments

@playground
Copy link

Hi @gregnr! First of all, thanks for sharing and step by step video. It's very helpful. Do you have a video on RAG and storing embeddings in vector db, preferably with Chromadb?

@gregnr
Copy link
Member

gregnr commented Mar 19, 2024

Hey! Here is a video I made on RAG using similar open embedding models:

https://youtu.be/ibzlEQmgPPY

It uses Postgres + pgvector as the vector store, but it shouldn't be too hard to swap out pgvector for ChromaDB if you want. The advantage of pgvector IMO is that all your data (app and embeddings) live in the same place vs. jumping between multiple DBs.

Let me know if this helps 😃

@playground
Copy link
Author

playground commented Mar 20, 2024

Hi @gregnr I have yet another question :-), I'm still trying to digest the info from open-source-embeddings as you demonstrated.

Currently, I'm using OpenAIEmbeddings for my documents and storing them in Chromadb. I would like to switch over to use open-source model instead of using OpenAI as you described but I'm a bit hung up on how to go about doing this. Please advise. Also, what is your opinion on using Neo4j KG with RAG?

const embeddings = new OpenAIEmbeddings({
    openAIApiKey: process.env.OPENAI_KEY,
  });

  const vectorStore = await Chroma.fromDocuments(
    chunks,
    new OpenAIEmbeddings({
      openAIApiKey: process.env.OPENAI_KEY,
    }),
    {
      collectionName: "test-data",
      url: "http://localhost:8000,
      collectionMetadata: {
        "hnsw:space": "cosine"
      }
    }
  );

and query against this dataset with questions.

        const embeddings = new OpenAIEmbeddings({openAIApiKey: process.env.OPENAI_API_KEY}); 
        const model = new OpenAI({ openAIApiKey: process.env.OPENAI_API_KEY });
        const data = await chromaDB.retrieveQAChain(collection, query, embeddings, model);

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

No branches or pull requests

2 participants