[GH-ISSUE #1661] [FEAT]: Pre-Processing User Queries with LLM for Improved Similarity Search #1081

Closed
opened 2026-02-22 18:23:02 -05:00 by yindo · 3 comments
Owner

Originally created by @khalilxg on GitHub (Jun 12, 2024).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/1661

What would you like to see?

Add a feature where user queries are first processed by an LLM to better match the indexed data. This processed query is then sent to the vector database for improved search results.

Workflow:

User submits a query.
Query is processed by an LLM to align with indexed data.
Processed query is sent to the vector database.
Search results are returned to the user.
Benefits:

Enhanced search accuracy.
More relevant results.
Improved user experience.
Example:

Original Query: "How to fix login issues?"
LLM Processed Query: "Resolving authentication errors in user access"
Thank you for considering this request.

Other benefits: extract matadata from query that suits db || translate user query into general language of embeded-models exemple: translate chinese query to be translated by LLM into english to match db data that is in english

Originally created by @khalilxg on GitHub (Jun 12, 2024). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/1661 ### What would you like to see? Add a feature where user queries are first processed by an LLM to better match the indexed data. This processed query is then sent to the vector database for improved search results. Workflow: User submits a query. Query is processed by an LLM to align with indexed data. Processed query is sent to the vector database. Search results are returned to the user. Benefits: Enhanced search accuracy. More relevant results. Improved user experience. Example: Original Query: "How to fix login issues?" LLM Processed Query: "Resolving authentication errors in user access" Thank you for considering this request. Other benefits: extract matadata from query that suits db || translate user query into general language of embeded-models exemple: translate chinese query to be translated by LLM into english to match db data that is in english
yindo added the enhancementfeature request labels 2026-02-22 18:23:02 -05:00
yindo closed this issue 2026-02-22 18:23:02 -05:00
Author
Owner

@khalilxg commented on GitHub (Jun 17, 2024):

Anyone worked on this ?

@khalilxg commented on GitHub (Jun 17, 2024): Anyone worked on this ?
Author
Owner

@timothycarambat commented on GitHub (Jun 17, 2024):

Closing this as not planned. Any pre-processing steps would be very use-case dependent and results of using an LLM to "expand" a query for better RAG results are typically better handled via implementation of knowledge graph support and even reranking models. These results even then tend to be highly dependent on the documents used and increase latency by a lot with minimal improvements to the end result.

however, its worth mentioning that this really I think would be better handled via a middleware/plugin system that can run in AnythingLLM that a user can inject. This way, the tool can still support the workflow you intend to use but does not have to be maintained by the core-team since any specific pre/post processing to a query would likely be unused by some greater population of users.

@timothycarambat commented on GitHub (Jun 17, 2024): Closing this as not planned. Any pre-processing steps would be very use-case dependent and results of using an LLM to "expand" a query for better RAG results are typically better handled via implementation of knowledge graph support and even reranking models. These results even then tend to be highly dependent on the documents used and increase latency by a lot with minimal improvements to the end result. _however_, its worth mentioning that this really I think would be better handled via a middleware/plugin system that can run in AnythingLLM that a user can inject. This way, the tool can still support the workflow you intend to use but does not have to be maintained by the core-team since any specific pre/post processing to a query would likely be unused by some greater population of users.
Author
Owner

@khalilxg commented on GitHub (Jun 17, 2024):

Thank you!

@khalilxg commented on GitHub (Jun 17, 2024): Thank you!
yindo changed title from [FEAT]: Pre-Processing User Queries with LLM for Improved Similarity Search to [GH-ISSUE #1661] [FEAT]: Pre-Processing User Queries with LLM for Improved Similarity Search 2026-06-05 14:38:53 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#1081