Skip to content

Add ParadeDB hybrid RAG support - #639

Open
semhoun wants to merge 3 commits into
neuron-core:3.xfrom
semhoun:feature/paradedb-hybrid-rag
Open

Add ParadeDB hybrid RAG support#639
semhoun wants to merge 3 commits into
neuron-core:3.xfrom
semhoun:feature/paradedb-hybrid-rag

Conversation

@semhoun

@semhoun semhoun commented Aug 13, 2026

Copy link
Copy Markdown

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)

Description

What does this PR do?

Adds first-party ParadeDB support for retrieval-augmented generation:

  • pgvector cosine similarity search
  • ParadeDB BM25 full-text search
  • hybrid retrieval using Reciprocal Rank Fusion
  • document insertion, bulk upsert, metadata persistence, and source deletion
  • automatic table, BM25 index, and HNSW index setup
  • a dedicated HybridRetrieval strategy

Why is this change needed?

ParadeDB provides PostgreSQL-native BM25 search and integrates with pgvector.
Combining both retrieval methods improves results for queries containing exact
identifiers or keywords while preserving semantic matching.

How should this change be used and documented?

Instantiate ParadeDBVectorStore with a PDO PostgreSQL connection, initialize
the table with setupTable(), and configure HybridRetrieval explicitly on the
RAG instance. A complete example is included in the README.

Related Issues

  • None

Testing

  • I have tested this change locally
  • I have added/updated unit tests where appropriate
  • All existing tests pass
  • I have tested this with different PHP versions

Integration tests were executed against the existing Compose ParadeDB instance
with pg_search 0.25.2 and pgvector 0.8.4.

Results:

  • ParadeDB and hybrid retrieval: 8 tests, 23 assertions
  • Full suite: 1,222 tests, 5,040 assertions
  • PHPStan: no errors
  • Rector dry run: no changes
  • PHP CS Fixer dry run: no changes

Breaking Changes

  • No breaking changes

Documentation

  • I have updated relevant documentation

Checklist

  • My code follows the project's coding standards (PHPStan)
  • I have performed a self-review of my code
  • My changes generate no new warnings or errors
  • My commit messages are clear and descriptive
  • This PR addresses only ONE specific goal/issue

Additional Notes

The CI suite now starts ParadeDB and configures the integration tests through
PARADEDB_DSN, PARADEDB_USER, and PARADEDB_PASSWORD.

@ilvalerione

Copy link
Copy Markdown
Contributor

You should remove the example from the README.

@semhoun

semhoun commented Aug 15, 2026

Copy link
Copy Markdown
Author

You should remove the example from the README.

I remove all modification from README.

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.

2 participants