A local AI-powered OS assistant for Windows that organizes files, monitors system pressure, suggests cleanup actions, and stays privacy-friendly by running with local tooling such as Ollama.
OsAgent is built for people whose Downloads folder turns into archaeology, whose disk keeps filling up, and whose machine feels slow long before they know why. It combines fast deterministic file handling with local LLM reasoning, safe approval gates, background monitoring, and review-friendly terminal UX.
- Why People Use It
- Highlights
- Demo
- Architecture
- Comparison
- Installation
- Quick Start
- Core Workflows
- Configuration
- Command Reference
- Output Philosophy
- Safety Model
- Background Notifications
- Troubleshooting
- Contributing
- Roadmap
- Local Development
- Publishing to PyPI
- Keep
Downloadsunder control without manually sorting hundreds of files - Detect large, stale, or duplicate files before they become a problem
- Understand system pressure from CPU, memory, disk, and top processes
- Get practical recommendations like what to review, close, archive, or ignore
- Run in the background and surface approval needs with desktop notifications
- Stay local-first: Ollama is optional, and rule-based fallbacks still work
- Fast scans with metadata caching and parallel processing
- Safe file organization with approval-aware actions
- Relative folder structure preservation during moves
- Restore reports and undo support for recent move actions
- Process-aware system pressure analysis
- Ollama-powered human recommendations when available
- Background daemon with Windows notifications
- Compact CLI summaries by default, full JSON when you need it
osagent doctor
osagent scan
osagent organize --dry-run
osagent stats
osagent suggest
osagent restore-reportAdd these once you have media assets:
docs/demo-scan.pngdocs/demo-stats.pngdocs/demo-suggest.pngdocs/demo-daemon.gif
Recommended production-style layout:


OsAgent uses a hybrid local architecture:
+----------------------+
| Ollama |
| Local LLM Reasoning |
+----------+-----------+
|
v
+------------------+ +----+------------------+ +------------------+
| Filesystem |-->| Agent Service |<--| System Monitor |
| Scanner | | planning / safety | | CPU/RAM/Disk |
+------------------+ +----+------------------+ +------------------+
|
+-------------+-------------+
| |
v v
+------------------+ +----------------------+
| SQLite Memory | | CLI / Daemon / Toast |
| history, cache, | | summaries, reports, |
| feedback, state | | notifications |
+------------------+ +----------------------+
Key design choices:
- Rules-first for speed and reliability
- LLM second for human reasoning and ambiguous cases
- SQLite for persistence, auditability, and restore support
- Explicit approval gates for risky actions
| Capability | OsAgent | Manual Cleanup | Generic File Sorter |
|---|---|---|---|
| Organize Downloads | Yes | Slow | Usually yes |
| Preserve subfolder structure | Yes | Yes | Often no |
| Duplicate detection | Yes | Manual effort | Sometimes |
| CPU / memory / disk review | Yes | Manual | Rare |
| Process-aware suggestions | Yes | Manual | No |
| Local LLM recommendations | Yes | No | No |
| Restore / undo support | Yes | Manual | Rare |
| Background monitoring | Yes | No | Sometimes |
| Desktop notifications | Yes | No | Rare |
| Approval-aware actions | Yes | N/A | Rare |
pip install osagent
osagent init
osagent doctor
osagent organize --dry-runIf you want human-style recommendations for pressure management and ambiguous file classification, install and run Ollama locally.
ollama serve
ollama list
osagent config get ollama_model
osagent config get ollama_urlDefault expected URL:
http://127.0.0.1:11434/api/generateIf needed:
osagent config set ollama_model "phi3"
osagent config set ollama_url "http://127.0.0.1:11434/api/generate"osagent initThis creates your config at:
%USERPROFILE%\.osagent\config.jsonosagent doctordoctor checks:
- config file presence
- watched paths
- destination root
- database location
- Ollama reachability and model availability
- desktop notification support
- daemon status
osagent scan
osagent organize --dry-run
osagent stats
osagent suggestosagent organize --applyosagent daemon start
osagent daemon statusWhen enabled, the daemon can:
- watch configured folders
- generate review suggestions in the background
- send Windows toast notifications
- open a review report when you click the notification
osagent scan
osagent organize --dry-run
osagent organize --applyOsAgent:
- classifies files using rules first
- falls back to Ollama only when needed
- preserves relative subfolder structure
- writes actions to history for review and restore
osagent stats
osagent suggestThis gives you:
- current CPU, memory, and disk pressure
- large and stale file signals
- top memory-heavy processes
- actionable suggestions
- human-readable Ollama advice when available
osagent stats
osagent suggest
osagent close 12345 --dry-run
osagent close 12345Use close carefully. OsAgent can recommend process review actions, but destructive or system-impactful actions should always be checked before execution.
osagent approve <action-id>
osagent reject <action-id>
osagent ignore "C:\Users\rocki\Downloads\some-folder"These feedback loops help OsAgent become more useful over time.
osagent restore-report
osagent restore --last 5 --dry-run
osagent restore --action-id <action-id>You can review recent move history and restore files back to their original locations.
Use the CLI instead of manually editing JSON whenever possible:
osagent config show
osagent config get watched_paths
osagent config set watched_paths "[\"D:/Downloads\", \"E:/Inbox\"]"
osagent config set destination_root "D:\Organized"
osagent config set worker_count 24
osagent config set ollama_worker_count 4
osagent config set notifications_enabled true
osagent config set daemon_poll_seconds 300Useful config keys:
watched_pathsdestination_rootollama_modelollama_urlworker_countollama_worker_countnotifications_enableddaemon_poll_secondsauto_organize_safe_movesthresholds.disk_warn_percentthresholds.cpu_pause_percentthresholds.memory_pause_percent
osagent --help
osagent doctor
osagent config show
osagent config get watched_paths
osagent config set watched_paths "[\"D:/Downloads\"]"
osagent scan
osagent organize --dry-run
osagent organize --apply
osagent stats
osagent duplicates
osagent suggest
osagent close 12345 --dry-run
osagent approve <action-id>
osagent reject <action-id>
osagent ignore <path>
osagent restore-report
osagent restore --last 5 --dry-run
osagent daemon start
osagent daemon status
osagent daemon stopFor detailed help:
osagent organize --help
osagent config --help
osagent daemon --helpFor machine-readable output, put global flags before the subcommand:
osagent --json doctor
osagent --json scan
osagent --no-progress --json suggestOsAgent is designed for two modes:
- Human mode: compact, review-friendly terminal summaries with colors and banners
- Script mode: structured JSON via
--json
This keeps day-to-day use readable without making automation painful.
OsAgent is intentionally conservative.
- Safe moves can be automated
- Cleanup, close-process, and review-heavy actions are suggestion-first
- Approval remains explicit for risky actions
- Restore support exists for move operations
- Local fallbacks keep working even when Ollama is unavailable
To run in the background:
osagent daemon startTo verify:
osagent daemon statusTo stop:
osagent daemon stopIf notifications are enabled and review is needed, OsAgent can send a Windows desktop notification and open the generated report when clicked.
Run:
osagent doctor
ollama serve
ollama list
osagent config get ollama_model
osagent config get ollama_urlRun:
osagent daemon status
osagent daemon startUse:
osagent --json suggest
osagent --json stats
osagent --json doctorRun:
osagent restore-report
osagent restore --last 10 --dry-runContributions are welcome.
Good first contribution areas:
- better file classification rules
- richer process recommendations
- safer cleanup heuristics
- improved daemon/report UX
- platform support expansion
- test coverage for edge cases
Recommended workflow:
git clone <your-fork>
cd OsAgent
python -m venv .venv
.\.venv\Scripts\python.exe -m pip install -e .[dev]
.\.venv\Scripts\python.exe -m pytest -qWhen contributing:
- keep changes local-first and privacy-aware
- prefer safe defaults
- avoid destructive automation without explicit user intent
- update docs when behavior changes
Near-term:
- richer process and app-level recommendations
- quieter / adaptive progress modes
- daemon logs and better background visibility
- startup integration for Windows login
- improved restore UX and historical reports
Mid-term:
- smarter learning from approvals, rejects, and ignores
- better uninstall and cleanup candidate detection
- more structured Ollama reasoning and fallback reporting
- richer duplicate analysis and reclaim estimates
Long-term:
- tray app / lightweight desktop dashboard
- cross-platform support
- plugin/tool ecosystem for app-specific cleanup workflows
- stronger policy engine for enterprise or power-user rules
.\.venv\Scripts\python.exe -m pip install -e .[dev]
.\.venv\Scripts\python.exe -m pytest -q
.\.venv\Scripts\python.exe -m osagent doctorpython -m pip install -U build twine
python -m build
python -m twine check dist/*
python -m twine upload dist/*Before publishing:
- update the version in
pyproject.toml - replace placeholder project URLs with your real repository URLs
- run the full test suite
OsAgent is already useful for local file hygiene and system review, and it's evolving toward a more capable local desktop operations assistant. The current design favors safety, observability, and recoverability over magical automation.