Skip to content

Agent API_p19

grisun0 edited this page Oct 16, 2026 · 19 revisions

API (page 19 of 23)

Previous: API_p18.md

skills/hive_mind.py

Depends on: core/logging.py, modules/logging_config.py, skills/lazyown_groq_agents.py, skills/lazyown_llm.py, skills/lazyown_parquet_db.py Imported by: modules/loop_ai_bridge.py, modules/unified_dashboard.py, skills/lazyown_mcp.py, skills/swan_agent.py, skills/tests/test_hive_mind.py, skills/unified_orchestrator.py

  • IReadableMemory.recall (method) skills/hive_mind.py:149 def recall(self, query, top_k) -- Return top_k items matching query.
  • IWritableMemory.store (method) skills/hive_mind.py:157 def store(self, content) -- Persist content and return an opaque event_id.
  • ICommandRunner.run (method) skills/hive_mind.py:175 def run(self, command, timeout) -- Execute command within timeout seconds and return text output.
  • ICommandRunner.name (method) skills/hive_mind.py:180 def name(self) -- Human-readable identifier for this runner.
  • EpisodicStore.__init__ (method) skills/hive_mind.py:215 def __init__(self, db_path)
  • EpisodicStore.store (method) skills/hive_mind.py:235 def store(self, content, agent_id, role, event_type, meta, session_tag) -- Insert a row into hive_events and return event_id.
  • EpisodicStore.recall (method) skills/hive_mind.py:274 def recall(self, query, top_k, role, event_type) -- Keyword search via FTS5.
  • EpisodicStore.stats (method) skills/hive_mind.py:322 def stats(self) -- Return row counts for status reporting.
  • EpisodicStore.forget (method) skills/hive_mind.py:329 def forget(self, older_than_hours, topic) -- Delete old or topic-matching rows.
  • SemanticStore.__init__ (method) skills/hive_mind.py:358 def __init__(self, chroma_dir, episodic_fallback)
  • SemanticStore.available (method) skills/hive_mind.py:380 def available(self) -- True when ChromaDB is operational.
  • SemanticStore.store (method) skills/hive_mind.py:386 def store(self, content, agent_id, role, event_type, meta, session_tag, event_id) -- Add a document to ChromaDB.
  • SemanticStore.recall (method) skills/hive_mind.py:434 def recall(self, query, top_k, where) -- Vector similarity search.
  • SemanticStore.count (method) skills/hive_mind.py:477 def count(self) -- Return number of vectors stored.
  • LongtermStore.store (method) skills/hive_mind.py:515 def store(self, content) -- Parquet store is read-only from here.
  • LongtermStore.recall (method) skills/hive_mind.py:519 def recall(self, query, top_k) -- Keyword search across Parquet knowledge files.
  • build_default_hive_memory (function) skills/hive_mind.py:558 def build_default_hive_memory(db_path) -- Factory that creates HiveMemory with the default three-layer backend.
  • HiveMemory.__init__ (method) skills/hive_mind.py:582 def __init__(self, stores, episodic, semantic, longterm)
  • HiveMemory.store (method) skills/hive_mind.py:596 def store(self, content, agent_id, role, event_type, meta, session_tag) -- Store content in all writable layers.
  • HiveMemory.recall_episodic (method) skills/hive_mind.py:633 def recall_episodic(self, query, top_k, role, event_type) -- Keyword search across hive episodic memory.
  • HiveMemory.recall_semantic (method) skills/hive_mind.py:647 def recall_semantic(self, query, top_k, where) -- Vector similarity search in ChromaDB.
  • HiveMemory.recall_longterm (method) skills/hive_mind.py:660 def recall_longterm(self, query, top_k) -- Keyword search across Parquet knowledge files.
  • HiveMemory.recall (method) skills/hive_mind.py:668 def recall(self, query, top_k) -- Unified recall: semantic (ChromaDB) + episodic (SQLite) + longterm (Parquet).
  • HiveMemory.stats (method) skills/hive_mind.py:694 def stats(self) -- Return combined statistics from all layers.
  • HiveMemory.forget (method) skills/hive_mind.py:704 def forget(self, older_than_hours, topic) -- Prune old or topic-matched entries.
  • HiveBus.__init__ (method) skills/hive_mind.py:736 def __init__(self)
  • HiveBus.publish (method) skills/hive_mind.py:740 def publish(self, msg) -- Deliver msg to recipient mailbox (and to "*" broadcast).
  • HiveBus.receive (method) skills/hive_mind.py:746 def receive(self, agent_id, max_msgs) -- Drain mailbox for agent_id (includes broadcast).
  • HiveBus.ack_broadcast (method) skills/hive_mind.py:754 def ack_broadcast(self, agent_id, msg_id) -- Mark a broadcast message as seen by agent_id (minimal bus — no-op).
  • HiveBus.pending_count (method) skills/hive_mind.py:758 def pending_count(self, agent_id) -- Count messages waiting for agent_id.
  • ConsensusProtocol.__init__ (method) skills/hive_mind.py:943 def __init__(self, risk_assessor)
  • ConsensusProtocol.evaluate (method) skills/hive_mind.py:946 def evaluate(self, role, goal) -- Run the consensus vote for the given (role, goal) pair.
  • DroneAgent.__init__ (method) skills/hive_mind.py:1091 def __init__(self, drone_id, role, goal, backend, memory, bus, max_iterations, api_key, model, runner, on_state_change)
  • DroneAgent.start (method) skills/hive_mind.py:1128 def start(self) -- Spawn the drone thread.
  • DroneAgent.join (method) skills/hive_mind.py:1137 def join(self, timeout) -- Block until the drone thread finishes.
  • QueenBrain.__init__ (method) skills/hive_mind.py:1301 def __init__(self, memory, bus, pool, consensus)
  • QueenBrain.plan (method) skills/hive_mind.py:1313 def plan(self, goal, n_drones) -- Decompose a high-level goal into per-drone task specs.
  • QueenBrain.dispatch (method) skills/hive_mind.py:1332 def dispatch(self, tasks, backend, api_key, max_iterations) -- Spawn one drone per task in parallel.
  • QueenBrain.plan_and_dispatch (method) skills/hive_mind.py:1405 def plan_and_dispatch(self, goal, n_drones, backend, api_key, max_iterations) -- Convenience: plan + dispatch in one call.
  • QueenBrain.collect (method) skills/hive_mind.py:1417 def collect(self, drone_ids, timeout, poll_interval) -- Wait for all drones to finish (up to timeout seconds).
  • QueenBrain.synthesize (method) skills/hive_mind.py:1447 def synthesize(self, drone_ids, original_goal) -- Read hive memory results for these drones and produce a synthesis summary.
  • QueenBrain.read_bus (method) skills/hive_mind.py:1471 def read_bus(self) -- Drain queen's mailbox from drone result messages.
  • DroneStateStore.__init__ (method) skills/hive_mind.py:1513 def __init__(self, db_path)
  • DroneStateStore.upsert (method) skills/hive_mind.py:1523 def upsert(self, state) -- Insert or replace a drone state record.
  • DroneStateStore.load_all (method) skills/hive_mind.py:1553 def load_all(self, limit) -- Load all persisted drone states ordered by most recently updated.
  • DroneStateStore.mark_interrupted (method) skills/hive_mind.py:1588 def mark_interrupted(self) -- Called on daemon startup: any drone that was queued/running when the process died is now in an unknown state.
  • DroneStateStore.load_interrupted (method) skills/hive_mind.py:1609 def load_interrupted(self) -- Return all drones currently in 'interrupted' state.
  • DroneStateStore.delete_older_than (method) skills/hive_mind.py:1643 def delete_older_than(self, days) -- Prune records older than N days.
  • DronePool.__init__ (method) skills/hive_mind.py:1673 def __init__(self, memory, bus, state_store)
  • DronePool.recover_from_store (method) skills/hive_mind.py:1687 def recover_from_store(self) -- Load persisted drone states from a previous run.
  • DronePool.spawn (method) skills/hive_mind.py:1708 def spawn(self, role, goal, backend, api_key, model, max_iterations, runner) -- Create and start a DroneAgent.
  • DronePool.requeue_interrupted (method) skills/hive_mind.py:1741 def requeue_interrupted(self, backend, api_key, max_iterations) -- Re-spawn all drones previously marked 'interrupted'.
  • DronePool.get_state (method) skills/hive_mind.py:1767 def get_state(self, drone_id) -- Return the current state snapshot for a drone, or None if unknown.
  • DronePool.list_all (method) skills/hive_mind.py:1776 def list_all(self, limit) -- Return a sorted list of drone summary dicts (most recent first).
  • DronePool.active_count (method) skills/hive_mind.py:1801 def active_count(self) -- Return number of live drones currently in queued or running state.
  • HiveMind.__init__ (method) skills/hive_mind.py:1818 def __init__(self)
  • HiveMind.spawn (method) skills/hive_mind.py:1829 def spawn(self, goal, role, backend, api_key, max_iterations) -- Spawn a single drone.
  • HiveMind.spawn_hive (method) skills/hive_mind.py:1846 def spawn_hive(self, goal, n_drones, backend, api_key, max_iterations) -- Queen plans and dispatches multiple drones in parallel.
  • HiveMind.status (method) skills/hive_mind.py:1863 def status(self) -- Return hive-wide status dict including historical drones from previous runs.
  • HiveMind.recall (method) skills/hive_mind.py:1878 def recall(self, query, top_k) -- Unified recall from all memory layers.
  • HiveMind.drone_result (method) skills/hive_mind.py:1882 def drone_result(self, drone_id) -- Return result dict for a specific drone.
  • HiveMind.collect_and_synthesize (method) skills/hive_mind.py:1896 def collect_and_synthesize(self, drone_ids, goal) -- Synthesize results from multiple drones.
  • HiveMind.forget (method) skills/hive_mind.py:1900 def forget(self, older_than_hours, topic) -- Prune hive memory.
  • get_hive (function) skills/hive_mind.py:1911 def get_hive() -- Return the process-wide HiveMind singleton, creating it if necessary.
  • mcp_hive_spawn (function) skills/hive_mind.py:1926 def mcp_hive_spawn(goal, role, n_drones, backend, max_iterations, api_key) -- Spawn one or more hive drones for a goal.
  • mcp_hive_status (function) skills/hive_mind.py:1976 def mcp_hive_status() -- Return full hive status: active drones, memory stats, queen mailbox.
  • mcp_hive_recall (function) skills/hive_mind.py:1981 def mcp_hive_recall(query, top_k) -- Semantic + episodic + longterm recall from hive memory.
  • mcp_hive_plan (function) skills/hive_mind.py:1995 def mcp_hive_plan(goal, n_drones) -- Queen generates task decomposition without spawning drones.
  • mcp_hive_result (function) skills/hive_mind.py:2004 def mcp_hive_result(drone_id) -- Get result from a specific drone.
  • mcp_hive_collect (function) skills/hive_mind.py:2010 def mcp_hive_collect(drone_ids_csv, goal) -- Wait for drones to finish and return synthesized result. drone_ids_csv: comma-separated drone IDs.
  • mcp_hive_forget (function) skills/hive_mind.py:2021 def mcp_hive_forget(older_than_hours, topic) -- Prune hive memory.
  • mcp_hive_recover (function) skills/hive_mind.py:2027 def mcp_hive_recover(backend, api_key, max_iterations) -- Re-queue all drones that were interrupted by a previous process crash/restart.

skills/lazyown_automapper.py

Depends on: core/logging.py Imported by: skills/lazyown_mcp.py

skills/lazyown_campaign.py

Depends on: core/logging.py, modules/lesson_ingestor.py, modules/logging_config.py Imported by: skills/lazyown_mcp.py

skills/lazyown_claudemd.py

Imported by: skills/lazyown_mcp.py, skills/tests/test_harness_e2e.py

skills/lazyown_context.py

Imported by: skills/lazyown_mcp.py, skills/lazyown_session.py, skills/tests/test_harness_e2e.py

  • CompactionResult.summary (method) skills/lazyown_context.py:57 def summary(self)
  • ContextCompactor.__init__ (method) skills/lazyown_context.py:72 def __init__(self, budget_override, snip_threshold, collapse_threshold)
  • ContextCompactor.apply_budget (method) skills/lazyown_context.py:84 def apply_budget(self, content, tool_name) -- Hard-cap output.
  • ContextCompactor.snip (method) skills/lazyown_context.py:99 def snip(self, content) -- Remove duplicate consecutive lines (log noise).
  • ContextCompactor.microcompact (method) skills/lazyown_context.py:120 def microcompact(self, content) -- Strip known low-signal patterns.
  • ContextCompactor.collapse (method) skills/lazyown_context.py:136 def collapse(self, content, tool_name) -- Replace repetitive sections with a structural summary.
  • ContextCompactor.auto_compact_session (method) skills/lazyown_context.py:159 def auto_compact_session(entries) -- Template-based session summary when full pipeline is insufficient. entries: list of {"type": str, "data": dict} from...
  • ContextCompactor.compact (method) skills/lazyown_context.py:203 def compact(self, content, tool_name) -- Apply all applicable layers in order.
  • compact_output (function) skills/lazyown_context.py:237 def compact_output(content, tool_name) -- Convenience wrapper: compact and return string.

