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

Rework DSPy retrieve #1726

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

chenmoneygithub
Copy link
Collaborator

@chenmoneygithub chenmoneygithub commented Oct 30, 2024

Right now dspy.Retrieve is not a useful abstraction, and we have too many prebuilt dspy.Retrieve implementations. Although it would be nice to have DSPy play as a centralized hub for these retriever providers, this will quickly go outdated due to the maintenance challenge. Before our code smells, we are reworking the dspy.Retrieve with the goal that:

  • dspy.Retrieve becomes a useful abstraction, which can help people instrument retrieval (with callback support), and save the retriever imlplementations.
  • Users find it easy to provide a custom function to do retrieval, without needing to worry about converting their code to DSPy's rules. It will be really bad if we force people to learn a over-engineered dspy.Retrieve.
  • The interface is possible for future retrieval optimization, and in general expansible.

Meanwhile, we realized that many retrievers require users to compute the embedding before querying, so we are exposing a dspy.Embedding interface, which is built on top of litellm, similar to dspy.LM.

@chenmoneygithub chenmoneygithub marked this pull request as draft October 30, 2024 23:10
@chenmoneygithub chenmoneygithub force-pushed the rework-retrieve branch 3 times, most recently from 68c932a to 2ce32fc Compare October 31, 2024 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants