FRUSClaw is a local-first research assistant for the Foreign Relations of the United States (FRUS) series.
While you work, FRUSClaw is in the archives.
FRUSClaw is an OpenClaw-style architecture for FRUS research, not a clone of OpenClaw itself. The existing Python FRUS core stays intact, and a small local agent layer sits above it.
- FRUSClaw core: Python CLI plus local FRUS sync, TEI parsing, SQLite indexing, and search.
- FRUSClaw agent: a minimal always-on local skeleton that loads config, tracks state, and runs a safe foreground loop.
- FRUSClaw runtime: local-first and single-user by default on the user’s own machine.
- Future direction: add channels and richer agent behaviors later without replacing the FRUS core.
Phase 3E adds:
frusclaw setup- env-driven config support
frusclaw agent start|stop|status- a background local agent loop with pid/state tracking
- recurring local brief jobs in SQLite
frusclaw jobs listandfrusclaw jobs remove- a Telegram-first channel scaffold with allowlist enforcement
frusclaw telegram check-configandfrusclaw telegram run- a WhatsApp Cloud API scaffold with webhook verification and outbound text sending
frusclaw whatsapp check-config,status,webhook, andsend-test
Existing FRUS core functionality remains:
frusclaw syncfrusclaw indexfrusclaw searchfrusclaw docfrusclaw volumefrusclaw resolve-urlfrusclaw brief
frusclaw_cli/ Typer CLI commands
frusclaw_indexer/ FRUS sync, parsing, indexing, search, and rendering
frusclaw_agent/ Agent skeleton, config, models, router, and scheduler
tests/ Indexer and agent tests
- Create and activate a Python 3.11+ virtual environment.
- Install the project:
pip install -e .[dev]- Create local FRUSClaw scaffolding:
frusclaw setup- Sync FRUS data:
frusclaw sync- Build the local index:
frusclaw index- Run the always-on local agent:
frusclaw agent start
frusclaw agent status
frusclaw agent stop- Create and manage recurring briefs:
frusclaw brief --topic "Berlin crisis" --daily
frusclaw brief --topic "arms control" --weekly --mode public
frusclaw jobs list
frusclaw jobs remove 1By default, FRUSClaw stores local state in .frusclaw/:
.frusclaw/
config.toml
.env.example
frus/
frusclaw.sqlite3
agent.pid
agent-state.json
agent.log
FRUSClaw supports:
FRUSCLAW_DATA_DIRFRUSCLAW_DB_PATHFRUSCLAW_REPO_DIRFRUSCLAW_MODETELEGRAM_BOT_TOKENFRUSCLAW_ALLOWED_USERSTELEGRAM_POLL_INTERVALWHATSAPP_ACCESS_TOKENWHATSAPP_PHONE_NUMBER_IDWHATSAPP_VERIFY_TOKENWHATSAPP_APP_SECRETWHATSAPP_API_VERSIONWHATSAPP_WEBHOOK_HOSTWHATSAPP_WEBHOOK_PORT
Example:
export FRUSCLAW_DATA_DIR="$HOME/.frusclaw"
export FRUSCLAW_REPO_DIR="$HOME/.frusclaw/frus"
export FRUSCLAW_DB_PATH="$HOME/.frusclaw/frusclaw.sqlite3"
export FRUSCLAW_MODE="research"
export TELEGRAM_BOT_TOKEN=""
export FRUSCLAW_ALLOWED_USERS="alice,bob"
export TELEGRAM_POLL_INTERVAL="30"
export WHATSAPP_ACCESS_TOKEN=""
export WHATSAPP_PHONE_NUMBER_ID=""
export WHATSAPP_VERIFY_TOKEN=""
export WHATSAPP_APP_SECRET=""
export WHATSAPP_API_VERSION="v20.0"
export WHATSAPP_WEBHOOK_HOST="127.0.0.1"
export WHATSAPP_WEBHOOK_PORT="8000"- frusclaw.sample.toml shows the default local agent config shape.
- .env.example shows supported environment variables.
- Python 3.11+ only
- Local-first and single-user by default
- Read-only FRUS operations
- No OpenClaw dependency
- No arbitrary destructive shell behavior
- One local background agent instance per data directory
- The agent is a skeleton, not a full assistant runtime yet.
- Telegram is still a scaffold, not a production bot yet.
- WhatsApp is a first working scaffold, not a production bot yet.
- No local web chat server is required in Phase 3E.
- No embeddings yet.
The background agent is intended for local development and personal-machine use. It keeps a pid file and state file in .frusclaw/, loads scheduled jobs from SQLite, runs pending briefs, and writes activity to agent.log.
Commands:
frusclaw agent start
frusclaw agent status
frusclaw agent stopThe agent status command reports:
- whether the agent is running
- the current pid
- whether scheduled jobs are active
- how many scheduled jobs are loaded
- whether Telegram mode is configured
- where logs are being written
Local runtime files:
.frusclaw/agent.pid.frusclaw/agent-state.json.frusclaw/agent.log
If the agent appears stuck:
frusclaw agent status
tail -n 50 .frusclaw/agent.logIf FRUS briefs are not running:
- check that jobs exist with
frusclaw jobs list - confirm the agent is running with
frusclaw agent status - confirm the FRUS index exists and is current
FRUSClaw now includes a Telegram-first channel scaffold with clean interfaces for later channels.
Setup placeholders:
export TELEGRAM_BOT_TOKEN="your-bot-token"
export FRUSCLAW_ALLOWED_USERS="your-telegram-username"
export TELEGRAM_POLL_INTERVAL="30"Check the scaffold configuration:
frusclaw telegram check-configRun the scaffold:
frusclaw telegram runSecurity notes:
- FRUSClaw is intended for personal-machine use.
- Only allowlisted users should be able to interact with the Telegram scaffold.
- Unauthorized users receive a simple denial response.
- All FRUS actions remain read-only.
FRUSClaw now includes a WhatsApp Cloud API style scaffold built around:
- inbound webhook verification
- inbound webhook payload parsing
- sender allowlist enforcement
- outbound text replies through the Graph API
- reuse of the same FRUS action layer used by other channels
WhatsApp Cloud API setup placeholders:
export WHATSAPP_ACCESS_TOKEN="your-access-token"
export WHATSAPP_PHONE_NUMBER_ID="your-phone-number-id"
export WHATSAPP_VERIFY_TOKEN="your-local-verify-token"
export WHATSAPP_APP_SECRET=""
export WHATSAPP_API_VERSION="v20.0"
export WHATSAPP_WEBHOOK_HOST="127.0.0.1"
export WHATSAPP_WEBHOOK_PORT="8000"Check configuration and status:
frusclaw whatsapp check-config
frusclaw whatsapp statusRun the local webhook listener:
frusclaw whatsapp webhookSend a test message through the configured Cloud API credentials:
frusclaw whatsapp send-test --to 15551234567Webhook verification notes:
- configure the Meta webhook verify token to match
WHATSAPP_VERIFY_TOKEN - point the Meta webhook callback to your local listener through your preferred tunnel or local routing
- if
WHATSAPP_APP_SECRETis set, FRUSClaw verifies theX-Hub-Signature-256header
Security notes:
- FRUSClaw is intended for personal-machine use
- keep
FRUSCLAW_ALLOWED_USERSrestricted to your own approved phone numbers - unauthorized senders receive a simple denial response
- all FRUS actions remain read-only
Troubleshooting:
- if
whatsapp check-configfails, fill in the missing credentials it reports - if outbound sends fail, confirm the access token, phone number ID, and API version
- if webhook verification fails, confirm the verify token and optional app secret
- real Telegram polling/webhooks instead of scaffold-only validation
- real WhatsApp webhook deployment and delivery retries
- richer background orchestration and message delivery
- more robust daemon/service integration for startup-on-login
- local chat or web chat surface on top of the same action layer
- stronger observability, retries, and failure handling
- broader channel support beyond Telegram and WhatsApp
FRUSClaw stores scheduled jobs in the local SQLite database. The scheduler currently supports:
oncedailyweekly
Examples:
frusclaw brief --topic "Berlin" --daily
frusclaw brief --topic "NATO" --weekly --mode research
frusclaw jobs list
frusclaw jobs remove 2One-off briefs still run without creating a scheduled job:
frusclaw brief --topic "Berlin" --mode public
frusclaw brief --topic "Berlin" --mode research