Other

技术解读

以下内容由 GitRead 中文社区 编辑团队基于项目 README 与官方资料整理, 结合中文开发者的常见使用场景补充技术选型建议。具体以项目官方文档为准。

分析报告:ghostwork 项目深度技术剖析

项目背景与痛点

在数字化日益发展的今天,屏幕的使用史和操作历史对于开发者和技术人员而言具有重要的参考价值。然而,现有的解决方案多依赖于云端服务,不仅增加了数据泄露的风险,还对隐私形成了挑战。同时,一些工具又受限于操作系统的特定环境,缺乏跨平台的灵活性。因此,“hvardhan878/ghostwork” 项目应运而生,它是一个专注于 macOS 平台的开源工具,不仅提供了直观的图形界面,还具备强大的屏幕历史搜索功能,支持工作流自动化,这些功能都在本地实现,确保了用户的隐私和数据安全。

核心技术揭秘

ghostwork 的核心技术在于如何将屏幕历史数据以有效、高效的方式进行本地存储与检索,并结合 Graphical User Interface (GUI) 和命令行界面 (CLI),实现无缝的用户体验。基于 Screenpipe CLI 的功能,它构建了一个用户友好的界面,并利用 macOS 本地 API 完成了与系统的深度集成,达到了高效的数据处理和检索能力。

下面是其数据流简略示意图:

graph TD A[用户启动应用] --> B[初始化 GUI] B --> C[调用 Screenpipe CLI] C --> D{"记录数据?"} D -->|"否"| E[结束初始化] D -->|"是"| F[暂存数据] F --> G[持久化存储] G --> E[结束初始化] E --> H[用户触发搜索] H --> I[解析搜索条件] I --> J[数据查询] J --> K[结果展示]

ghostwork 的设计考虑了多个用户场景,如开发者寻找特定代码片段、图形设计人员查看操作历史等,因此它能够智能地识别和分类用户输入,优化了搜索和查看操作。

功能亮点与差异

与其他屏幕记录和自动化工具相比,ghostwork 最突出的优点在于其“隐私至上”的设计理念。它坚定地执行本地计算和存储,不在云端留痕任何用户操作,满足了那些极度重视隐私的用户需求。此外,ghostwork 的界面简洁且直觉性强,易于上手,用户可以通过直观的界面进行复杂的搜索和自动化流程设置。

应用场景与落地建议

在生产环境中部署 ghostwork 时,建议用户注意如下几点:

  1. 数据管理和存储:本地存储虽然安全,但也会占用更多的本地磁盘空间。用户需监控数据存储大小,避免不必要的存储压力。
  2. 性能考量:持续记录和分析会消耗较多的系统资源,因此不建议在低性能设备上长时间运行。
  3. 应用兼容性:确保其他应用程序不会产生干扰,特别是在运行一些需要大量系统资源的应用时。

ghostwork 主要适用于 macOS 系统上,适用于开发者、设计师等对工作效率有高要求的用户,通过自动化工作流来提高日常操作的效率。

综合评价

优点:

  • 本地计算与存储:保护用户隐私,避免数据泄露风险。
  • 用户体验优异:强大的图形界面与 CLI 结合,用户可直观操作复杂的任务。
  • 高效的数据处理和检索:通过内嵌的 macOS API 实现高效的数据处理。

缺点:

  • 资源消耗:数据暂存和查询过程可能占用较多系统资源。
  • 流程维护:自动化流程的设置和维护需要一定的学习成本。
  • 应用局限性:仅适用于 macOS 平台,限制了广泛的用户群体。

通过以上深入分析,可以看出 ghostwork 作为本地化工具,具备强大的数据处理能力和良好的用户体验设计,它无疑是隐私保护、高效工作所需的一大助力。

关于

GitHub 原始描述(英文)

Free open-source Screenpipe GUI + macOS automation agent. Search your screen history, view analytics, automate workflows — all local, no cloud. Works with the free Screenpipe CLI.

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

简要分析

热度分
129
价值分
67
活跃状态
活跃

语言占比

HTML
TypeScript

贡献者

README

Ghostwork

Discord License: GPL v3

The first agent you don’t prompt.

Ghostwork runs silently in the background, learns how you work from observation alone, and gradually takes repetitive tasks off your hands — without you ever writing a prompt or setting up an integration.


Free Screenpipe GUI

Screenpipe’s desktop app moved to a paid model ($25/month). Ghostwork works with the free Screenpipe CLI and provides a full open-source GUI layer on top:

Feature Ghostwork (free) Screenpipe desktop ($25/mo)
Timeline view ✅ ✅
Natural language search ✅ ✅
App usage analytics ✅ ✅
macOS workflow automation ✅ ❌
Learns from observation ✅ ❌
Runs autonomously ✅ ❌
Local / no cloud ✅ ✅
Open source ✅ GPL-3.0 Source-available

Ghostwork does everything the paid Screenpipe GUI does, plus it automates the workflows it discovers — for free.


What it does

Ghostwork watches every interaction across every app on your Mac (via Screenpipe), builds a rich memory of your work patterns, and surfaces automations the moment they’re relevant.

Memory layers

Layer What’s stored How it’s built
L1 Working Current screen context (app, URL, OCR) Live, polled every 10 s
L2 Episodic Raw interactions: clicks, keys, navigations, app switches Ingested every 2 min from Screenpipe’s input stream
L3 Semantic Workflows and rules: “WHEN on LinkedIn search → DO export to CRM” Promoted nightly from episodic memory via LLM
L4 Procedural Executable skills with step-by-step DOM/AX locators Promoted nightly from stable semantic rules

Nightly consolidation (sleep cycle)

Every night Ghostwork runs a 3-phase consolidation:

  1. NREM — LLM analyses unsummarised sessions and promotes patterns to rules
  2. REM — Rules with 3+ observations that have browser-recorded events are compiled into executable skills
  3. GC — Power-law confidence decay, dedup, 90-day prune of raw events, behaviour.md rewrite

The living behaviour.md profile is injected into every LLM prompt, so the trigger decision has full context about who you are and what you do.


Autonomy tiers

Ghostwork earns autonomy, never assumes it:

Tier Triggered when Behaviour
Supervised Default for all new rules Executes immediately, shows HUD notification, Cmd+Z available
Autonomous ≥5 accepts and <2 rejections in last 10 Runs silently; logged to Activity feed

Actions that are externally visible (send email, submit form, post) always require one-tap approval regardless of tier.


Execution stack

  1. Compiled skill replay — zero-token deterministic replay of recorded step sequences
  2. AX-first native control — ax_list_elements + ax_click_element via macOS Accessibility API; ~95% accuracy on native apps
  3. Claude vision fallback — pixel-level screenshots + function calling for browsers and AX-empty apps

When a multi-step sequence fails mid-way, Ghostwork fires Cmd+Z for each completed reversible step in reverse order before surfacing the error.


UI

  • Menu bar icon — reflects current state: observing / working
  • Activity feed — chronological log of every action taken and approval waiting
  • Timeline tab — drill down into every recorded session; save any session as a skill
  • Behaviour tab — learned rules with autonomy progress, category badges, and one-click boost
  • Approvals — staged actions waiting for your confirmation before executing externally visible steps

Setup

Prerequisites

  • macOS 12+
  • Screenpipe installed and running (screenpipe)
  • Node.js 20+ and npm
  • An OpenRouter API key (or Anthropic key)

Install

git clone https://github.com/your-org/ghostwork
cd ghostwork
npm install
npx @electron/rebuild -f -w better-sqlite3

Configure

cp .env.example .env

Edit .env:

OPENROUTER_API_KEY=sk-or-...
ANTHROPIC_API_KEY=sk-ant-...   # optional, used for native computer use

Run

npm start          # development (hot reload)
npm run build      # production build
npm run dist       # package as .dmg

Architecture

Screenpipe ──► sessionIngester (2min) ──► raw_events ──► extractor (30min) ──► rules
                                                                                   │
                                                                          NREM/REM nightly
                                                                                   │
                                                                              compiled skills
                                                                                   │
                              actionEngine (10s) ──► LLM trigger ──► AX-first executor
                                                                    └──► vision fallback

Key files:

File Responsibility
sessionIngester.ts 2 min poll → raw_events + per-event prediction scoring
extractor.ts 30 min batch → 7-category structured rule extraction
consolidation.ts Nightly NREM (sessions→rules) + REM (rules→skills) + GC
actionEngine.ts 10 s perception loop + LLM trigger decision + dispatch
computerUse.ts AX-first executor + Claude vision fallback
axDriver.ts macOS accessibility tree (AXUIElement via AppleScript)
skillEngine.ts Browser skill replay with multi-step rollback
approvals.ts Shadow-mode approval queue for externally visible actions
db.ts GhostWork SQLite: rules, episodes, skills, approvals, settings

Contributing

See CONTRIBUTING.md for setup instructions and coding guidelines.

Open issues on GitHub — look for good first issue labels. Join the Discord to discuss ideas or get help getting set up.


Privacy

  • All data stays on your device. No cloud sync, no telemetry.
  • Ghostwork excludes itself, Cursor, and any app you add to the exclusion list.
  • Raw events are pruned after 90 days.
  • PII (emails, phone numbers, card numbers) is stripped before any LLM call.
  • The behaviour.md profile never leaves your machine.

Roadmap

  • Full autopilot mode: skill execution without any prompt
  • Cross-session pattern detection in REM phase
  • Browser extension for richer DOM locators in user’s main Chrome profile
  • Windows support (via Screenpipe Windows builds)
  • Team profiles (opt-in, anonymised)

Licence

GPL-3.0 — see LICENSE for details.

评论

暂无评论