Production Apps. Delivered Fast.
REALIGHT DEV
Since 2024
← Back to Blog

Building AgentA: A Private AI File & Email Intelligence Agent

Insights on AI-accelerated fullstack development: concept, functionality, and stack behind a desktop agent that understands and organizes your files and email—fully offline.

The idea

AgentA is a Private AI File Intelligence System: a desktop application that understands, organizes, and automates your file system and email locally. No cloud, no data leaving your machine—just a single agent that processes files, classifies documents, renames intelligently, finds duplicates, and can handle email (fetch, categorize, auto-reply) while you stay in control.

The goal is to turn a watched folder and an inbox into something the user can query and command via natural language, with the heavy lifting done by a local LLM and a sandboxed execution layer that only does what the user allows.

Most AI tools expect you to upload your emails, contracts, and invoices to someone else’s servers. For many professionals, that’s simply not acceptable: client data, legal documents, and finance records are too sensitive to leave the machine they live on.

AgentA takes the opposite approach. It is a local desktop assistant that runs entirely on your own computer: no external AI APIs, no third‑party storage, and no background actions you didn’t ask for. The goal is simple — give you real AI help with files and email, while your data stays exactly where it belongs.

Core principles

  • Fully offline — Local LLM (Ollama); no external AI APIs.
  • Privacy-first — All processing on-device; user data does not leave the machine.
  • Semi-autonomous — The agent suggests and can auto-execute safe actions; riskier ones require confirmation.
  • Transparent — Every file move, rename, or email action is logged and visible in an activity feed.
  • Professional-grade control — Configurable watch folder, categories, settings, and toggles (e.g. auto-reply on/off).
  • Hardware-friendly — Designed to run on entry‑level, mass‑market laptops without dedicated VRAM; uses system RAM efficiently, so you don’t need an “AI workstation” to benefit from it.

What AgentA does for you in daily work

Beyond the architecture and stack, AgentA is meant to quietly take over the boring, error‑prone parts of working with email and documents, while you stay in control of every important decision.

  • Keeps your inbox under control — reads and organizes your email, highlights what really matters, surfaces deadlines and action items, and helps you focus on the few threads that actually need your attention.
  • Writes for you when it matters — can draft standard, professional replies to high‑priority emails so you don’t have to start from a blank screen every time something urgent arrives.
  • Lets you “chat with your files” — instead of opening documents one by one, you can point AgentA at files or folders and ask questions in natural language; the agent answers based on PDFs, Word documents, spreadsheets, and even images (via OCR).
  • Turns messy folders into structure — watches a folder like Downloads and moves files into clean structures such as Finance / [Counterparty Name] / Invoices, so invoices and documents automatically land where they belong.
  • Keeps your archive usable — finds duplicate files and supports batch cleanup and rename, which makes long‑ignored archives manageable again without manual digging.
  • Makes long documents less painful — summarizes contracts and long texts, highlights key points and potential risks, and lets you review complex material faster without reading every line.

Who AgentA is for

AgentA is not a generic chatbot. It is aimed at people whose daily work depends on sensitive documents and predictable workflows.

  • People who work with sensitive client or business documents and want AI support without sending data to external services.
  • Professionals and small business owners who need to save time on email, invoices, and file organization, but don’t have the appetite to build and maintain custom internal tools.
  • Anyone who wants practical AI help with real daily work while keeping privacy, control, and predictable costs as non‑negotiable requirements.

What AgentA does today

Files & documents

  • Watch folder — Monitors a user-chosen folder (e.g. Downloads); new files are detected and can be processed automatically.
  • Process single or all files — Extracts text and metadata (PDF, DOCX, images with OCR, etc.), classifies by type (invoice, receipt, general document), and suggests a smart rename (timestamp always; content-based name only when the current filename looks generic/random).
  • Organize — Files can be moved into category-based subfolders; metadata and classifications are stored in a local database, and typical finance flows (e.g. Finance / [Counterparty Name] / Invoices) can be represented in the folder structure so every document lands where it belongs.
  • Analyze — Ask in natural language: “What’s in this file?” or “Summarize these documents.” The chat agent uses the local LLM and returns answers based on extracted content.
  • Invoices — Detected invoices are stored and queryable; the agent automatically extracts vendor, date, total, VAT, currency, and invoice number, can show expenses by counterparty, and generate expense reports.
  • Contracts & long documents — Summarizes long texts, highlights key points and risks, and lets you focus on what matters without reading every line.
  • Duplicate handling — User selects a folder (or uses the default); one action “Search for duplicates” finds same-content files and moves extras into a Duplicates subfolder; combined with smart rename, this makes bulk cleanup practical.

Email

  • Fetch & list — Connect via IMAP; fetch and list emails with filters (category, read/unread, priority).
  • Categorization — Incoming emails are categorized (e.g. WORK vs personal); priority is detected so you can see what really matters first.
  • Inbox assistance — Helps keep your inbox under control by surfacing deadlines, action items, and high‑priority threads, so you can respond in time instead of hunting through messages.
  • Auto-reply (optional) — For WORK emails with critical/urgent/high priority, AgentA can send a standard business reply. This is configurable (on/off) in settings.
  • Email watcher — Can watch the inbox and process new messages (store, categorize, optional auto-reply) in the background.

Chat-driven control

  • Natural language — User talks to the agent in chat: “Process all files in the watch folder,” “Show my invoices,” “Find duplicates in Downloads,” “What’s the status of the file watcher?”
  • Tools — The LLM maps intents to tools: process_file, get_emails, get_invoices, find_duplicates, move_duplicates, get_settings, update_settings, generate_expense_report, and many more. The same capabilities are available via the UI (Files, Settings, etc.).
  • Memory — Chat history is persisted (e.g. SQLite) so context is kept across sessions.

Assistants & UX

  • Desktop chat assistant — A simple desktop window where you can ask AgentA, in natural language, to process, analyze, or extract text from any file on your PC—without hunting through menus.
  • Telegram assistant — Send documents from your phone to a Telegram bot and receive AI processing results back. The bot sends a short, standard business acknowledgment to any sender, while only authorized users can trigger full AI processing of files and commands.
  • Desktop app layout — Single window: dashboard, Files, Emails, Settings, and Chat.
  • Process-all jobs — “Process all” runs in the background; user can check status and cancel.
  • Activity log — All important actions (file renamed, file moved, email replied) appear in an actions list for audit and transparency.

Cost and hardware assumptions

One of the design constraints for AgentA is that it should fit into a normal professional’s environment. That means no per‑request API fees that spike when you have a busy month, and no requirement to buy a special “AI workstation” just to get value from the tool.

AgentA runs on entry‑level, mass‑market laptops without dedicated VRAM, using system RAM efficiently. All AI reasoning happens locally, and there are no per‑call cloud API charges — once the app is installed, you can use it as much as you want without worrying about variable AI bills.

Tech stack (summary)

LayerTechnology
Desktop UIElectron 28+ with React 18, Vite, React Router, Zustand
Backend APIPython 3.11+, FastAPI, Uvicorn
LLMOllama (local); primary model Qwen2.5:7B (32K context)
DatabaseSQLite with SQLAlchemy ORM; Alembic for migrations
File processingpdfplumber, PyPDF2, python-docx, openpyxl, Pillow, pytesseract (OCR), py7zr (archives), python-magic/filetype
File systemwatchdog (folder watch), aiofiles
EmailIMAP (fetch/list), SMTP (send/reply); backend email client + watcher
Logging & resiliencestructlog, tenacity (retries for LLM/API)
Reportsreportlab, weasyprint (PDF reports)
PackagingElectron Builder (Windows x64, portable option); backend bundled e.g. via PyInstaller

The app is structured in layers: UI (Electron/React)API (FastAPI)Agent controller & chat (tool router, prompts)Permission & risk engineExecution layer (file move/rename, etc.)Data (SQLite, file system). The LLM never touches the OS directly; every file or email action goes through the execution layer and permission checks.

Why this stack

  • Ollama — Simple local deployment, REST API, good model choice (e.g. Qwen2.5 for long context and reasoning). Fits the “no cloud” requirement.
  • Electron + React — Fast to ship a cross-platform desktop UI; matches common frontend skills and aligns with AI-assisted development (e.g. Cursor) for rapid iteration.
  • SQLite — No separate server; single-file DB for metadata, chat history, and settings. Ideal for a desktop agent.
  • Python backend — Rich ecosystem for file formats, OCR, and email; FastAPI gives a clear, type-friendly API for the frontend and for future extensions.

Where it’s headed

Planned or in design: batch rename (smart or incremental numbering) for many files at once; exposing more backend capabilities in chat (send email, mark read/archive, daily/action-item reports); and continued expansion of tool set and UI (e.g. Files page enhancements). The architecture is built so new “tools” can be added and wired to both API and chat without changing the core execution model.

Build context

AgentA is being built with a strong emphasis on architecture first: layered security, tool-based agent design, and clear separation between LLM reasoning and execution. AI-assisted development (e.g. Cursor, modern LLM tooling) is used to accelerate implementation while keeping design and product decisions human-driven—similar to the approach described on Realight Dev for fullstack and production apps.

If you’re interested in private, local AI agents or file/email automation for desktop, AgentA is a concrete example: one codebase, one desktop app, one local LLM, and a growing set of capabilities that stay entirely under your control.

If this resonates with you

If you recognize yourself in this description — a lot of sensitive documents, an overflowing inbox, and no desire to push everything to the cloud — AgentA is built for that reality. It stays on your machine, respects your boundaries, and focuses on making everyday work with files and email less tiring.

If you’d like to see more or explore how AgentA could fit into your workflow, you can reach out via the WhatsApp button on this page to discuss AgentA in more detail.

Share this post: