Skip to content

Adding Postgres Support #145

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 9 commits into
base: main
Choose a base branch
from
Open

Adding Postgres Support #145

wants to merge 9 commits into from

Conversation

AbeOmor
Copy link

@AbeOmor AbeOmor commented May 27, 2025

This will address: #136

This pull request introduces PostgreSQL support with pgvector integration for vector similarity search, replacing the default retrieval endpoint and adding new configurations, scripts, and dependencies.

Key changes include updating configuration files, adding PostgreSQL-specific scripts, and modifying the retrieval logic to support the new database type.

PostgreSQL Integration

  • Added a new PostgreSQL connection string in .env.template for database configuration.
  • Updated config_retrieval.yaml to set PostgreSQL as the preferred retrieval endpoint and added configuration details for the postgres endpoint.
  • Introduced setup_postgres.sql and setup_postgres_schema.py scripts for setting up and validating the PostgreSQL schema with pgvector.
  • Added a new example script, postgres_example.py, to demonstrate PostgreSQL vector database integration.

Retrieval Logic Updates

  • Modified retriever.py to include a new client, PgVectorClient, for handling PostgreSQL-based retrieval.
  • Added a diagnostic script, postgres_diagnostics.py, to identify and resolve PostgreSQL configuration issues.
  • Added a test connect script, test_postgres_connection.py, to identify and resolve PostgreSQL configuration issues.

Dependency Updates

  • Added psycopg2-binary and pgvector to requirements.txt for PostgreSQL integration and vector operations.

Future Opportunities:

Working demo.

https://www.loom.com/share/b7c14ff1f0b347a38f51b15ea5175701?sid=31410d68-1bb8-41aa-9e24-dc6f951396ca

@AbeOmor AbeOmor marked this pull request as ready for review May 28, 2025 06:34
@AbeOmor
Copy link
Author

AbeOmor commented May 28, 2025

@chelseacarter29 and @rvguha Just publish Postgres support PR, it is out of draft

@jennifermarsman jennifermarsman added the enhancement New feature or request label Jun 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants