Update docs

This commit is contained in:
Yiorgis Gozadinos 2025-12-18 16:47:32 +02:00
parent 98727ad080
commit fdd926eeba
No known key found for this signature in database
3 changed files with 18 additions and 0 deletions

View file

@ -6,6 +6,7 @@ The `haiku-rag` CLI provides complete document management functionality.
Global options (must be specified before the command):
- `--config` - Specify custom configuration file
- `--read-only` - Open database in read-only mode (blocks writes, skips upgrades)
- `--version` / `-v` - Show version and exit
Per-command options:
@ -17,6 +18,7 @@ The `haiku-rag` CLI provides complete document management functionality.
```bash
haiku-rag --config /path/to/config.yaml list
haiku-rag --config /path/to/config.yaml list --db /path/to/custom.db
haiku-rag --read-only search "query"
haiku-rag add -h
```
@ -234,6 +236,9 @@ haiku-rag serve --monitor --mcp --agui
# Custom MCP port
haiku-rag serve --mcp --mcp-port 9000
# Read-only mode (excludes write MCP tools, disables monitor)
haiku-rag --read-only serve --mcp
```
See [Server Mode](server.md) for details on available services.

View file

@ -63,8 +63,13 @@ haiku-rag serve --mcp --mcp-port 9000
# stdio transport (for Claude Desktop)
haiku-rag serve --mcp --stdio
# Read-only mode (excludes write tools)
haiku-rag --read-only serve --mcp --stdio
```
**Read-only mode:** When `--read-only` is specified, write tools (`add_document_from_file`, `add_document_from_url`, `add_document_from_text`, `delete_document`) are not registered. Only search and query tools remain available.
## Claude Desktop Integration
Add to your Claude Desktop configuration (`claude_desktop_config.json`):

View file

@ -17,11 +17,19 @@ async with HaikuRAG("path/to/database.lancedb", create=True) as client:
async with HaikuRAG("path/to/database.lancedb") as client:
# Your code here
pass
# Open in read-only mode (blocks writes, skips upgrades)
async with HaikuRAG("path/to/database.lancedb", read_only=True) as client:
results = await client.search("query") # Read operations work
# await client.create_document(...) # Would raise ReadOnlyError
```
!!! note
Databases must be explicitly created with `create=True` or via `haiku-rag init` before use. Operations on non-existent databases will raise `FileNotFoundError`.
!!! note
Read-only mode is useful for safely accessing databases without risk of modification. It blocks all write operations, skips database upgrades on open, and prevents settings from being saved.
## Document Management
### Creating Documents