Skip to content

Bring your own embeddings with InMemoryDocumentStore() #4663

Discussion options

You must be logged in to vote

Thanks for the response! This does work, but as a clarification, I already computed the embeddings elsewhere and they are stored in a table. I do not want to compute the embeddings using the Haystack retriever. Just select the content and embedding and add them to the InMemoryDocumentStore.

But your example did get me on the right path! Does this design pattern make sense?

import pandas as pd
from haystack import Document
from haystack.document_stores import InMemoryDocumentStore
from haystack.nodes import EmbeddingRetriever
from haystack.pipelines import DocumentSearchPipeline
from sentence_transformers import SentenceTransformer

# separate process to create table with embeddings
model = 

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
3 replies
@davidgibsonp
Comment options

Answer selected by davidgibsonp
@anakin87
Comment options

@davidgibsonp
Comment options

Comment options

You must be logged in to vote
2 replies
@anakin87
Comment options

@davidgibsonp
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants