DMSLite is a secure and lightweight command-line tool for document management. It provides efficient document indexing, searching, and AI-based categorization, ensuring fast performance even with large document volumes, all while keeping operations entirely local on your machine for maximum privacy and security.
If your roots bin folder is in $PATH you can type dmslite
everywhere to:
- Consume Documents: Add documents to a specified folder to process. (E.g. with the command
c
) - Search Documents: Use the CLI to search for documents by content, title, or creation date (fuzzy word similarity search). (E.g. with the command
s
followed by the search phrase) - Open Documents: Open a Document found with the search with its default application right from the cli tool. (E.g. with the command
o
followed by the id found out by a search before) - Delete Documents: Delete a Document found with the search by its id. (E.g. with the command
d
followed by the id found out by a prior search.)
- PostgreSQL database
- Tesseract installed in your local language
- Ollama setup with a local Model.
- pdftoppm (Installed with
sudo apt install poppler-utils
) - xdg-open. To be able to open Docuemnts right from the terminal.
- CREATE USER dmslite WITH PASSWORD 'dmslite';
- As a psql superuser, create a PostgreSQL databaseand Schema:
psql -U postgres
CREATE DATABASE dmslite OWNER dmslite;
CREATE SCHEMA dmslite;
- Write your Password under
src/settings.rs
in the StringPSQL_PASSWD
- As the dmslite User, create search Indices, main_table and document_content table
CREATE EXTENSION pg_trgm; -- create indices CREATE INDEX idx_content_trgm ON document_content USING gin (content gin_trgm_ops); CREATE INDEX idx_summary_trgm ON document_content USING gin (summary gin_trgm_ops); CREATE INDEX idx_buzzwords_trgm ON document_content USING gin (buzzwords gin_trgm_ops); -- create tables CREATE TABLE dmslite.main_table ( id SERIAL PRIMARY KEY, upload_date DATE, filepath VARCHAR(255), title TEXT ); CREATE TABLE dmslite.document_content ( id SERIAL PRIMARY KEY, -- Other columns in table2 content TEXT, summary TEXT, buzzwords TEXT, -- Add more columns as needed FOREIGN KEY (id) REFERENCES main_table(id) ON DELETE CASCADE );
Build custom Ollama models:
For Memory restricted machines the gemma:2b Model is recommended (Default).
Otherwise Choose llama2.
Set this inside the Modelfiles as the FROM <model> Command.
```
ollama create doc_buzzword_generator -f doc_buzzword_generator
ollama create doc_summarizer -f doc_summarizer
ollama create doc_title_generator -f doc_title_generator
```
- Make a folder for consumation of documents.
- Make a folder for indexed storage of documents.
- Write the two absolute folder paths to the strings
CONSUME_PATH
andSTORAGE_PATH
in the filesrc/settings.rs
.
They must be absolute paths starting with/home/<user>/...
- Set the String
TESSERACT_LANG
to your tesseract Language flag. (E.g. "eng" or "deu")
DROP TABLE document_content;
DROP TABLE main_table;
DROP INDEX IF EXISTS idx_content_trgm;
DROP INDEX IF EXISTS idx_summary_trgm;
DROP INDEX IF EXISTS idx_buzzwords_trgm;
DROP FUNCTION fuzzy_search_document_content;
ollama rm doc_buzzword_generator
ollama rm doc_summarizer
ollama rm doc_title_generator