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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

obsidianrag-4.0.1.tar.gz (43.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

obsidianrag-4.0.1-py3-none-any.whl (51.8 kB view details)

Uploaded Python 3

File details

Details for the file obsidianrag-4.0.1.tar.gz.

File metadata

  • Download URL: obsidianrag-4.0.1.tar.gz
  • Upload date:
  • Size: 43.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for obsidianrag-4.0.1.tar.gz
Algorithm Hash digest
SHA256 1fa4b032ccddcd046da1803226288984b2d80141897b2e071f15b60c33764938
MD5 83700b1477106dc8fa3985f6210f35f7
BLAKE2b-256 e0ea3bf14f52e860fa55b5166010347b315ccb37e9b5e050891bccba62b462ca

See more details on using hashes here.

Provenance

The following attestation bundles were made for obsidianrag-4.0.1.tar.gz:

Publisher: release-backend.yml on Vasallo94/ObsidianRAG

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file obsidianrag-4.0.1-py3-none-any.whl.

File metadata

  • Download URL: obsidianrag-4.0.1-py3-none-any.whl
  • Upload date:
  • Size: 51.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for obsidianrag-4.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cb15e7789eb02cc452c489055446ff731e68d20016191b4818574944fe9e2ca3
MD5 6ae032040abefd6161f53a1a8b53c1a0
BLAKE2b-256 ee294ea0744aad38de160908cefaf23921204528d21b02eea1bc87ee9b1fcac1

See more details on using hashes here.

Provenance

The following attestation bundles were made for obsidianrag-4.0.1-py3-none-any.whl:

Publisher: release-backend.yml on Vasallo94/ObsidianRAG

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

4.0.1 This release

2 files

4.0.0

2 files

3.0.3

2 files

3.0.2

2 files

3.0.1

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page