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

Implement instructor embedding based retrieval #16

Open
NISH1001 opened this issue Jan 17, 2024 · 0 comments
Open

Implement instructor embedding based retrieval #16

NISH1001 opened this issue Jan 17, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@NISH1001
Copy link
Collaborator

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>")


@NISH1001 NISH1001 self-assigned this Jan 17, 2024
@NISH1001 NISH1001 added the enhancement New feature or request label Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant