Skip to main content

ObsidianRAG Backend 4

Python 3.11+ backend for the ObsidianRAG API, CLI, revisioned SQLite FTS5 catalog, and embedded LanceDB vector index.

Install

pip install obsidianrag==4.0.1
# or
uv tool install obsidianrag==4.0.1

LanceDB is a standard dependency in 4.0.1; no extra is required.

Commands

obsidianrag serve --vault /path/to/vault
obsidianrag index --vault /path/to/vault
obsidianrag index --vault /path/to/vault --full-rebuild
obsidianrag status --vault /path/to/vault
obsidianrag prune --vault /path/to/vault
obsidianrag search "deployment rollback" --vault /path/to/vault
obsidianrag search "deployment rollback" --vault /path/to/vault --lexical-only
obsidianrag ask "How do I roll back a deployment?" --vault /path/to/vault

index is incremental by default. Use --full-rebuild only when status reports incompatible schema, embedding, or chunk settings, or when recovering a malformed active manifest.

API 4

Start the server:

obsidianrag serve --vault /path/to/vault --host 127.0.0.1 --port 8000

Endpoints:

  • GET /capabilities
  • GET /health
  • GET /models
  • POST /ask
  • POST /ask/stream
  • GET /index/status
  • POST /index/build
  • POST /index/prune

A fresh server is healthy but not query-ready. It does not build automatically. GET /health reports query_ready, active_revision, and serving_revision so clients can present the correct lifecycle action.

Build request:

{
  "full_rebuild": false
}

Status states:

  • missing: build the first index.
  • current: active content and configuration match the vault.
  • stale: refresh incrementally; an older revision may remain available to current readers.
  • rebuild_required: perform an explicit full rebuild.

Storage and safety

Indexes live under .obsidianrag/v4. Builds:

  • scan regular Markdown without following symlinks or junctions;
  • create isolated copy-on-write revisions;
  • copy unchanged vectors in bounded batches;
  • fingerprint actual synthetic embedding outputs;
  • validate SQLite integrity, foreign keys, FTS semantics, deterministic IDs, paths, dimensions, and finite vectors;
  • fsync the candidate before atomically replacing active.json;
  • keep the previous serving revision available until all checked-out readers finish.

prune removes inactive revisions only when no reader lease exists.

Legacy .obsidianrag/db data from 3.x is ignored and never removed automatically.

Providers

Generation supports Ollama, LM Studio, and custom Ollama/chat-completions-compatible endpoints. Embeddings support Ollama and HuggingFace.

obsidianrag serve --vault /path/to/vault --provider ollama --model gemma3

obsidianrag serve --vault /path/to/vault \
  --provider lmstudio --model local-model \
  --base-url http://localhost:1234/v1

Environment variables use the OBSIDIANRAG_ prefix.

Evaluation

obsidianrag evaluate evaluation.json --vault /path/to/vault --k 10
obsidianrag evaluate evaluation.json --vault /path/to/vault --lexical-only
obsidianrag compare-evaluations baseline.json candidate.json

External-agent evaluation requires explicit private-data consent:

obsidianrag evaluate-agent private.json \
  --vault /path/to/vault \
  --generator-command "python -m obsidianrag.pi_agent_adapter" \
  --judge-command "python -m obsidianrag.pi_agent_adapter" \
  --allow-private-data

Development

uv sync --locked --dev
uv run pytest
uv run ruff check .
uv run ruff format --check .
uv run mypy .
uv build

Normal tests use temporary/sample vaults and mocked providers.

Metadata

Release files for obsidianrag 4.0.1

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

Source distribution (sdist)

Source distribution for obsidianrag 4.0.1
File Size Uploaded
obsidianrag-4.0.1.tar.gz 43.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for obsidianrag 4.0.1
File Interpreter ABI Platform
obsidianrag-4.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 94.8 kB

Release files / obsidianrag-4.0.1.tar.gz

Download URL obsidianrag-4.0.1.tar.gz
Size 43.0 kB
Tags Source
SHA-256 checksum
How to use checksums
1fa4b032ccddcd046da1803226288984b2d80141897b2e071f15b60c33764938
BLAKE2b-256 checksum
How to use checksums
e0ea3bf14f52e860fa55b5166010347b315ccb37e9b5e050891bccba62b462ca
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 Aug 3, 2026.

Transparency log

Release files / obsidianrag-4.0.1-py3-none-any.whl

Download URL obsidianrag-4.0.1-py3-none-any.whl
Size 51.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cb15e7789eb02cc452c489055446ff731e68d20016191b4818574944fe9e2ca3
BLAKE2b-256 checksum
How to use checksums
ee294ea0744aad38de160908cefaf23921204528d21b02eea1bc87ee9b1fcac1
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 Aug 3, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

4.0.1 This release

2 release files

4.0.0

2 release files

3.0.3

2 release files

3.0.2

2 release files

3.0.1

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