skills/lazyown_daemon.py

Depends on: core/logging.py, modules/event_engine.py, modules/logging_config.py, modules/session_state.py, modules/timeline_narrator.py, skills/sessions_watcher.py

skills/lazyown_facts.py

Depends on: core/logging.py, modules/logging_config.py Imported by: cli/commands/mcp_bridge.py, lazyc2.py, skills/lazyown_groq_agents.py, skills/lazyown_llm.py, skills/lazyown_mcp.py, skills/sessions_watcher.py, skills/tests/test_facts.py

skills/lazyown_groq_agents.py

Depends on: modules/atomic_enricher.py, modules/lazyown_bridge.py, modules/reactive_engine.py, modules/session_rag.py, modules/session_reader.py, modules/threat_model.py, skills/lazyown_facts.py, skills/lazyown_llm.py, skills/lazyown_mcp.py, skills/lazyown_objective.py, skills/lazyown_parquet_db.py Imported by: skills/hive_mind.py, skills/lazyown_mcp.py, skills/swan_agent.py, tests/test_bridge_catalog_filtered.py

skills/lazyown_hooks.py

Depends on: cli/commands/enum.py Imported by: skills/lazyown_mcp.py, skills/tests/test_harness_e2e.py

skills/lazyown_llm.py

Depends on: core/logging.py, modules/logging_config.py, skills/lazyown_facts.py, skills/lazyown_mcp.py, skills/lazyown_objective.py Imported by: skills/autonomous_daemon.py, skills/hive_mind.py, skills/lazyown_groq_agents.py, skills/lazyown_mcp.py

