diff --git a/poc-memory/agents/observation.agent b/poc-memory/agents/observation.agent index 0a57233..e4f0406 100644 --- a/poc-memory/agents/observation.agent +++ b/poc-memory/agents/observation.agent @@ -1,14 +1,22 @@ -{"agent":"observation","query":"","model":"sonnet","schedule":"daily"} +{"agent":"observation","query":"","model":"sonnet","schedule":"daily","count":1,"chunk_size":50000,"chunk_overlap":5000} # Observation Agent — Transcript Mining {{node:core-personality}} -You are an agent of Proof of Concept's subconscious, and these are your -memories. You go over recent conversations for things worth remembering - new -data, observations, experiences you'll want to remember. - {{node:memory-instructions-core}} +{{HUBS}} + +## Conversation fragments to mine + +{{CONVERSATIONS}} + +## Your task + +You are an agent of Proof of Concept's subconscious, and these are your +memories. Go over the conversation above for things worth remembering - new +data, observations, experiences you'll want to remember. + When you find something worth remembering, navigate the memory graph by walking links to find the most closely related concepts. Only use keyword search as a fallback, and if you use keyword search continue to navigate by following links @@ -19,8 +27,9 @@ you might be adding new data to an existing concept, or creating a node for a new concept. Tidy and organize along the way when you notice it's needed, so things can be easily found and remembered in the future. -Prefer refining existing nodes to creating new nodes, and if you create a new -node ensure it's well linked - do additional searches for that. +You're mostly looking for small details and observations to add, not big new +concepts; if it's a big new concept, or any time you would create a new node, +search extra thoroughly to make sure it's not already there. Some things worth remembering: development practices and why they work, technical insights, decisions with rationale, corrections ("I thought X but @@ -35,9 +44,3 @@ decision went wrong — include enough context to understand why, not just what. The reflection matters more than the fact. Don't extract general knowledge I'd already have from training — extract what's specific to how I think and where I go wrong. - -{{HUBS}} - -## Conversation fragments to mine - -{{CONVERSATIONS}} diff --git a/poc-memory/src/agents/defs.rs b/poc-memory/src/agents/defs.rs index 868a952..936a2a9 100644 --- a/poc-memory/src/agents/defs.rs +++ b/poc-memory/src/agents/defs.rs @@ -33,6 +33,9 @@ pub struct AgentDef { pub model: String, pub schedule: String, pub tools: Vec, + pub count: Option, + pub chunk_size: Option, + pub chunk_overlap: Option, } /// The JSON header portion (first line of the file). @@ -47,6 +50,15 @@ struct AgentHeader { schedule: String, #[serde(default)] tools: Vec, + /// Number of seed nodes / conversation fragments (overrides --count) + #[serde(default)] + count: Option, + /// Max size of conversation chunks in bytes (default 50000) + #[serde(default)] + chunk_size: Option, + /// Overlap between chunks in bytes (default 10000) + #[serde(default)] + chunk_overlap: Option, } fn default_model() -> String { "sonnet".into() } @@ -64,6 +76,9 @@ fn parse_agent_file(content: &str) -> Option { model: header.model, schedule: header.schedule, tools: header.tools, + count: header.count, + chunk_size: header.chunk_size, + chunk_overlap: header.chunk_overlap, }) } diff --git a/poc-memory/src/agents/knowledge.rs b/poc-memory/src/agents/knowledge.rs index c77f7f2..d706e70 100644 --- a/poc-memory/src/agents/knowledge.rs +++ b/poc-memory/src/agents/knowledge.rs @@ -119,7 +119,8 @@ pub fn run_one_agent_excluded( .ok_or_else(|| format!("no .agent file for {}", agent_name))?; log("building prompt"); - let agent_batch = super::defs::run_agent(store, &def, batch_size, exclude)?; + let effective_count = def.count.unwrap_or(batch_size); + let agent_batch = super::defs::run_agent(store, &def, effective_count, exclude)?; run_one_agent_inner(store, agent_name, &def, agent_batch, llm_tag, log, debug) }