You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to figure out this RAG and can't connect a few things together, let me explain
The 3 key things I know of are
embeddings provider, seems you can use embeddinggemma locally
vector database, I think it is LanceDB
LLM, seems like you can pick any from opencode
It seems weird to me that an the 3 can work with embeddinggemma, I was on the impression that if an LLM doesn't have a matching embeddings provider, then it cannot be turned into a RAG, how does this actually work? Or did I misunderstand?
How does the remote LLM actually search the local vector database?
I get why this feels confusing — I had the same “who talks to whom?” moment when I first built a RAG pipeline. The simplest way I think about it: embeddings and the vector DB are the search engine, the LLM is the writer. You create vector representations of your documents (indexing) and store them in a DB like LanceDB. At query time you turn the user question into an embedding, use that to fetch the most relevant passages, then hand those passages (as plain text) to the LLM. The LLM never needs the vectors — it only needs the retrieved text to compose an answer.
That means an LLM doesn’t have to “use the same” embedding provider to be part of RAG. What does matter is that the index and the query use compatible embeddings so the DB returns the right passages. If you index with EmbeddingGemma and also compute query embeddings with EmbeddingGemma (same model, same preprocessing), retrieval quality will be much better. If you mix very different embedding models, nearest‑neighbor search degrades and you’ll get less relevant context to feed the LLM.
Activity
MrDoe commentedon Jun 11, 2026
I get why this feels confusing — I had the same “who talks to whom?” moment when I first built a RAG pipeline. The simplest way I think about it: embeddings and the vector DB are the search engine, the LLM is the writer. You create vector representations of your documents (indexing) and store them in a DB like LanceDB. At query time you turn the user question into an embedding, use that to fetch the most relevant passages, then hand those passages (as plain text) to the LLM. The LLM never needs the vectors — it only needs the retrieved text to compose an answer.
That means an LLM doesn’t have to “use the same” embedding provider to be part of RAG. What does matter is that the index and the query use compatible embeddings so the DB returns the right passages. If you index with EmbeddingGemma and also compute query embeddings with EmbeddingGemma (same model, same preprocessing), retrieval quality will be much better. If you mix very different embedding models, nearest‑neighbor search degrades and you’ll get less relevant context to feed the LLM.
MrDoe commentedon Jun 11, 2026
To answer the second question: This is a typical RAG pipeline:
Prerequisite - Index all files
Semantic Search
-> Embedding vector is generated.
MrDoe commentedon Jun 11, 2026
I've set up "Discussions" for questions in the repo now.
bilogic commentedon Jun 12, 2026
Thanks! Can this issue be converted to a discusssion, I have seen it happen on other repos.
For clarity, I would like to name these:
embeddings provider, seems you can use
embeddinggemmalocallyvector database, I think it is
LanceDBLLM, seems like you can pick any from opencode, let's use
big picklefrom opencodeembedding LLMinPrerequisiteandSemantic Searchembeddinggemmaor one of the LLM in opencode, e.g.big pickle?User promptis sent to opencode in return for an embedding vector?