Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@saquib34
Copy link

This pull request introduces a new @orama/plugin-pgvector package, enabling Orama to use PostgreSQL with the pgvector extension as a backend for persistent, memory-efficient vector search and storage. The implementation offloads document storage and vector operations to PostgreSQL, supports lazy loading and memory limits, and provides a test script for quick validation.

The most important changes are:

New Plugin Implementation:

  • Added the @orama/plugin-pgvector package with a package.json defining dependencies on pg, pgvector, TensorFlow libraries, and Orama, and including build/test scripts.
  • Implemented the main plugin logic in src/index.ts, which:
    • Hooks into Orama's lifecycle to store documents in PostgreSQL, remove them from memory, and perform vector searches directly in the database.
    • Supports lazy loading, memory limits, and a vector-search-only mode for efficiency.
    • Manages document caching and memory usage with an LRU strategy.

Database Management and Vector Operations:

  • Added src/pgvector-manager.ts to handle:
    • Table creation, schema adaptation, and vector column/index management in PostgreSQL.
    • Document insertion/removal, vector search queries, and memory cache management.
    • Efficient retrieval and reconstruction of documents with vector data.

Testing and Usage Example:

  • Provided a comprehensive test script test/quick-test.js that:
    • Sets up a test database, inserts sample documents with mock embeddings, and performs vector similarity searches.
    • Demonstrates plugin usage and verifies correct integration with Orama and PostgreSQL.

@saquib34
Copy link
Author

saquib34 commented Oct 10, 2025

i have resolved GitHub CLI failed. I have added the test code that I missed

Added tests for basic functionality, insertion, and searching with vectors in the plugin-pgvector.
@saquib34
Copy link
Author

saquib34 commented Nov 7, 2025

@micheleriva can you pls approve this workflow i have added the test file earlier which was failed

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