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 /capabilitiesGET /healthGET /modelsPOST /askPOST /ask/streamGET /index/statusPOST /index/buildPOST /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
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9419c1e4e5dfd842e6551ff272ef3c9aa2a457442569169a947a8379b4e48e4e
|
|
| MD5 |
67e09ada0838a721b46a0d1292b32bc2
|
|
| BLAKE2b-256 |
4dc76fe945e28b3ab4ab8f5bba0b20c7da320a6baf19df67c78402226d727a1f
|
Provenance
The following attestation bundles were made for obsidianrag-4.0.0.tar.gz:
Publisher:
release-backend.yml on Vasallo94/ObsidianRAG
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
obsidianrag-4.0.0.tar.gz -
Subject digest:
9419c1e4e5dfd842e6551ff272ef3c9aa2a457442569169a947a8379b4e48e4e - Sigstore transparency entry: 2314984201
- Sigstore integration time:
-
Permalink:
Vasallo94/ObsidianRAG@bf54d2534460c372818b727f0594304f76aed547 -
Branch / Tag:
refs/tags/backend-v4.0.0 - Owner: https://github.com/Vasallo94
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-backend.yml@bf54d2534460c372818b727f0594304f76aed547 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d785a5f1be20444805f289f82214763eb9ee286c801e03cb05fdc18a8367fcd
|
|
| MD5 |
827d4a7e2525c3d07c9b6e820ff5bde3
|
|
| BLAKE2b-256 |
9d33e8a74e899fd661441bd8bb9496cca71ba583529c23634b4fe5e44bac76f7
|
Provenance
The following attestation bundles were made for obsidianrag-4.0.0-py3-none-any.whl:
Publisher:
release-backend.yml on Vasallo94/ObsidianRAG
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
obsidianrag-4.0.0-py3-none-any.whl -
Subject digest:
7d785a5f1be20444805f289f82214763eb9ee286c801e03cb05fdc18a8367fcd - Sigstore transparency entry: 2314984267
- Sigstore integration time:
-
Permalink:
Vasallo94/ObsidianRAG@bf54d2534460c372818b727f0594304f76aed547 -
Branch / Tag:
refs/tags/backend-v4.0.0 - Owner: https://github.com/Vasallo94
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-backend.yml@bf54d2534460c372818b727f0594304f76aed547 -
Trigger Event:
push
-
Statement type: