Skip to content

mscbuild/local-docs-ai-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

29 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŒŸ LocalDocsAI assistant

A private, local AI assistant for your documentsโ€”without sending data to the cloud

ARTICLE

๐Ÿ’ก The gist of the idea

Users upload their PDF, DOCX, TXT, or notes (e.g., from Obsidian, Notion, or personal files) and receive a local AI assistant that:

  • Answers questions about document content.
  • Finds citations, summarizes sections, and compares files.
  • Works completely offline on their computer (Mac, Windows, or Linux).
  • No data is transmitted onlineโ€”maximum privacy.

โœจ Opportunities

  • ๐Ÿ“„ Document upload: PDF, TXT, Markdown

  • ๐Ÿ’ฌ AI-powered chat based on your documents (RAG)

  • ๐Ÿ•ต๏ธโ€โ™‚๏ธ Complete privacy โ€“ everything runs on your computer

  • ๐Ÿง  Uses local LLM via Ollama (phi3, Mistral, Llama 3, etc.)

  • ๐Ÿ“œ Chat history is saved

  • ๐ŸŒ Simple web interface (or desktop app)

    ๐Ÿ”ง Technologies

  • Language: Python (base) + Electron or Tauri (for GUI)

  • LLM: Ollama (phi3, Mistral, Llama 3)

  • Embeddings + RAG: ChromaDB or FAISS

  • Frontend: React + Vite (if using Tauri) or pure HTML/CSS for simplicity

  • Documents: PyPDF2, built-in parsers

    ๐Ÿ”ง Requirements

  • Ollama (install and run)

  • Python 3.9+

  • pip

    ๐Ÿ’ฐ Monetization

  • Free version (open-source):

  • Supports basic formats (TXT, PDF)

  • Works with small files

  • CLI interface

    Paid "Pro" version (SaaS or desktop license)

  • Support for DOCX, PPTX, Excel, and Notion exports

  • Improved UI with chat history and tags

  • Syncing across devices (optional, with encryption)

  • Priority support and updates

  • Selling through Gumroad or your own website (~$15โ€“$29/time or $5/month)

    Additionally:

  • GitHub Sponsors to support development

  • Partnerships with privacy software vendors (Proton, Tuta, etc.)

    ๐ŸŽฏ Target audience

  • Lawyers, doctors, and researchers who work with confidential documents.

  • Product managers and analysts who analyze internal reports.

  • Regular users who are tired of ChatGPT "remembering" their data.

    ๐ŸŒ Why is this relevant?

  • Growing interest in local LLMs (Ollama, LM Studio, Jan.ai).

  • Privacy concerns when using ChatGPT.

  • Many want an AI assistant but don't want to be dependent on the cloud.

    ๐Ÿ—บ๏ธ 1. Project Architecture (LocalDocs AI)

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                  LocalDocs AI (Desktop App)           โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                             โ”‚
         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
         โ”‚                   โ”‚                   โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Frontend    โ”‚   โ”‚   Backend     โ”‚   โ”‚   AI Engine   โ”‚
โ”‚  (Tauri/React)โ”‚   โ”‚ (FastAPI/Flask)โ”‚  โ”‚ (Ollama/Llama.cpp)โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ฒโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                           โ”‚                   โ”‚
                   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                   โ”‚  Document     โ”‚   โ”‚  Vector       โ”‚
                   โ”‚  Storage      โ”‚   โ”‚  Database     โ”‚
                   โ”‚  (./docs/)    โ”‚   โ”‚  (ChromaDB)   โ”‚
                   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ” Data flow:

  • The user adds a PDF โ†’ saves it to ./docs/.
  • The system parses the text and breaks it into chunks.
  • The chunks are embedded and saved in ChromaDB.
  • When asked: โ†’ the query is embedded โ†’ relevant chunks are searched โ†’ โ†’ a prompt is generated โ†’ sent to the local LLM โ†’ โ†’ a response is returned

๐Ÿ“ Project structure

LocalDocs AI
โ”‚
โ”œโ”€โ”€ core/
โ”‚   โ”œโ”€โ”€ document_loader.py   โ† support PDF, TXT, MD
โ”‚   โ”œโ”€โ”€ rag_engine.py        โ† RAG + chat history
โ”‚   โ””โ”€โ”€ chat_history.py      โ† history management
โ”‚
โ”œโ”€โ”€ api/
โ”‚   โ””โ”€โ”€ main.py              โ† FastAPI server
โ”‚
โ”œโ”€โ”€ static/                  โ† simple HTML interface
โ”‚   โ””โ”€โ”€ index.html
โ”‚
โ”œโ”€โ”€ docs/                    โ† user files
โ””โ”€โ”€ chroma_db/               โ† vector database

Install:

pip install -r requirements.txt

And make sure Ollama is running and the model is loaded:

ollama pull phi3  # mistral, llama3

โ–ถ๏ธ How to launch an MVP

  • Create a docs/ folder and place any PDF there (name it sample.pdf).
  • Launch Ollama: ollama serve (it usually starts automatically).
  • Run:
python main.py add docs/sample.pdf
python main.py ask "What is this document about?"

Installation

git clone https://github.com/mscbuild/local-docs-ai-agent.git
cd local-docs-ai-agent
pip install -r requirements.txt

Launching the web version

cd api
uvicorn main:app --reload --port 8000

Open in your browser: http://localhost:8000

Usage

  • Upload a PDF/TXT/MD file
  • Ask questions: "What is this document about?", "Find the contract date," etc.
  • Get answers from AI trained on your data

๐Ÿ”’ Privacy

  • All documents are stored locally (./docs/)
  • The vector database is on your disk (./chroma_db/)
  • Requests to LLM are processed through Ollama on your machine
  • Not a single byte is lost to the internet

๐Ÿค Support the project

This project is open source. If you find it useful:

  • โญ Star it on GitHub
  • ๐Ÿ’ฌ Report bugs in Issues
  • ๐Ÿ’ฐ Support the developer through GitHub Sponsors (coming soon)

๐Ÿ“œ License

License โ€“ free to use for personal and commercial purposes.

๐Ÿ•ต๏ธ Build AI Agents, Visually

  • โญ Quick Start Build AI Agents, Visually"
  • About

    ึŽ๐Ÿ‡ฆ๐Ÿ‡ฎ A private, local AI assistant for your documentsโ€”without sending data to the cloud.

    Topics

    Resources

    License

    Stars

    Watchers

    Forks

    Releases

    No releases published

    Packages

    No packages published