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.0
# or
uv tool install obsidianrag==4.0.0

LanceDB is a standard dependency in 4.0.0; 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.0.tar.gz (41.8 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.0-py3-none-any.whl (49.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: obsidianrag-4.0.0.tar.gz
  • Upload date:
  • Size: 41.8 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.0.tar.gz
Algorithm Hash digest
SHA256 9419c1e4e5dfd842e6551ff272ef3c9aa2a457442569169a947a8379b4e48e4e
MD5 67e09ada0838a721b46a0d1292b32bc2
BLAKE2b-256 4dc76fe945e28b3ab4ab8f5bba0b20c7da320a6baf19df67c78402226d727a1f

See more details on using hashes here.

Provenance

The following attestation bundles were made for obsidianrag-4.0.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: obsidianrag-4.0.0-py3-none-any.whl
  • Upload date:
  • Size: 49.9 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7d785a5f1be20444805f289f82214763eb9ee286c801e03cb05fdc18a8367fcd
MD5 827d4a7e2525c3d07c9b6e820ff5bde3
BLAKE2b-256 9d33e8a74e899fd661441bd8bb9496cca71ba583529c23634b4fe5e44bac76f7

See more details on using hashes here.

Provenance

The following attestation bundles were made for obsidianrag-4.0.0-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

4.0.1

2 files

This release

4.0.0 This release

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