skills/lazyown_mcp.py

Depends on: cli/command_chain.py, cli/graph_advisor.py, cli/palette.py, cli/palette_command.py, cli/recommendation.py, cli/recommendation_signals.py, core/config.py, core/hardening.py, core/llm_budget.py, core/logging.py, core/payload_schema.py, modules/__init__.py, modules/ai_exploit_chain.py, modules/atomic_enricher.py, modules/atomic_exploit_bridge.py, modules/atomic_resolver.py, modules/auto_pivot.py, modules/auto_registry.py, modules/autonomous_exploit_engine.py, modules/backdoor/server.c, modules/chain_registry.py, modules/collab_bp.py, modules/cve_matcher.py, modules/dashboard_engine.py, modules/db.py, modules/evasion_engine.py, modules/event_bus.py, modules/event_engine.py, modules/evidence.py, modules/exploit_recommender.py, modules/exploitgym_gym.py, modules/goals.py, modules/integrations/misp_export.py, modules/intelligence_engine.py, modules/intercept.py, modules/killchain.py, modules/lazy_bridge.py, modules/lazy_engine.py, modules/lazy_loop.py, modules/lazy_mentions.py, modules/lazyown_bridge.py, modules/llm_client.py, modules/llm_evaluator.py, modules/llm_pool.py, modules/mcp_agent_bridge.py, modules/memory_store.py, modules/metrics.py, modules/module_registry.py, modules/obs_parser.py, modules/pipeline_engine.py, modules/planner.py, modules/playbook_engine.py, modules/reactive_engine.py, modules/recommender.py, modules/session_rag.py, modules/session_reader.py, modules/session_state.py, modules/threat_model.py, modules/timeline_narrator.py, modules/traffic_recorder.py, modules/ttpscope_bridge.py, modules/unified_dashboard.py, modules/world_model.py, scripts/lazy_opencode_config.py, skills/aci_planner.py, skills/autonomous_daemon.py, skills/autonomous_replay.py, skills/daemon_control.py, skills/hive_mind.py, skills/lazyown_automapper.py, skills/lazyown_campaign.py, skills/lazyown_claudemd.py, skills/lazyown_context.py, skills/lazyown_facts.py, skills/lazyown_groq_agents.py, skills/lazyown_hooks.py, skills/lazyown_llm.py, skills/lazyown_mcp_helpers.py, skills/lazyown_objective.py, skills/lazyown_parquet_db.py, skills/lazyown_permissions.py, skills/lazyown_policy.py, skills/lazyown_session.py, skills/mcp_lazy.py, skills/swan_agent.py Imported by: skills/autonomous_daemon.py, skills/lazyown_groq_agents.py, skills/lazyown_llm.py, skills/lazyown_mcp_opencode.py, skills/tests/test_mcp_smoke.py, tests/test_boyscout_contracts.py, tests/test_mcp_improvements.py, tests/test_rea_mcp.py

