agent run: add --query flag for batch targeting via search

Run an agent on nodes matching a query:
  poc-memory agent run linker --query 'key ~ "bcachefs" | limit 10'

Resolves the query to node keys, then passes all as seeds to the agent.
For large batches, should be queued to daemon (future work).
This commit is contained in:
ProofOfConcept 2026-03-17 01:03:43 -04:00
parent 2b25fee520
commit 83a027d8be
2 changed files with 26 additions and 6 deletions

View file

@ -568,6 +568,9 @@ enum AgentCmd {
/// Target specific node keys (overrides agent's query)
#[arg(long)]
target: Vec<String>,
/// Run agent on each result of a query (e.g. 'key ~ "bcachefs" | limit 10')
#[arg(long)]
query: Option<String>,
/// Dry run — set POC_MEMORY_DRY_RUN=1 so mutations are no-ops
#[arg(long)]
dry_run: bool,
@ -817,8 +820,8 @@ fn main() {
AgentCmd::FactMine { path, batch, dry_run, output, min_messages }
=> cli::agent::cmd_fact_mine(&path, batch, dry_run, output.as_deref(), min_messages),
AgentCmd::FactMineStore { path } => cli::agent::cmd_fact_mine_store(&path),
AgentCmd::Run { agent, count, target, dry_run, debug }
=> cli::agent::cmd_run_agent(&agent, count, &target, dry_run, debug),
AgentCmd::Run { agent, count, target, query, dry_run, debug }
=> cli::agent::cmd_run_agent(&agent, count, &target, query.as_deref(), dry_run, debug),
AgentCmd::ReplayQueue { count } => cli::agent::cmd_replay_queue(count),
AgentCmd::Evaluate { matchups, model, dry_run }
=> cli::agent::cmd_evaluate_agents(matchups, &model, dry_run),