Core Concepts

KV Store

A persistent, encrypted key-value store that lives across sessions. Use it for agent coordination, caching scraped data, storing workflow state, or sharing information between agents.

Operations

ToolDescription
kv_setStore a value in a namespace. Supports optional TTL.
kv_getRetrieve a value by key from a namespace.
kv_listList keys in a namespace, with optional prefix filter.
kv_deleteDelete a key from a namespace.
kv_clearDelete all keys in a namespace.

Basic usage

kv store
// Store a value
kv_set(namespace="scrape", key="last-run", value="2025-03-25T10:30:00Z")
// Retrieve it
kv_get(namespace="scrape", key="last-run")
→ "2025-03-25T10:30:00Z"
// List keys with a prefix
kv_list(namespace="scrape", prefix="last-")
→ ["last-run", "last-url", "last-count"]
// Delete a key
kv_delete(namespace="scrape", key="last-run")
// Clear entire namespace
kv_clear(namespace="scrape")

Namespaces

Namespaces organize your data and prevent key collisions. Use descriptive names:

  • "github-issues" — cached issue data from GitHub
  • "deploy-state" — deployment workflow state
  • "agent-coordination" — data shared between multiple agents
  • "scraped-prices" — price monitoring results

Use cases

Caching scraped data

Store results from browser sessions so you don't need to re-scrape. The agent can check the KV store first and only open a browser if the data is stale.

Multi-agent coordination

When running the daemon, multiple agents share the same KV store. One agent can write results that another reads — useful for divide-and-conquer workflows.

Workflow state

Track where a multi-step workflow left off. If the agent crashes mid-workflow, it can read the KV store on restart and pick up where it stopped.

Configuration

Store agent-specific settings that persist across sessions — preferred selectors, API rate limits, or feature flags.

CLI access

The KV store is also accessible from the command line:

terminal
pagerunner kv-set --namespace scrape --key last-run --value "2025-03-25"
pagerunner kv-get --namespace scrape --key last-run
pagerunner kv-list --namespace scrape
pagerunner kv-delete --namespace scrape --key last-run
pagerunner kv-clear --namespace scrape

Storage

All KV data is stored in pagerunner's encrypted SQLite database. The encryption key lives in the macOS Keychain — values never touch the filesystem in plaintext.

Next: Secrets →