skills/lazyown_mcp_helpers.py

Imported by: modules/c2_surfaces.py, skills/autonomous_daemon.py, skills/lazyown_mcp.py, tests/test_mcp_improvements.py

skills/lazyown_mcp_opencode.py

Depends on: modules/backdoor/server.c, skills/lazyown_mcp.py

skills/lazyown_objective.py

Imported by: skills/autonomous_daemon.py, skills/lazyown_groq_agents.py, skills/lazyown_llm.py, skills/lazyown_mcp.py, skills/sessions_watcher.py, skills/tests/test_objectives.py, tests/test_daemon_loop.py

skills/lazyown_parquet_db.py

Depends on: core/logging.py, modules/atomic_enricher.py, skills/lazyown_policy.py Imported by: cli/commands/mcp_bridge.py, modules/ttpscope_bridge.py, skills/hive_mind.py, skills/lazyown_groq_agents.py, skills/lazyown_mcp.py, skills/tests/test_parquet_db.py, skills/update_knowledge.py, tests/test_core_modules.py

skills/lazyown_permissions.py

Depends on: cli/commands/enum.py Imported by: skills/lazyown_mcp.py, skills/tests/test_harness_e2e.py

skills/lazyown_policy.py

Depends on: cli/commands/enum.py, core/logging.py, modules/detection_oracle.py, modules/logging_config.py Imported by: cli/recommendation_signals.py, modules/unified_dashboard.py, skills/autonomous_daemon.py, skills/lazyown_mcp.py, skills/lazyown_parquet_db.py, skills/swan_agent.py, tests/test_engage_orchestrator.py, tests/test_moe_rl_swan.py, tests/test_scope_bound_auto_gate.py

skills/lazyown_session.py

Depends on: skills/lazyown_context.py Imported by: skills/lazyown_mcp.py, skills/tests/test_harness_e2e.py

skills/mcp_generated_tools.py

  • get_generated_tool_definitions (function) skills/mcp_generated_tools.py:659 def get_generated_tool_definitions() -- Return list[types.Tool] entries for all generated tools.
  • register_all_generated_handlers (function) skills/mcp_generated_tools.py:684 def register_all_generated_handlers(register_handler_fn, make_text_fn, run_lazyown_cmd_fn) -- Register every generated handler via register_handler_fn.

skills/mcp_lazy.py

Imported by: skills/lazyown_mcp.py, tests/test_mcp_lazy.py

  • ensure_optional (function) skills/mcp_lazy.py:18 def ensure_optional(namespace, flag, loader) -- Return the cached flag or run loader once to compute it.

skills/mcp_tool_generator.py

skills/sessions_watcher.py

Depends on: core/logging.py, modules/event_engine.py, modules/logging_config.py, skills/lazyown_facts.py, skills/lazyown_objective.py Imported by: skills/lazyown_daemon.py

skills/setup.sh

skills/swan_agent.py

Depends on: core/logging.py, modules/detection_oracle.py, modules/logging_config.py, modules/moe_router.py, modules/rl_trainer.py, skills/hive_mind.py, skills/lazyown_groq_agents.py, skills/lazyown_policy.py Imported by: modules/loop_ai_bridge.py, skills/autonomous_daemon.py, skills/lazyown_mcp.py, skills/unified_orchestrator.py, tests/test_moe_rl_swan.py

  • SwanResult.is_success (method) skills/swan_agent.py:167 def is_success(self)
  • IResultAggregator.aggregate (method) skills/swan_agent.py:209 def aggregate(self, task_type, goal, votes) -- Return (synthesis_text, consensus_confidence).
  • ISwanOrchestrator.run (method) skills/swan_agent.py:226 def run(self, task_type, goal, engagement_phase, timeout) -- Execute with the best single expert and return result.
  • ISwanOrchestrator.ensemble_run (method) skills/swan_agent.py:236 def ensemble_run(self, task_type, goal, n_experts, engagement_phase, timeout) -- Execute with top-N experts in parallel and synthesize results.
  • WeightedTextAggregator.aggregate (method) skills/swan_agent.py:264 def aggregate(self, task_type, goal, votes)
  • ExpertExecutor.execute (method) skills/swan_agent.py:351 def execute(self, expert_id, backend, model, goal, task_type, timeout, api_key) -- Run the expert and return a SwanResult.
  • OutcomeEvaluator.evaluate (method) skills/swan_agent.py:479 def evaluate(self, result, task_type) -- Return (reward, detection_prob).
  • SwanOrchestrator.__init__ (method) skills/swan_agent.py:572 def __init__(self, executor, evaluator, aggregator, api_key)
  • SwanOrchestrator.run (method) skills/swan_agent.py:592 def run(self, task_type, goal, engagement_phase, timeout) -- Execute the task with the best single expert selected by the MoE+RL router.
  • SwanOrchestrator.ensemble_run (method) skills/swan_agent.py:680 def ensemble_run(self, task_type, goal, n_experts, engagement_phase, timeout) -- Execute with top-N experts in parallel and synthesize results.
  • SwanOrchestrator.status (method) skills/swan_agent.py:763 def status(self) -- Return a diagnostic snapshot of the SWAN system.
  • mcp_swan_run (function) skills/swan_agent.py:945 def mcp_swan_run(task_type, goal, phase) -- Route and execute a task with the best MoE+RL-selected expert.
  • mcp_swan_ensemble (function) skills/swan_agent.py:968 def mcp_swan_ensemble(task_type, goal, n_experts, phase) -- Run top-N experts in parallel and return a synthesized result.
  • mcp_swan_status (function) skills/swan_agent.py:996 def mcp_swan_status() -- Return SWAN system status: expert weights, RL epsilon, performance.
  • mcp_swan_route (function) skills/swan_agent.py:1003 def mcp_swan_route(task_type, goal) -- Show which expert would be selected for a task without executing.
  • get_swan (function) skills/swan_agent.py:1039 def get_swan(api_key) -- Return (or create) the module-level singleton SwanOrchestrator.

skills/toposwarm_autonomous.py

Depends on: core/logging.py, modules/logging_config.py, modules/reactive_engine.py, modules/toposwarm_bridge.py

Next: API_p20.md

Start

Wiki

Agent Docs

Recipes

Clone this wiki locally