Async RAG toolkit on top of Postgres/pgvector and Voyage AI.
Project description
ragsmith
Async RAG toolkit on top of Postgres + pgvector and Voyage AI, with
zero direct or indirect numpy / pandas dependency.
Highlights
- 100% async (
asyncpg,httpx). - Voyage embeddings via the raw HTTP API (no SDK, no
numpy). - pgvector storage with cosine similarity search.
- Strict tooling:
ruff(all rules),pytest, 100% coverage in CI. - Python 3.14+.
Install
uv sync
Local pgvector database
A docker-compose.yml is provided for local development and integration
testing:
docker compose up -d # start Postgres + pgvector on localhost:5432
docker compose down -v # stop and wipe the volume
Connection string (also written in .env.example):
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/ragsmith
Usage
import asyncio
import os
from ragsmith import PgVectorStore, VoyageClient, Retriever, Document, chunk_text
async def main() -> None:
async with VoyageClient() as voyage:
store = await PgVectorStore.from_dsn(os.environ["DATABASE_URL"], dim=1024)
try:
chunks = chunk_text("Long document text...", max_chars=500)
vectors = await voyage.embed([c.text for c in chunks], input_type="document")
await store.upsert(
Document(content=c.text, embedding=v)
for c, v in zip(chunks, vectors, strict=True)
)
retriever = Retriever(voyage, store)
for hit in await retriever.retrieve("what is rag?", k=3):
print(hit.score, hit.document.content)
finally:
await store.aclose()
asyncio.run(main())
Documentation
Full API reference: https://gghez.github.io/ragsmith/
Releasing
Releases are fully automated through GitHub Actions and PyPI Trusted Publishing (OIDC, no API token stored).
-
Bump
versioninpyproject.tomland commit (e.g.chore: bump to 0.2.0). -
Tag and push:
git tag v0.2.0 git push origin v0.2.0
-
The
Releaseworkflow runsuv build, publishes the sdist + wheel to PyPI and creates a matching GitHub Release with the artifacts attached.
One-time PyPI setup: register the project on PyPI as a
Trusted Publisher pointing to
gghez/ragsmith, workflow release.yml, environment pypi.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ragsmith-0.0.1.tar.gz.
File metadata
- Download URL: ragsmith-0.0.1.tar.gz
- Upload date:
- Size: 45.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02f39258626c121ae5bd82d3eec15dd27ac4770c6ef698ab8b9467169ae4b5f7
|
|
| MD5 |
5b917bc4c6dbb3e2e3f64a12d425883a
|
|
| BLAKE2b-256 |
587e5f92e10b58e5d69ae53b5c176dd47585bedb4d01634fe1d56653e45344ae
|
Provenance
The following attestation bundles were made for ragsmith-0.0.1.tar.gz:
Publisher:
release.yml on gghez/ragsmith
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ragsmith-0.0.1.tar.gz -
Subject digest:
02f39258626c121ae5bd82d3eec15dd27ac4770c6ef698ab8b9467169ae4b5f7 - Sigstore transparency entry: 1288723124
- Sigstore integration time:
-
Permalink:
gghez/ragsmith@4307bb9f4f8af878d1bf7ca97edf8766ef3b984d -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/gghez
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4307bb9f4f8af878d1bf7ca97edf8766ef3b984d -
Trigger Event:
push
-
Statement type:
File details
Details for the file ragsmith-0.0.1-py3-none-any.whl.
File metadata
- Download URL: ragsmith-0.0.1-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
747c0b65990d5e4d6b984a4c7a072b7829142c8592082fcb76f386c1a44158da
|
|
| MD5 |
2d70386e616d237e146001ee42c4d794
|
|
| BLAKE2b-256 |
739a74df241ecf2114956f27ecdaa9fe024d0f2549350033dd1c0aa6af3a8e82
|
Provenance
The following attestation bundles were made for ragsmith-0.0.1-py3-none-any.whl:
Publisher:
release.yml on gghez/ragsmith
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ragsmith-0.0.1-py3-none-any.whl -
Subject digest:
747c0b65990d5e4d6b984a4c7a072b7829142c8592082fcb76f386c1a44158da - Sigstore transparency entry: 1288723205
- Sigstore integration time:
-
Permalink:
gghez/ragsmith@4307bb9f4f8af878d1bf7ca97edf8766ef3b984d -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/gghez
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@4307bb9f4f8af878d1bf7ca97edf8766ef3b984d -
Trigger Event:
push
-
Statement type: