diff --git a/docs/cli.md b/docs/cli.md index 7442cc14..ae89da6e 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -139,6 +139,7 @@ Shows: - stored haiku.rag version (from settings) - embeddings provider/model and vector dimension - number of documents +- table versions per table (documents, chunks) At the end, a separate “Versions” section lists runtime package versions: - haiku.rag diff --git a/src/haiku/rag/app.py b/src/haiku/rag/app.py index cd89d0d8..3f7c3c20 100644 --- a/src/haiku/rag/app.py +++ b/src/haiku/rag/app.py @@ -90,6 +90,18 @@ class HaikuRAGApp: docs_tbl = db.open_table("documents") num_docs = int(docs_tbl.count_rows()) # type: ignore[attr-defined] + # Table versions per table (direct API) + doc_versions = ( + len(list(db.open_table("documents").list_versions())) + if "documents" in table_names + else 0 + ) + chunk_versions = ( + len(list(db.open_table("chunks").list_versions())) + if "chunks" in table_names + else 0 + ) + self.console.print( f" [repr.attrib_name]haiku.rag version (db)[/repr.attrib_name]: {stored_version}" ) @@ -108,6 +120,12 @@ class HaikuRAGApp: self.console.print( f" [repr.attrib_name]documents[/repr.attrib_name]: {num_docs}" ) + self.console.print( + f" [repr.attrib_name]versions (documents)[/repr.attrib_name]: {doc_versions}" + ) + self.console.print( + f" [repr.attrib_name]versions (chunks)[/repr.attrib_name]: {chunk_versions}" + ) self.console.rule() self.console.print("[bold]Versions[/bold]") self.console.print(