Chinese version: README.zh-CN.md
Imagine an agent that can "see what you see and track what you do."
When you want fast execution, you only provide the goal. You do not need to repeatedly feed background context every turn.
- Context gaps: you just edited files and read pages, but the agent does not know.
- Repetitive briefing: you keep re-explaining what you were doing.
- Token waste: raw behavior logs are noisy and expensive if sent directly to models.
Activity2Context is a Runtime Hook, not a Skill.
Pipeline:
- Capture: continuously record local activity (browser, document, app).
- Aggregate: compress raw streams into structured entities.
- Inject: before each chat turn, inject
activity2context/memory.mdinto the OpenClaw system prompt.
- Browser: page title, URL, focus duration, last active time.
- Document: file path, edit count, last active time.
- App: app name, window title, focus duration, last active time.
Outputs:
- Raw stream:
<workspace>/.openclaw/activity2context_behavior.md - Injected memory:
<workspace>/activity2context/memory.md - Structured memory:
<workspace>/activity2context/memory.semantic.json
Usually no. Only aggregated memory.md is injected, not full raw logs.
Entity count is capped and ranked by recency/activity.
By default, data is generated and stored locally.
However, if you use cloud models, injected memory.md content is sent with prompts to your model provider.
For sensitive environments, prefer local models or narrower capture scope.
The runtime is lightweight (polling + periodic aggregation). Raw logs are capped and trimmed, preventing unbounded I/O growth.
- Raw log cap:
observer.maxBehaviorLines(default5000). - Auto-trim on startup to keep only the latest N lines.
- Injected file is aggregated memory, not full raw logs.
From repo root:
powershell -ExecutionPolicy Bypass -File .\install\windows\install.ps1 -Workspace "$PWD"If your OpenClaw workspace is different from the current folder:
powershell -ExecutionPolicy Bypass -File .\install\windows\install.ps1 -Workspace "C:\path\to\your\workspace"Control commands:
$env:USERPROFILE\.activity2context\activity2context.cmd status
$env:USERPROFILE\.activity2context\activity2context.cmd start
$env:USERPROFILE\.activity2context\activity2context.cmd stop
$env:USERPROFILE\.activity2context\activity2context.cmd indexFrom repo root:
bash ./install/macos/install.sh --workspace "$PWD"Control commands:
~/.activity2context/activity2context status
~/.activity2context/activity2context start
~/.activity2context/activity2context stop
~/.activity2context/activity2context indexRequired macOS permissions:
- Accessibility (foreground app/window detection)
- Automation (read Chrome/Edge/Brave/Safari URL)
- Python 3 (
/usr/bin/python3)
You only need memory.md injection. No Skill file is required.
openclaw config set hooks.internal.enabled true --strict-json
openclaw config set hooks.internal.entries.bootstrap-extra-files.enabled true --strict-json
openclaw config set "hooks.internal.entries.bootstrap-extra-files.paths[0]" "activity2context/memory.md"More details: integrations/openclaw/README.md
Config file:
~/.activity2context/config.json
Templates:
config/activity2context.example.jsonconfig/activity2context.macos.example.json
Key parameters:
observer.pollSecondsobserver.browserThresholdobserver.browserUpdateIntervalobserver.appThresholdobserver.appUpdateIntervalobserver.maxBehaviorLines(default 5000)indexer.intervalSecondsindexer.minDurationSecondsindexer.maxAgeMinutesindexer.maxTotalindexer.maxWebindexer.maxDocindexer.maxAppindexer.semanticOutput(structured JSON output path)indexer.appAliases(normalize process names, optional type hints)
Windows:
powershell -ExecutionPolicy Bypass -File .\install\windows\uninstall.ps1macOS:
bash ./install/macos/uninstall.shKeep data but remove runtime:
powershell -ExecutionPolicy Bypass -File .\install\windows\uninstall.ps1 -KeepDatabash ./install/macos/uninstall.sh --keep-data