Allow specifying different fields for similarity search and prompt context #4911
omihirofumi
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Checked
Feature request
Requirement
Currently, LangChain uses the same fields/content for both similarity search (e.g., with VectorStore) and generating the prompt context. However, there are cases where we may want to use different fields for these two operations.
For example, with a CSV dataset having fields like "Title", "Description", "Category", etc., we may want to perform the similarity search only on the "Title" and "Description" fields for better relevance. But when generating the prompt context, we want to include all fields like "Title", "Description", "Category" to provide more comprehensive information.
Motivation
Use Case
I'm working on a question-answering system using LangChain.js with a CSV dataset. The goal is to find the most relevant documents based on the question, but provide additional context from all fields when generating the final prompt for the language model.
Currently, I have to either:
Being able to specify different fields for search and prompt context would allow me to optimize both relevance and information coverage.
Proposal (If applicable)
Potential Solution
One potential solution could be to provide additional options when creating the VectorStore, something like:
Beta Was this translation helpful? Give feedback.
All reactions