Welcome to the pgai project! This guide will help you get started with contributing to pgai, a project that brings embedding and generation AI models closer to your PostgreSQL database.
pgai is organized as a monorepo containing two main components:
-
PostgreSQL extension: Located in projects/extension
- Implements the core functionality for AI operations within your database
- Written in Python and PL/PgSQL
- Development guidelines are available in the extension directory
-
Python Library: Located in projects/pgai
- Available on PyPI
- Provides a high-level interface for interacting with the vectorizer worker, and additionally integrations such as the SQLAlchemy one.
- Written in Python
- Development guidelines are available in the pgai directory
Before you begin, ensure you have the following installed:
-
Just - Our task runner for project commands
- Available in most package managers
- See installation instructions in the Just documentation
-
UV - Fast Python package installer and resolver
- Required for Python dependency management
- Faster and more reliable than pip
- See installation instructions in the UV documentation
We follow the Conventional Commits specification for all commits. This standardization helps us:
- Automate release processes
- Generate changelogs
- Maintain clear commit history
- Enforce consistent messaging
Examples of valid commit messages:
feat: add vector similarity search
fix: resolve null pointer in embedding generation
docs: update installation instructions
test: add integration tests for OpenAI embedder
To ensure your commits meet our standards before pushing:
-
Install the local commit hook:
just install-commit-hook
-
The hook will automatically check your commit messages
- Prevents non-compliant commits locally
- Saves time waiting for CI feedback
- Provides immediate validation
- Fork the repository
- Create a feature branch
- Make your changes
- Ensure commits follow conventional commit format
- Submit PR with clear description of changes
- Wait for CI validation and review
The CI pipeline will check:
- Commit message format
- Code style
- Tests
- Build process
- Check existing documentation in docs directory
- Open an issue for bugs, feature requests, or any other questions
- Join our community discussions in our Discord server
- Review closed PRs for examples
Remember to always pull the latest changes before starting new work.