उदाहरण / Scheduled Agent

90 lines TOML में Standup Bot

एक autonomous agent जो आपके बिना चलता है, सिर्फ shell + git इस्तेमाल करता है और sessions के बीच याद रखता है।

standup_bot.toml

समस्या

Standup एक chore है। आप भूल जाते हैं कि कल क्या किया था। आपकी git history जानती है, लेकिन हर सुबह review करने का समय नहीं होता। और जब आप standup notes लिखते हैं, वे अक्सर generic और कम उपयोगी होते हैं।

क्या हो अगर एक agent यह आपके लिए हर दिन, उसी समय, बिना पूछे कर दे?

Config

पूरा agent यहां define है: standup_bot.toml - 90 lines TOML। Python नहीं। JavaScript नहीं। QueryMT से अलग कोई runtime dependencies नहीं।

Agent definition

[agent]
provider = "anthropic"
model = "claude-sonnet-4-5-20250929"
assume_mutating = false
# No mutating tools — this agent is strictly read-only
mutating_tools = []
Read-only by design

assume_mutating = false and an empty mutating_tools list means this agent can never write to disk or execute mutating commands. It reads git history and writes to its knowledge store - nothing else.

Tool selection

[agent]
tools = [
  # Git & codebase analysis (read-only)
  "read_tool", "index", "glob", "search_text", "ls", "shell",

  # Knowledge lifecycle — the magic
  "knowledge_ingest",      # Store findings
  "knowledge_query",       # Recall past standups
  "knowledge_consolidate", # Merge daily → weekly
  "knowledge_list_unconsolidated",
  "knowledge_stats",

  # Task tracking
  "create_task", "todowrite", "todoread",
]
Knowledge lifecycle tools

Three tools handle persistent memory: knowledge_ingest stores structured findings, knowledge_query retrieves them, and knowledge_consolidate merges related entries into higher-level summaries. The agent remembers across sessions automatically.

Three-layer context compaction

# Layer 1: Tool output truncation
[agent.execution.tool_output]
max_lines = 1000
max_bytes = 25600

# Layer 2: Pruning after every turn
[agent.execution.pruning]
protect_tokens = 20000

# Layer 3: AI summary on context overflow
[agent.execution.compaction]
auto = true

Git log output can be huge. These three layers keep the context window manageable: truncate tool output at 1000 lines, prune old messages while protecting recent ones, and automatically summarize the conversation when it grows too large.

Middleware: execution limits

[[middleware]]
type = "limits"
max_steps = 30    # Max tool calls per cycle
max_turns = 15    # Max conversation turns

[[middleware]]
type = "context"
warn_at_percent = 80   # Warn when 80% of context used
compact_at_percent = 90 # Auto-compact at 90%
fallback_max_tokens = 128000
Cost-bounded execution

With max_steps = 30 and max_turns = 15 each scheduled cycle has a hard ceiling on cost. The agent can't run away. Context management ensures it never hits token limits unexpectedly.

Schedule setup

dashboard launch करने के बाद, UI से schedule बनाएं:

  1. Open Session -> Schedules -> Create Schedule
  2. Prompt: "Run a standup cycle: analyze recent git activity, ingest findings, and report."
  3. Trigger: Interval, 86400 seconds (every 24 hours)
  4. Max runs: 30 (one month of daily standups)
  5. Max steps: 20
Automatic expiry

After 30 runs (one month), the schedule expires automatically. No orphaned processes. No cleanup needed.

क्या होता है

हर दिन उसी समय, agent यह cycle autonomously चलाता है:

1. Git analysis Runs git log for the last 24 hours. Reads changed files, commit messages, and diff patterns.
2. Pattern extraction Identifies what areas were worked on, what issues appeared, what patterns emerged.
3. Knowledge ingest Stores structured findings: "API layer saw heavy refactoring, 3 new endpoints added, test coverage dropped."
4. Standup report Generates the day's standup: what was done, what's in progress, what's blocked.

Over time, the agent builds a knowledge graph of your project's history. Weekly consolidation merges daily standups into weekly summaries. Query past standups anytime:

# Ask the agent in the dashboard:
"What were the main themes from last week's standups?"

Key Features

  • Interval scheduling — runs on a fixed cadence, no user interaction needed
  • Knowledge lifecycle — ingest daily, consolidate weekly, query anytime
  • Autonomous execution — the bot does its job without you watching
  • Cost-boundedmax_steps and max_turns prevent runaway costs
  • Three-layer compaction — handles large git outputs gracefully
  • Automatic schedule expiry — no orphaned processes after the trial period

खुद try करें

# Clone and run
git clone https://github.com/querymt/querymt.git && cd querymt
cargo run --example qmtcode --features dashboard -- \
  confs/standup_bot.toml --dashboard

# In the dashboard, create a schedule:
#   Session -> Schedules -> Create Schedule
#   Prompt: "Run a standup cycle: analyze recent git activity, ingest findings, and report."
#   Trigger: Interval, 86400s (daily)
#   Max runs: 30