From fb837ede699b1cab0281cb71f0e024ac1417fcbf Mon Sep 17 00:00:00 2001 From: Yiorgis Gozadinos Date: Wed, 2 Jul 2025 11:17:16 +0300 Subject: [PATCH] Documentation --- README.md | 3 +++ docs/cli.md | 10 ++++++++++ docs/python.md | 7 +++++++ 3 files changed, 20 insertions(+) diff --git a/README.md b/README.md index cf86ae99..bc3a9567 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,9 @@ haiku-rag search "query" # Ask questions haiku-rag ask "Who is the author of haiku.rag?" +# Rebuild database (re-chunk and re-embed all documents) +haiku-rag rebuild + # Start server with file monitoring export MONITOR_DIRECTORIES="/path/to/docs" haiku-rag serve diff --git a/docs/cli.md b/docs/cli.md index fae3db8a..efedc679 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -35,6 +35,16 @@ haiku-rag get 1 haiku-rag delete 1 ``` +### Rebuild Database + +Rebuild the database by deleting all chunks & embeddings and re-indexing all documents: + +```bash +haiku-rag rebuild +``` + +Use this when you want to change things like the embedding model or chunk size for example. + ## Search Basic search: diff --git a/docs/python.md b/docs/python.md index ebc87f4c..8ad47f4e 100644 --- a/docs/python.md +++ b/docs/python.md @@ -67,6 +67,13 @@ await client.update_document(doc) await client.delete_document(doc.id) ``` +### Rebuilding the Database + +```python +async for doc_id in client.rebuild_database(): + print(f"Processed document {doc_id}") +``` + ## Searching Documents Basic search: