Skip to content

Implement instructor embedding based retrieval #16

Description

@NISH1001

What

We currently use OAI Embeddings (ada) to embed vectors into a vector store (say pgvector). It's required that all the metadata are tagged at index time. There's no mechanism to update any chunks with new metadata (not in a straightforward manner). We cannot also use arbitrary objects in the metadata filters.

We propose using instructor-embedding that can embed query along with provided filters to embed query to get relevant chunks. langchain has Instruct Embeddings implementation which we can use to embed anything.

Why

instructor-embedding allows a pair (prompt, text) to embed jointly. This allows to use any custom prompt to embed any text.
For example, if we want to embed a query applying certain filters, we can embed through the pair as:
("Represent the query with filters cateogories=['x', 'y']", "<Some long text>")


Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions