pgembed: Embedded PostgreSQL for Agents
pgembed makes it easy to add a full-featured PostgreSQL database to your Python application—no server setup required. Your users simply run pip install yourapp, and PostgreSQL comes bundled automatically.
Think of it like SQLite, but with the power of PostgreSQL. Just pip install pgembed, call pgembed.get_server(...), and you're ready to go.
What pgembed gives you
- Pip-installable PostgreSQL binaries: Pre-built wheels for Linux, macOS (Apple Silicon & Intel), and Windows
- No admin rights needed: Runs without
sudoor root access - Handles edge cases: Works in Docker containers, Google Colab, and environments with multiple PostgreSQL installations
- Simple initialization:
pgembed.get_server(MY_DATA_DIR)handlesinitdb, port management, and process cleanup automatically - Vector search ready: Includes pgvector and pgvectorscale extensions for vector similarity queries and high-performance vector storage
- Text search ready: Includes pg_textsearch extension for BM25-based full-text search with ranking
Quick start
import pgembed
# Initialize and start the server
pgembed.get_server("/path/to/my/data/dir")
# Connect and use like any PostgreSQL database
# ... your database code here
# Look in examples/*.py for more complete examples that could be run via uv
PostgreSQL binaries are available at pgembed.POSTGRES_BIN_PATH if you need direct access to tools like initdb, pg_ctl, psql, or pg_config.
Extensions
pgembed supports optional PostgreSQL extensions as separate packages. Install the extensions you need:
# Base installation (PostgreSQL only)
pip install pgembed
# With specific extensions (separate wheels)
pip install pgembed-pgvector
pip install pgembed-pgvectorscale
pip install pgembed-pgtextsearch
# Multiple extensions
pip install pgembed-pgvector pgembed-pgvectorscale pgembed-pgtextsearch
Available extensions:
pgembed-pgvector: Vector similarity search (works on all platforms)pgembed-pgvectorscale: High-performance vector storage (requires Rust, not available on Alpine/Windows)pgembed-pgtextsearch: BM25-based full-text search (requires Rust, not available on Alpine/Windows)
Checking available extensions
import pgembed
# Check which extensions are available
print(pgembed.list_extensions())
# {'pgvector': True, 'pgvectorscale': True, 'pgtextsearch': False, 'pg_duckdb': True}
# Check if a specific extension is available
if pgembed.has_extension('pgvector'):
# Create the extension
server.create_extension('vector')
Platform Support
- pgvector: Works on Linux, macOS (Intel & Apple Silicon), Windows
- pgvectorscale: Works on Linux, macOS (Intel & Apple Silicon). NOT available on Alpine Linux or Windows (requires Rust)
- pgtextsearch: Works on Linux, macOS (Intel & Apple Silicon). NOT available on Alpine Linux or Windows (requires Rust)
Building specific extensions
To build only specific extensions:
# Build only pgvector
make pgvector
# Build only pgvectorscale
make pgvectorscale
# Build only pgtextsearch
make pgtextsearch
# Build specific combination
make EXTENSIONS="pgvector pgtextsearch" all
History
pgembed is a fork of pgserver, which was inspired by postgresql-wheel. While those projects focused primarily on Linux wheels, pgembed extends the approach with:
- Multi-platform support (Linux, macOS, Windows)
- Robust process management and cleanup
- Built-in pgvector, pgvectorscale, and pg_textsearch extensions
Metadata
Release files for pgembed 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 775.4 MB
Release files / pgembed-0.2.0-cp314-cp314-win_amd64.whl
| Download URL | pgembed-0.2.0-cp314-cp314-win_amd64.whl |
|---|---|
| Size | 14.4 MB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
51afbbd7ab657d01dbcfa7e0b0a405add9c0620cde0d9acb724938a2e4904df1
|
|
BLAKE2b-256 checksum How to use checksums |
aae87e90fbbd6388c81a6c86040b25c46002ddfc164b4514772688d3028ae0ce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 18, 2026.
Transparency logRelease files / pgembed-0.2.0-cp314-cp314-musllinux_1_2_x86_64.whl
| Download URL | pgembed-0.2.0-cp314-cp314-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 12.7 MB |
| Tags | CPython 3.14 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
5c140a5d9d975690206f5d1af1cc96b8d9764039975d71a2a735cffe833a1811
|
|
BLAKE2b-256 checksum How to use checksums |
7e6fe8d74454325980117a289493b46b408a240cc510ea4dd907f38466c2e362
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 18, 2026.
Transparency logRelease files / pgembed-0.2.0-cp314-cp314-musllinux_1_2_aarch64.whl
| Download URL | pgembed-0.2.0-cp314-cp314-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 12.6 MB |
| Tags | CPython 3.14 Linux musl 1.2+ ARM64 |
|
SHA-256 checksum How to use checksums |
9d5698bb4f119f07020d54dd0b547366c5510d2702aca99668ef81933e56060a
|
|
BLAKE2b-256 checksum How to use checksums |
3ec8f07d822393a5fe9bda40eedd6674b07161c04debdadb681deae56f22adde
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 18, 2026.
Transparency logRelease files / pgembed-0.2.0-cp314-cp314-manylinux_2_28_x86_64.whl
| Download URL | pgembed-0.2.0-cp314-cp314-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 68.2 MB |
| Tags | CPython 3.14 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
df6a14b6f51ec84fe62391f19fe73065d9453a94ec3c2c0dafd64f16c4376ab5
|
|
BLAKE2b-256 checksum How to use checksums |
e528d133f33271b5021cf05f675fefd673c79d3189e598d4ae89eaf649a8707b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 18, 2026.
Transparency logRelease files / pgembed-0.2.0-cp314-cp314-manylinux_2_28_aarch64.whl
| Download URL | pgembed-0.2.0-cp314-cp314-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 67.9 MB |
| Tags | CPython 3.14 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
160e187b799a7e69201b8198ee8c2601b4e680c0a18fec45e4258f939512f86d
|
|
BLAKE2b-256 checksum How to use checksums |
ca351b2a756c9bd6789c5df651b68c3f189ec54d1ee91ee49c0b68145d43baed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 18, 2026.
Transparency logRelease files / pgembed-0.2.0-cp314-cp314-macosx_15_0_arm64.whl
| Download URL | pgembed-0.2.0-cp314-cp314-macosx_15_0_arm64.whl |
|---|---|
| Size | 83.0 MB |
| Tags | CPython 3.14 macOS 15.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
f34d3ba29713f96a4f862f2b200c139b678c51e665b0e008d3939920194cdfa3
|
|
BLAKE2b-256 checksum How to use checksums |
2af5e8178e024f3e3d2991af62535e18f6c40cf049393bb2e2d2eaf7b0740e5d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 18, 2026.
Transparency logRelease files / pgembed-0.2.0-cp313-cp313-win_amd64.whl
| Download URL | pgembed-0.2.0-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 13.9 MB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
a08bcb72a60ace67fd8396fc858bf5b3beee922c3a640e014de9b46d24fa78fc
|
|
BLAKE2b-256 checksum How to use checksums |
1ea6422d38992c4de319216a89b28c144e21dd13348b7432dd3e4d585085ac29
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 18, 2026.
Transparency logRelease files / pgembed-0.2.0-cp313-cp313-musllinux_1_2_x86_64.whl
| Download URL | pgembed-0.2.0-cp313-cp313-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 12.7 MB |
| Tags | CPython 3.13 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
0fcd6983b4129579a623af67494663baba41695fdf615bf189d46c41c321fbce
|
|
BLAKE2b-256 checksum How to use checksums |
033c60ece3e6a9416fe87d781f352ffbce725c6085cf2c120b521fcd84e36181
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 18, 2026.
Transparency logRelease files / pgembed-0.2.0-cp313-cp313-musllinux_1_2_aarch64.whl
| Download URL | pgembed-0.2.0-cp313-cp313-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 12.6 MB |
| Tags | CPython 3.13 Linux musl 1.2+ ARM64 |
|
SHA-256 checksum How to use checksums |
d4fe27603c223e6ae368ae3be0d5fefb945b143ee916107938f601876028971d
|
|
BLAKE2b-256 checksum How to use checksums |
5e8904ad37f678f54f88dda044982517bbbe197cff75f50392ea5063c508c3e5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 18, 2026.
Transparency logRelease files / pgembed-0.2.0-cp313-cp313-manylinux_2_28_x86_64.whl
| Download URL | pgembed-0.2.0-cp313-cp313-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 68.2 MB |
| Tags | CPython 3.13 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
c39f8936abcddf728515be587561e0169db0a81267b6c0fb56572e42bcd62f6d
|
|
BLAKE2b-256 checksum How to use checksums |
787c272b8b99221751a0be0805be9882568c3e0afedde06fa605963bff2fd366
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 18, 2026.
Transparency logRelease files / pgembed-0.2.0-cp313-cp313-manylinux_2_28_aarch64.whl
| Download URL | pgembed-0.2.0-cp313-cp313-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 67.9 MB |
| Tags | CPython 3.13 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
87e101036cefbea2b7d90577f4ba0652d67115a56c2c2e9a7b5110a852a511c9
|
|
BLAKE2b-256 checksum How to use checksums |
f8164ce62ce3c63754b48ac9533af86f0b097bc3f1ba899798de216b7fd92d38
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 18, 2026.
Transparency logRelease files / pgembed-0.2.0-cp313-cp313-macosx_15_0_arm64.whl
| Download URL | pgembed-0.2.0-cp313-cp313-macosx_15_0_arm64.whl |
|---|---|
| Size | 83.0 MB |
| Tags | CPython 3.13 macOS 15.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
0aba5e4cb04b06175c7a4d72e0c0e820985d534a2915a5258128de92b6a14d97
|
|
BLAKE2b-256 checksum How to use checksums |
65e0c78ec6ad36768652ebd824354d84b680f13e79a98785404904aead5c72ef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 18, 2026.
Transparency logRelease files / pgembed-0.2.0-cp312-cp312-win_amd64.whl
| Download URL | pgembed-0.2.0-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 13.9 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
ca22d748b98f83c197923977d409b57babb1692ea04db348c72493cc8e662fdf
|
|
BLAKE2b-256 checksum How to use checksums |
e4f2714e67e7ab5f3053255ce336c895292959260069f836dab2625db67adfdd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 18, 2026.
Transparency logRelease files / pgembed-0.2.0-cp312-cp312-musllinux_1_2_x86_64.whl
| Download URL | pgembed-0.2.0-cp312-cp312-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 12.7 MB |
| Tags | CPython 3.12 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
0b6d3dad4a6a7eea25c4d3e140284f3f549676b186e7facd5bbdb6e3e26e418b
|
|
BLAKE2b-256 checksum How to use checksums |
37c7d21b3552fcd103165d213d4839ad1e0da8fc0762357c4564970172c985f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 18, 2026.
Transparency logRelease files / pgembed-0.2.0-cp312-cp312-musllinux_1_2_aarch64.whl
| Download URL | pgembed-0.2.0-cp312-cp312-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 12.6 MB |
| Tags | CPython 3.12 Linux musl 1.2+ ARM64 |
|
SHA-256 checksum How to use checksums |
a2579aad5975e334e6bcb474af2ff6e68b3aad3a20034701f2fb0f4770a5f81d
|
|
BLAKE2b-256 checksum How to use checksums |
420e917108be10529c6c1611ec173cf9494c246cacdc0e941a20df4a82fddb27
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 18, 2026.
Transparency logRelease files / pgembed-0.2.0-cp312-cp312-manylinux_2_28_x86_64.whl
| Download URL | pgembed-0.2.0-cp312-cp312-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 68.2 MB |
| Tags | CPython 3.12 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
08d509684e902a1773ebcb4c8e61d2a5fc7974f81d017f349574312f74b487e4
|
|
BLAKE2b-256 checksum How to use checksums |
603f4f281cf18c495eb05177103de8c27e2b390b5fe4885548501a7359bca8a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 18, 2026.
Transparency logRelease files / pgembed-0.2.0-cp312-cp312-manylinux_2_28_aarch64.whl
| Download URL | pgembed-0.2.0-cp312-cp312-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 67.9 MB |
| Tags | CPython 3.12 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
564647405608b7cc3455c455b7c91803e078a56be9ba90bbcdabc1ab449ee36f
|
|
BLAKE2b-256 checksum How to use checksums |
7006850135e74c728986e7670cf112bd7ccf91d9cc7b30d747ca09823c1098e0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 18, 2026.
Transparency logRelease files / pgembed-0.2.0-cp312-cp312-macosx_15_0_arm64.whl
| Download URL | pgembed-0.2.0-cp312-cp312-macosx_15_0_arm64.whl |
|---|---|
| Size | 83.0 MB |
| Tags | CPython 3.12 macOS 15.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
a7db0fccfb0aca91b1f4757079cb95c9c0a946609206c8ba91c1e7339da1038a
|
|
BLAKE2b-256 checksum How to use checksums |
f59b705d237d7088bb191e896db4e90c0d671ecaac2d258532d78003a363d0b0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 18, 2026.
Transparency log