How is engagement state and knowledge kept across a long run?
Memory stores, knowledge graphs, databases or files for hosts, services, credentials and findings; summarisation or compaction of long sessions; resuming an engagement.
Verdict
Nebula and Strix recover most completely from a crash mid-engagement. PentAGI keeps the fullest audit trail plus searchable memory, and RedAmon has the richest attack graph.
Database or checkpoint resume. Nebula stores every run, tool call, approval and finding in SQL and checkpoints missions to SQLite before each step. A routing journal replays the model’s last decision after a crash, so a tool call is not repeated. Strix keeps each agent’s conversation in an SDK SQLite session and snapshots the agent tree to agents.json. A resume respawns children, and LLM compaction summarises old turns near the context limit. PentAGI logs flows, message chains, tool calls and terminal output to PostgreSQL and reloads flows on restart. Tool results are anonymised, chunked and embedded in pgvector, with an optional Graphiti knowledge graph. PentestGPT keeps runs, tasks, attempts and observations in SQLite and gives each role a bounded projection. Provider sessions always start fresh, and --resume requires an identical configuration hash.
Files and checkpoints on disk. Shannon git-commits each agent’s deliverable, and resume reruns only incomplete agents from session.json. RAPTOR keeps a ledger and per-artifact chain-state.json, so an interrupted chain restarts at its first unsettled stage. Decepticon uses the workspace as its shared store (objective DAG, findings, a locked events.jsonl), with Neo4j optional for some roles. CyberStrike puts sessions, captured requests, intel and findings in one SQLite file and prunes old tool output when context fills.
Graph-centred. RedAmon checkpoints agent state to Postgres by default, falling back to memory without a database. It writes each attack chain to Neo4j, and a new session loads prior chains for the project.
Thin or volatile. Pentest Swarm AI always uses an in-memory blackboard; its Postgres board has no caller, so a campaign cannot resume. Cross-campaign memory is a JSON file capped at 5,000 patterns. PentestAgent persists only notes.json, put back into prompts truncated to 200 characters; conversation and plan reset on each run. HexStrike AI keeps everything in process memory.
Pick: Nebula or Strix for long runs that must survive restarts. Pick: PentAGI when you want every command and output in a queryable database. Pick: RedAmon when the attack-surface graph is the main working surface.
Per-project answers
usestrix/strix
answeredStrix maintains scan state across several coordinated stores:
ReportState — A singleton ReportState (report/state.py:197–956) holds the in-memory vulnerability report list, run record (run name, start/end time, LLM usage, status, targets, config), and callback hooks. It persists to run.json on every state change (via save_run_data()) and writes artifact files (vulnerabilities JSON/CSV/MD, SARIF, coverage, executive report). On resume, hydrate_from_run_dir() (lines 260–331) reloads vulnerabilities and LLM usage from disk.
SDK SQLite sessions — Each agent gets a SQLiteSession stored in agents.db under the run's .state/ directory (core/sessions.py:43–45). These hold the full conversation history (model responses, tool calls, results). Compaction via llm/compaction.py:maybe_compact() (lines 340–401) summarizes old turns when the context window is near capacity, producing a structured checkpoint (finding list, credentials, recon details, work state, failed attempts). It reads LiteLLM's model metadata for window size via context_budget.py, uses the LLM itself for summarization with the _SUMMARY_INSTRUCTIONS prompt (96 lines of dense extraction rules), and replaces old session items with the checkpoint.
AgentCoordinator — The in-memory coordinator (core/agents.py:56–705) tracks the agent graph: parent relationships, statuses (running/waiting/completed/stopped/crashed/failed/budget_paused), mailboxes (inter-agent message queues), recovery counts, wait kinds, and budget state. It snapshots to agents.json via _maybe_snapshot() (lines 684–704), using atomic temporary-file writes. On resume (runner.py:341–383), the snapshot is restored and subagents are respawned via respawn_subagents().
Knowledge tools — Structured knowledge is stored and loaded from .state/: coverage entries (hydrate_coverage_from_disk), notes, threat models, todos. These are restored on resume so accumulated context survives.
Resume mechanism — run_strix_scan() (runner.py:290–731) detects a prior run by the existence of agents.json. It restores the coordinator snapshot, reopens each agent's SQLite session, respawns child agents in their prior state, and replays conversation from the SDK session database. A new --instruction on resume is injected as a fresh user message. Budget flags are recomputed from actual spend to avoid double-counting.
KeygraphHQ/shannon
answeredEngagement state is persisted through a file-based audit and checkpoint system, not an in-memory knowledge graph or database.
Run Directory Structure: Each scan writes to a workspace directory (workspaces/{hostname}_{sessionId}/). The top level holds the customer-facing report (PDF and Markdown); all internals — checkpoints, logs, prompts, agent deliverables, session.json, browser artifacts — live under a hidden .shannon/ subdirectory (apps/worker/src/audit/utils.ts:52-54).
Session State: session.json records the canonical workflow state including completed agents, expected agents, participating classes, report progress (stage, partial reasons, model checkpoint), and the miscellaneous exploitation outcome (apps/worker/src/audit/utils.ts:59-62). This is the file resume reads to determine which agents to skip.
Workflow Logger (apps/worker/src/audit/workflow-logger.ts): A combined workflow.log provides human-readable per-workflow logs backed by LogStream (apps/worker/src/audit/log-stream.ts). Every combined-log line is also projected into per-agent files under .shannon/agents/<slug>.log via actor-projection.ts. Capella stages get their own per-stage trace queues drained before the activity returns.
Git Checkpoints: After each agent completes successfully, its deliverable is git-committed to a deliverables repo within the workspace. On resume, the workflow restores the git checkpoint, removes incomplete agent deliverables, and only re-routes missing agents (apps/worker/src/temporal/workflows.ts:1318-1342). Rollback is handled by rollbackGitWorkspace in apps/worker/src/services/agent-execution.ts:410-415.
Reconciliation Artifact Store (apps/worker/src/ai/reconciliation/artifact-store.ts): A file-based store for reconciliation observations and tasks, referenced by opaque artifact refs passed between reconciliation stages. Each stage (prepare, enrich, form, materialize, publish) writes its output as a durable artifact.
No summarization or compaction of long sessions beyond pi's built-in context compaction (compaction: { enabled: true } in apps/worker/src/ai/pi/pi-executor.ts:344), which compresses the transcript when it approaches the context window. There is no knowledge graph, semantic memory store, or cross-session learning. Each task child session accumulates its usage separately; the parent totals its own plus child spend.
vxcontrol/pentagi
answeredEngagement state and knowledge are persisted across three primary stores: PostgreSQL (relational), pgvector (semantic memory), and optionally Graphiti (temporal knowledge graph).
Relational (PostgreSQL). Every action is logged in structured tables: Flow, Task, Subtask with status lifecycle (Created→Running→Waiting→Finished/Failed); Msgchain stores the full LLM conversation chain (messages JSON blob, plus token usage and cost); Toolcall records each tool call with args and result; Termlog captures terminal stdin/stdout/stderr; Agentlog tracks which agent role initiated/executed what. All models are in pkg/database/models.go. The status propagation chain flows upwards: subtask → task → flow (pkg/controller/subtask.go:216-231).
Semantic (pgvector). Tool results from terminal, file, search, and agent tools are automatically stored into the pgvector store via storeToolResult() (pkg/tools/executor.go:597-683). Results are split into chunks (2000-char recursive character splitter, lines 610-618), anonymized using a pattern-based replacer (IPs, domains, credentials), and embedded with the configured Embedder. Agents retrieve past findings through search_in_memory (memory tool), search_guide, search_answer, and search_code tools. Retrieval is by similarity search (cosine, threshold 0.2, limit 3, pkg/tools/memory.go:24-26).
Knowledge graph (Graphiti, optional). Agent responses and tool executions are optionally logged to a Graphiti temporal knowledge graph server over HTTP (pkg/graphiti/). Agent responses are stored via storeAgentResponseToGraphiti() (pkg/providers/performer.go:1011-1089) and tool executions via storeToolExecutionToGraphiti() starting at line 1092. Agents can query Graphiti using the graphiti_search tool with 7 search types (temporal window, entity relationships, diverse results, episode context, successful tools, etc.) — see registry.go:347-357.
Summarization and compaction. The performer chain loop calls compactChainForWindow() (performer.go:139-148) and SummarizeChain() (line 258) to compact long message chains when they exceed context windows. The summarizer is role-specific, driven by pkg/csum/ package.
Resumability. Flows can be loaded from the database on restart via LoadFlowWorker() (pkg/controller/flow.go:339-526), which restores tasks, subtasks, message chains, containers, and assistant workers.
GreyDGL/PentestGPT
answeredAll canonical state lives in SQLite, managed by MemoryKernel (memory.py:140). The database stores five tables: runs (goal, status, revision, allowed_targets), tasks (id, kind, target, objective, done_when, basis_ids, depends_on, status), attempts (id, task_id, status, revision, trace_episode_id, summary, failure_kind/message), observations (exact evidence quote with full identity provenance), and transitions (append-only revision log with kind, detail, and timestamp). WAL mode with synchronous=FULL ensures durability without concurrency overhead. There is no knowledge graph, vector store, or RAG layer. Each RunSnapshot (memory.py:46-57) is a full materialized view projected from the SQLite state on every read. The Supervisor receives a bounded projection of this state — not the full history — limited to open tasks, four recent closed tasks, required dependency/basis context, the six most recent observations, and four recent diagnostic attempts (agents.py:360-471). The Executor receives only its one task, its explicit basis (up to 8 observations), up to two same-task prior observations, and one retry diagnostic. Provider conversation history is not preserved between episodes — every episode uses resume = null. The TraceStore (trace.py:65) persists diagnostic episode traces as filesystem journals (input.json, events.jsonl, output.json per episode) but traces are not memory — they are diagnostic only. For resumption, the trial stores an identity hash (trial-config.json) of the full configuration; --resume requires an exact match including goal, targets, provider, model, effort, prompt/schema hashes, sandbox policy, and unified-agent version (trial.py:147-152). The legacy client (pentestgpt_legacy/) stores conversation history in an in-memory dictionary per model role (pentest_gpt.py:72-99) and saves transcripts to files on exit.
0x4m4/hexstrike-ai
answeredState management is purely in-memory with no persistence across server restarts or long-run compaction. The server initialises several global singleton instances at module level: cache = HexStrikeCache() (line 6734) is an OrderedDict-backed LRU cache with TTL that stores command execution results keyed by MD5 hash — it resets on server restart. telemetry = TelemetryCollector() (line 6781) tracks cumulative command counts and success rates in a simple in-memory dict. ProcessManager (line 5576) and ProcessPool (line 4877) keep dicts of active PIDs with progress info, all volatile. The CTFChallengeAutomator has active_challenges, solution_cache, and learning_database (line 3858) — all plain dicts. The CVEIntelligenceManager has cve_cache and vulnerability_db (line 5754) — also in-memory dicts with no database backend. There is no SQLite, no filesystem persistence for session state, no knowledge graph, and no mechanism to resume an interrupted engagement. The AdvancedCache (line 5085) has a background cleanup thread for expired entries but does not survive a restart. Long-running commands are tracked by PID with progress bars and ETA estimates cycled through the spinner animation, but the process state is lost if the server dies. Summarisation or compaction of long sessions does not exist — the system has no concept of a session lifecycle.
BitterSecurity/Decepticon
answeredMultiple coordinated persistence mechanisms. Engagement state is kept across turns through four complementary stores, each with a different purpose and lifetime.
1. OPPLAN (the tactical plan). The Operations Plan is a DAG of objectives persisted at /workspace/plan/opplan.json in the engagement filesystem. OPPLANMiddleware (middleware/opplan.py, lines 1–58) injects objective status into every LLM call (battle tracker), supports versioned DAG commits to prevent parallel mutation, and exposes CRUD tools (commit_opplan, update_objective, list_objectives). Each objective tracks phase, status (pending/in-progress/blocked/completed/cancelled), OPSEC level, notes, blocked_by dependencies, and C2 tier.
2. Event log. Each engagement has an append-only events.jsonl file (runtime/event_log.py, lines 1–80) under <workspace>/events.jsonl. It uses platform-appropriate exclusive file locking (POSIX flock / Windows msvcrt) so concurrent sub-agents do not interleave lines. The EventType enum provides typed event categories. read_events() yields events in order, skipping malformed lines for crash resilience.
3. Knowledge graph (optional Neo4j). KGMiddleware (middleware/kg.py, lines 1–77) attaches Neo4j-backed attack graph state to analyst/operator agents. Tools kg_record(observations) and kg_ingest(scanner_kind, path) let agents write hosts, services, credentials, and findings as typed nodes and edges with provenance. A cached summary block is injected into every system prompt and rebuilt when the graph revision advances. The KG is optional — it degrades gracefully with a single warning when Neo4j env vars are unset (middleware/kg_internal/store.py).
4. Workspace filesystem. The engagement workspace directory (/workspace/<slug>/) is the authoritative shared store, accessible to all sub-agents over the HTTPSandbox HTTP transport (via CompositeBackend). Agents write findings (findings/), recon data (recon/), and evidence (evidence/) as structured markdown and JSON files.
Context compaction. SummarizationMiddleware (slot SUMMARIZATION in middleware_slots.py, lines 445–446) auto-compacts long sessions via deepagents' summarization engine. The _SafeSummarizationProxy (lines 267–443) wraps it with a fallback: summarization failures log a warning and skip the turn rather than aborting the run. Compaction events are emitted to the event log for operator visibility. The RecordingMiddleware/ReplayMiddleware (runtime/recording.py) support full session recording for post-engagement replay.
gadievron/raptor
answeredEngagement state is stored durably on disk in the run output directory, not in RAM or a graph database. The engagement ledger (core/engagement/ledger.py) is a ledger.json document with every artifact row, its content identity, exposure features, policy slots (tier assignments), reservation slots (budget charges), and an append-only policy_amendments trail. Per-artifact chain state is in <output_dir>/chains/<artifact-id>/chain-state.json — an interrupted chain resumes from the first unsettled stage, judged by artifact existence plus recorded state, never wall-clock. The engagement supervisor (core/engagement/supervise.py) persists a engagement-state.json with a code pin (framework source-control SHA + models config hash), segment counter, and budget figures. Parks are recorded durably in engagement-parks.json with a PARKED marker file surfaced by the project status view. The SAGE persistent memory system (core/sage/) provides consensus-validated cross-run persistence across domains like raptor-findings-{repo_key}, raptor-fuzzing, raptor-methodology, raptor-fp-{repo_key} (false positive suppression), raptor-rule-library, and raptor-audit-{repo_key}. SAGE stores are accessed through mechanical hooks (core/sage/hooks.py) that make hard skip/suppress decisions — no prompt injection from recalled text. Rows are MAC-stamped (core/sage/rowmac.py); recall verifies the MAC over decision fields before any mechanical effect, and unverified rows degrade to hints only. Session summarisation is achieved through the phase/pass structure of the supervisor: after each pass, an interim report (engagement-interim-report.md) is written with policy, feasibility, committed spend, per-row status, and park summaries. Compaction of long sessions is handled by the _MAX_PASSES cap and the per-pass boundary checks (drain requests, wall bounds) that pause cleanly rather than accumulating infinite churn.
CyberStrikeus/CyberStrike
answeredSQLite persistence. All engagement state is stored in a local SQLite database (via Drizzle ORM). Key tables include: intel_entry (discovered assets, endpoints, technologies), vulnerability (findings with severity/status), methodology_phase (phase progress), vrt_check (per-intel-entry test results), chain_candidate (attack chain detections), request (captured HTTP requests), and coverage_note (what was tested by which agent). The database is project-scoped under the .cyberstrike directory.
Intel system (methodology/intel.ts): Each discovered asset/endpoint is logged via add_intel with type, asset, severity, confidence, tags, and chain potential. Entries auto-generate VRT checklists for systematic testing. Dedup prevents duplicate entries. Chains are auto-detected (Chain.detect()) when findings across multiple entries could combine into high-impact exploits (8 patterns: credential+endpoint, info_disclosure+ssrf, redirect+oauth, idor+data_leak, xss+csrf, ssti+rce, race_condition+business, custom).
Session compaction (session/compaction.ts): When total tokens approach the model's context limit (minus a 20K token buffer), the system prunes old tool call outputs, keeping only the last ~40K tokens of tool interactions. Compaction preserves the task structure (subtask parts) while stripping verbose command output.
Memory system (memory/index.ts): File-based long-term memory stored in .cyberstrike/memory/MEMORY.md with daily notes in .cyberstrike/memory/<date>.md. Supports append-to-long-term, append-to-daily, search, and getSessionContext (which returns yesterday's + today's notes + long-term memory). Memory tools are exposed to agents via MemorySearchTool, MemoryWriteTool, MemoryReadTool, and MemoryContextTool.
Session chaining. Child sessions are created for subagent task execution (Session.create({parentID})), allowing recursive decomposition of work while maintaining the audit trail.
samugit83/redamon
answeredAgentState in LangGraph is the primary memory store (state.py:978): a TypedDict holding messages, execution trace, todo list, objectives, target info, chain findings memory, chain failures memory, chain decisions memory, chain waves memory, LATS tree state, QA history, phase history, fireteam plans, and token accounting. All this lives inside LangGraph's MemorySaver checkpointer by default (in-memory), replaced with AsyncPostgresSaver (orchestrator.py:160-196) when PERSISTENT_CHECKPOINTER=true, persisting the full state to Postgres via psycopg_pool. The thread_id is user_id:project_id:session_id (config.py:55), enabling session resume.
Neo4j graph persistence. The chain_graph_writer.py module writes the attack chain to Neo4j as fire-and-forget operations on a dedicated writer thread: AttackChain nodes (per session), ChainStep nodes (one per iteration), ChainFinding/ChainFailure/ChainDecision nodes, all linked by NEXT_STEP/HAS_PARENT relationships. This provides a durable, queryable attack graph separate from the agent's in-memory state. The fire_create_attack_chain() and fire_record_*() functions are called from initialization, tool confirmation, approval, and completion nodes.
Chain memory stores (chain_findings_memory, chain_failures_memory, chain_decisions_memory, chain_waves_memory) are accumulated lists on AgentState that survive across objectives (cleared only on session reset). chain_decisions_memory tracks phase transitions and operator decisions. chain_waves_memory tracks completed fireteam waves even when they produce zero findings (for coverage awareness).
Execution trace summarization. format_chain_context() (state.py:1694) renders the attack chain for the LLM prompt, grouping tool calls by iteration. summarize_trace_for_response() (state.py:1529) truncates to the last N steps for API responses. A cap of EXECUTION_TRACE_MEMORY_STEPS (default 100) prevents unbounded growth. LATS tree summaries are carried into execution_trace via _carry_tree_forward() (lats.py:1650-1672), and a persistent digest (_lats_tree_digest, _lats_leads, _lats_dead) survives execution trace eviction.
Resumption. Sessions resume by recovering the persisted state from Postgres via graph.aget_state(config) in the various resume_*_with_streaming() methods (orchestrator.py:1183-1401). The last checkpoint's state is loaded, the user's response injected, and graph.astream() continues from where it paused.
Prior chain context. On first invocation of a new session, initialize_node (initialize_node.py:518-534) queries Neo4j for prior chains from the same project (with a 15-second timeout), rendering them as _prior_chain_context in state. This allows the agent to see past attack chain results when starting a new objective.
PERSISTENT_CHECKPOINTER: True in agentic/project_settings.py L98, and set to "true" in docker-compose.yml); MemorySaver is only the fallback when it is switched off or DATABASE_URL is missing.GH05TCREW/pentestagent
answeredPersistent notes store. The primary persistence mechanism is the notes tool, which writes to loot/notes.json (tools/notes/__init__.py:18-23). Notes survive across sessions and are loaded into the agent system prompt on each turn (truncated to 200 chars per note to save tokens, pa_agent.py:86-88). The full content can be retrieved via the notes tool's read action. An asyncio lock (_notes_lock) ensures safe concurrent access from multiple agents.
Workspace-based state. WorkspaceManager (workspaces/manager.py:66) stores per-workspace YAML at workspaces/{name}/meta.yaml containing targets list, creation timestamp, last active timestamp, operator notes, and tool run history. All operations read/write files directly — no in-memory caching. Loot directories are organized under each workspace (loot/, knowledge/sources/, knowledge/embeddings/, notes/, memory/).
Conversation history summarization. ConversationMemory (llm/memory.py:31) manages token budgets. When the conversation exceeds 60% of the token budget (summarize_threshold=0.6), the oldest messages (beyond recent_to_keep=10) are summarized by the LLM itself into a technical summary that preserves targets, versions, credentials, and attack vectors. Summarization is chunked in groups of 10 messages. The cached summary is prepended as a system message on subsequent turns. Token counting uses tiktoken (cl100k_base) with a fallback to word-count estimation.
ShadowGraph (crew mode only). The ShadowGraph (knowledge/graph.py:46) builds a NetworkX directed graph from notes, extracting entities: hosts (via IP regex), services (port/product/version), credentials (username/password), vulnerabilities (CVE/weaknesses), endpoints, and technologies. It produces strategic insights for the crew orchestrator, including attack paths via nx.shortest_path. The graph is rebuilt each orchestrator cycle from the notes.
MCP-level memory. The MCP server provides store_memory/retrieve_memory/clear_memory tools (mcp/server/mcp_tools.py:838-923) as an in-memory key-value store with timestamps and substring search. This is session-scoped and not persisted to disk.
Conversation store (TUI). When a user forks a conversation from the TUI, ConversationStore (interface/conversation_store.py) saves the full conversation to the workspace directory, enabling retrieval and branching while preserving alternative threads.
No engagement resume mechanism. While notes survive to disk, there is no structured facility to reload agent state (conversation history, plan state, worker pool) from a previous session. Each agent_loop() call resets the plan and conversation history (base_agent.py:264).
Armur-Ai/Pentest-Swarm-AI
answeredState is maintained across three distinct storage systems with different lifetimes.
In-campaign: the blackboard (internal/swarm/blackboard/). The Board interface (board.go:12-54) provides Write, Query, Subscribe, cursor tracking and budget operations. Each Finding (types.go:59-74) carries a PheromoneBase, HalfLifeSec decay, and typed data. Agents subscribe via Predicate (type filter + MinPheromone gate) and receive a channel of matching findings. The board is memory-backed by default (NewMemoryBoard in swarm_runner.go:284), with a Postgres variant selected when a DB pool is available. The scheduler tracks per-agent cursors for exactly-once delivery (board.go:29-34). Pheromone-based decay means stale findings naturally deprioritize without explicit compaction.
Cross-campaign: MemoryStore (internal/memory/store.go:19-26, persist.go:14-69). After a campaign, the engine calls ExtractPatterns and stores learned patterns in a MemoryStore with categories: tech_stack, attack_chain, false_positive, timing. Each entry has Confidence, UsageCount, and LastUsed. On subsequent runs, RecallRelevant matches target keywords against stored patterns (store.go:42-56) and feeds the resulting brief to the recon agent (swarm_runner.go:468-471). The store persists to ~/.pentestswarm/memory.json (capped at 5000 entries, oldest dropped). Duplicates are merged (bump UsageCount, keep higher confidence) rather than appended.
The attack graph (internal/attackgraph/) is built from findings and the campaign objective, with nodes for each vulnerability/host state and edges for exploitability. BuildFromFindings constructs the graph; BestPathToObjective finds the highest-probability chain (agent/report/agent.go:112-140). Edges proven by external oracles are marked "verified" with full certainty.
Resuming engagements: The scheduler's cursor mechanism (board.go:34, scheduler.go:301) means agents resume from their last committed finding ID. An operator can warm-start a swarm by importing a context pack via SeedImported (agents/seed.go:48-100), which writes prior endpoints and findings to the board with standard pheromone so the swarm skips rediscovery. The ctxpack.Load mechanism (swarm_runner.go:459-465) reads a folder of prior pentest reports, tool output, or code.
blackboard.NewMemoryBoard); NewPostgresBoard has no caller, so in-campaign swarm state does not survive a restart.berylliumsec/nebula
answeredEngagement state is persisted across three independent stores.
NebulaStore (storage.py): The primary relational store (SQLAlchemy-backed, PostgreSQL or SQLite) holds all domain entities — AgentRun, Task, ToolCall, Finding, Evidence, Artifact, Engagement, Approval, ChatSession, ContextSnapshot and dozens more. The CLI uses Alembic for schema migrations (cli.py:25). RunStatus tracks lifecycle: QUEUED → PLANNING → RUNNING → WAITING_APPROVAL/PAUSED/INTERRUPTED/CANCELLED/FAILED/COMPLETE (domain.py:391-401).
LangGraph Checkpoints: The mission graph (orchestration.py:511-556) uses AsyncSqliteSaver (orchestration.py:32) with sync durability mode — every superstep is checkpointed before the next node starts. This enables MissionRuntime.recover() (orchestration.py:642-659) to resume any interrupted run from its last committed state. RoutingJournal (orchestration.py:271-316) records the model's routing response before any tool call executes, so a crash+recovery replays the same routing response instead of asking the model again — ensuring idempotent tool execution. Finished runs delete their checkpoints (orchestration.py:675-698).
Context Compaction: ContextCompactor (context.py:1440-1470) creates immutable ContextSnapshot entities for long-running conversations. The WORKING_CONTEXT_CEILING is 200K input tokens (context.py:79). Above this, the compactor uses a model to summarize prior conversation turns and stores the result as a ContextSnapshot with quality metadata and source references. The compactor targets 75% of the window and allows 60% of that for input (context.py:69, 80).
Butler Memory (butler_memory.py:1-48, 166-200): A separate SQLite database (not the main NebulaStore) with an optional Chroma vector index for semantic search. Memory scopes are global_preference, global_lesson, or project_lesson. Items are stored with content, source_label, engagement_id, timestamps, and revisions. The _PREFERENCE and _LESSON_PROCESS regex patterns (butler_memory.py:51-84) guide Butler's automatic judgment of what to save. The search index is rebuildable from the authoritative SQLite records. Butler's memory is explicitly separate from conversation context — it's durable, cross-project, and operator-visible through the Memory panel.
Events and provenance: Every significant state change is recorded as a RunEvent with idempotency keys (orchestration.py:584-611). The ResourceRelation entity (domain.py:89-113) creates provenance edges between resources (evidence "affects" finding, artifact "produced_by" execution) with revision tracking.
Resumption: The resume() entry point (orchestration.py:639-659) accepts an approval response for paused missions or recover() for crashed ones. The NebulaStore supports ConflictError with expected-revision checks to prevent lost updates during recovery.
← How are findings validated and reported? · Which models are supported and how are cost and context managed? →