Skip to content

Conversation

NitishGourishetty
Copy link

I'm was interested in adding Contextual AI as a retriever integration within DSPy.

This PR includes an example notebook (docs/docs/tutorials/contextual-reranker/contextual_reranker_tutorial.ipynb) that integrates Contextual AI's instruction-tuned reranker (ctxl-rerank-v2-instruct-multilingual) into DSPy as a post-retrieval reranking step.

The notebook shows:

  • How to subclass dspy.Retrieve for external API rerankers
  • An end-to-end RAG pipeline on the RAG-QA Tech dataset
  • Evaluation using DSPy's SemanticF1 metric

This is just a demo / POC and I would love any suggestions on how to align this more closely with DSPy's retriever conventions and how I can get it into the /retrievers or maybe a new rerankers folder.

Any guidance on next steps (like whether to keep it as an example or formalize it under dspy/retrievers/) would be much appreciated! Thanks!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant