Skip to content

feat: add superlinked retriever integration #32433

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

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

fm1320
Copy link

@fm1320 fm1320 commented Aug 6, 2025

feat(superlinked): add superlinked retriever integration

Description:
Add Superlinked as a custom retriever with full LangChain compatibility. This integration enables users to leverage Superlinked's multi-modal vector search capabilities including text similarity, categorical similarity, recency, and numerical spaces with flexible weighting strategies. The implementation provides a SuperlinkedRetriever class that extends LangChain's BaseRetriever with comprehensive error handling, parameter validation, and support for various vector databases (in-memory, Qdrant, Redis, MongoDB).

Key Features:

  • Full LangChain BaseRetriever compatibility with k parameter support
  • Multi-modal search spaces (text, categorical, numerical, recency)
  • Flexible weighting strategies for complex search scenarios
  • Vector database agnostic implementation
  • Comprehensive validation and error handling
  • Complete test coverage (unit tests, integration tests)
  • Detailed documentation with 6 practical usage examples

Issue: N/A (new integration)

Dependencies:

  • superlinked==33.5.1 (peer dependency, imported within functions)
  • pandas^2.2.0 (required by superlinked)

Linkedin handle: https://www.linkedin.com/in/filipmakraduli/

Implementation Details

Files Added/Modified:

  • libs/partners/superlinked/ - Complete package structure
  • libs/partners/superlinked/langchain_superlinked/retrievers.py - Main retriever implementation
  • libs/partners/superlinked/tests/unit_tests/test_retrievers.py - unit tests
  • libs/partners/superlinked/tests/integration_tests/test_retrievers.py - Integration tests with mocking
  • docs/docs/integrations/retrievers/superlinked.ipynb - Documentation a few usage examples

Testing:

  • make format - passing
  • make lint - passing
  • make test - passing (16 unit tests, integration tests)
  • Comprehensive test coverage including error handling, validation, and edge cases

Documentation:

  • Example notebook with 6 practical scenarios:
    1. Simple text search
    2. Multi-space blog search (content + category + recency)
    3. E-commerce product search (price + brand + ratings)
    4. News article search (sentiment + topics + recency)
    5. LangChain RAG integration example
    6. Qdrant vector database integration

Code Quality:

  • Follows LangChain contribution guidelines
  • Backwards compatible
  • Optional dependencies imported within functions
  • Comprehensive error handling and validation
  • Type hints and docstrings throughout

fm1320 added 3 commits August 6, 2025 18:31
- Add Superlinked as a custom retriever with full LangChain compatibility, usage examples, and docs
Copy link

vercel bot commented Aug 6, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Project Deployment Preview Comments Updated (UTC)
langchain Ready Preview Comment Aug 13, 2025 4:01pm

Copy link

codspeed-hq bot commented Aug 6, 2025

CodSpeed WallTime Performance Report

Merging #32433 will not alter performance

Comparing fm1320:feat/add-superlinked-integration (56129ad) with master (4f71c35)

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

Summary

✅ 13 untouched benchmarks

@fm1320 fm1320 marked this pull request as draft August 6, 2025 18:31
Copy link

codspeed-hq bot commented Aug 6, 2025

CodSpeed Instrumentation Performance Report

Merging #32433 will not alter performance

Comparing fm1320:feat/add-superlinked-integration (56129ad) with master (4f71c35)

Summary

✅ 14 untouched benchmarks

@fm1320 fm1320 changed the title Feat/add superlinked integration feat(superlinked): add superlinked retriever integration Aug 6, 2025
@fm1320 fm1320 changed the title feat(superlinked): add superlinked retriever integration feat: add superlinked retriever integration Aug 6, 2025
@fm1320 fm1320 force-pushed the feat/add-superlinked-integration branch from 1af0778 to 9dd6679 Compare August 6, 2025 19:11
@fm1320 fm1320 force-pushed the feat/add-superlinked-integration branch 3 times, most recently from fcac6b0 to 08ef8e3 Compare August 6, 2025 19:28
- Convert from Poetry to PDM backend format to match LangChain standards
- Remove circular import in SuperlinkedRetriever docstring
- Delete poetry.lock file (no longer needed with PDM)
- Update notebook to follow LangChain template requirements
@fm1320 fm1320 force-pushed the feat/add-superlinked-integration branch from 08ef8e3 to 48755ff Compare August 6, 2025 19:32
@mdrxy mdrxy added the new-integration Adding a new partner library package label Aug 7, 2025
@mdrxy
Copy link
Collaborator

mdrxy commented Aug 11, 2025

ready for review @fm1320 ?

@fm1320
Copy link
Author

fm1320 commented Aug 11, 2025

Hey @mdrxy still finishing up some of the stuff with the external package, will update this as a docs only PR soon

fm1320 added 2 commits August 13, 2025 16:27
…es; convert examples to ipynb; align retriever notebook with links and app/query guidance
@fm1320 fm1320 marked this pull request as ready for review August 14, 2025 09:48
@fm1320
Copy link
Author

fm1320 commented Aug 14, 2025

@mdrxy maybe you can have a look now, here is the PyPI package it references

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-integration Adding a new partner library package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants