Skip to main content

garage_rag

The Python half of Garage: a local-first personal RAG pipeline over PostgreSQL + pgvector. It walks personal documents, code repositories and communications, extracts and chunks their text, attributes authorship, embeds every chunk under each registered model, distills documents into span-grounded facts, and serves the corpus over MCP 2.0 and gRPC. Garage never sends communications off the machine (MCP clients you connect still receive what they retrieve); see docs/privacy.md.

Entry points

Command Module Role
garage garage_rag.cli:main_cli ingest, backfill, enrich-facts, search, config, model registry, serve (gRPC bridge for the macOS app)
garage-mcp garage_rag.mcp_server.server:main MCP 2.0 server over stdio, the command MCP clients spawn (garage mcp-install --stdio wires it into Claude Desktop/Code); garage mcp-serve runs the HTTP server

Both are console scripts of the garage_rag package. The macOS app does not ship them as standalone binaries: it bundles the package as site-python inside Frameworks/PythonXPCService.framework (//garage_python:site-packages) and runs it through Swift launchers that embed the bundled interpreter, packaged as helper bundles (Contents/Helpers/garage.app and garage-mcp.app, //macapp/Sources/GarageCLI:garage_app and //macapp/Sources/GarageMCPCLI:garage_mcp_app) and reached through the stable paths Contents/MacOS/garage and garage-mcp. Those launchers find or start the app's database and export GARAGE_DATABASE_URL; the console scripts from a venv do not.

Layout

src/garage_rag/
  ingest/     walker, materialization budget, chunking, scanner, pipeline, Messages threads,
              the storage gateway (in-process SQLAlchemy, or gRPC for the XPC workers)
  extract/    per-format extractors (text, PDF, Office, images via in-process Tesseract, mail) + quality gate
  attribute/  git / metadata / path-rule / message-sender authorship signals
  embed/      embedding backends (Ollama, LM Studio, llama XPC) and backfill
  enrich/     fact distillation (vendored local LangExtract subset) and local generation
  inference/  the one HTTP client for LM Studio, Ollama and the app's LlamaXPCService
  net/        egress.py, the only module that opens outbound connections
  search/     hybrid RRF search
  mcp_server/ MCP tools and client registration (mcp-install)
  service/    gRPC GarageService (proto/garage.proto) and its client
  ops/        the operations the CLI and the gRPC handlers both present
  xpc/        hooks for the app's XPC hosts (llama_xpc client, model loader)
  native/     finds libpq / libtesseract already loaded into the process
  db/         SQLAlchemy models mirroring data/sql/00*.sql, migrations, model registry
  config/     garage.json settings and the generated JSON Schema
tests/        pytest suite, one Bazel py_test target per file

Building and testing

Everything is driven by the Aspect CLI from the repository root:

aspect build //garage_python:site-packages
aspect test //garage_python/tests:suite
aspect test //garage_python/tests:test_facts --bazel-flag=--test_arg=-k --bazel-flag=--test_arg=some_case

tests/BUILD.bazel has one py_test per file (via //tools/pytest:defs.bzl, which drives pytest); aspect gazelle writes the target for a new test file, and the suite list is kept by hand. Third-party dependencies live in pyproject.toml and are locked with uv (../tools/repin), exposed to Bazel as @pypi//<package>.

For quick iteration outside Bazel, use the uv-managed virtualenv:

cd garage_python
uv sync --extra dev
uv run pytest -q

The lockfile resolves for macOS only; on Linux use uv venv --python 3.14 .venv && uv pip install -e '.[dev]', then .venv/bin/pytest -q. tests/test_postgres.py runs against a real server when GARAGE_TEST_DATABASE_URL is set (see "Testing against Postgres" in ../CLAUDE.md).

Documentation

../docs/ — architecture, schema, attribution, privacy, plus support and troubleshooting guides. The generated config schema is committed at ../docs/.data/garage.schema.json and served as https://garagerag.app/.data/garage.schema.json.

Metadata

Release files for garage-rag 1.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for garage-rag 1.5.0
File Size Uploaded
garage_rag-1.5.0.tar.gz 298.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for garage-rag 1.5.0
File Interpreter ABI Platform
garage_rag-1.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 652.9 kB

Release files / garage_rag-1.5.0.tar.gz

Download URL garage_rag-1.5.0.tar.gz
Size 298.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a81e8258eb4b2c217d047cff94588272d5d40d4f634cdf21aa695e57a63a2663
BLAKE2b-256 checksum
How to use checksums
b40cc8725fbd2836edeb459ec589981a333cb185aff99aef7b690bf6842e363c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 3, 2026.

Transparency log

Release files / garage_rag-1.5.0-py3-none-any.whl

Download URL garage_rag-1.5.0-py3-none-any.whl
Size 354.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2e5839028944d0546b52cd9cb2c99f415eb2d0fd718ee87792402c16d94946aa
BLAKE2b-256 checksum
How to use checksums
e4fe8c58b0b94f1e01b1cc152a5286930fd7bdc3b200c580ab2b8f8aabc47929
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 3, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.5.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page