How dushyanth25/auto_prompting_cot works
AutoPrompt is a dataset-driven prompt optimizer. A user starts a run through the CLI; the run loads and partitions examples, then coordinates an iterative LangGraph workflow: solve training examples, diagnose failures, store and retrieve lessons, refine a prompt, and gate candidates on validation accuracy while preserving locked instructions. The best prompt receives a held-out test evaluation, with run metrics and reports as outputs. Separate CLI capabilities include dataset validation, post-run reporting, and memory ablation. Edges are grounded in the README and SOURCE INDEX references; unsampled implementation details are not inferred.
Main entry points: nodes.py Workflow stages · run.py Run coordinator · cli.py CLI · runner.py Batch evaluator
Components 22
Run orchestration
- CLI
src/autoprompt/cli.py - Run coordinator
src/autoprompt/run.py - Settings
src/autoprompt/config.py - Dataset loader
src/autoprompt/data/loader.py - Domain schemas
src/autoprompt/schemas.py
Optimization workflow
- Workflow builder
src/autoprompt/graph/builder.py - Workflow stages
src/autoprompt/graph/nodes.py - Solver agent
src/autoprompt/agents/solver.py - Failure judge
src/autoprompt/agents/judge.py - Answer comparator
src/autoprompt/agents/comparator.py - Prompt refiner
src/autoprompt/agents/refiner.py
Memory and prompts
- Episode retriever
src/autoprompt/memory/retriever.py - Episodic memory
src/autoprompt/memory/store.py - Versioned prompts
src/autoprompt/prompts/store.py - Prompt templates
src/autoprompt/prompts/templates.py
Models and configuration
- LLM interface
src/autoprompt/llm/base.py - Groq client
src/autoprompt/llm/groq_client.py
Evaluation and reporting
- Batch evaluator
src/autoprompt/evals/runner.py - Run reports
src/autoprompt/reporting/report.py - Memory ablation
src/autoprompt/reporting/ablation.py
Other components
- User
- Groq API
Connections 32
- User → CLI: starts run
README.md - CLI → Run coordinator: invokes
src/autoprompt/cli.py - CLI → Dataset loader: validates dataset
src/autoprompt/cli.py - CLI → Run reports: generates
src/autoprompt/cli.py - CLI → Memory ablation: runs study
src/autoprompt/cli.py - Run coordinator → Settings: uses settings
src/autoprompt/run.py - Run coordinator → Dataset loader: loads splits
src/autoprompt/run.py - Run coordinator → Workflow builder: builds workflow
src/autoprompt/run.py - Workflow builder → Workflow stages: registers stages
src/autoprompt/graph/builder.py - Workflow stages → Batch evaluator: evaluates examples
src/autoprompt/graph/nodes.py - Workflow stages → Failure judge: diagnoses failures
src/autoprompt/graph/nodes.py - Workflow stages → Prompt refiner: proposes prompts
src/autoprompt/graph/nodes.py - Workflow stages → Episode retriever: retrieves lessons
src/autoprompt/graph/nodes.py - Workflow stages → Episodic memory: stores episodes
README.md - Workflow stages → Versioned prompts: loads and saves
src/autoprompt/graph/nodes.py - Batch evaluator → Solver agent: solves examples
src/autoprompt/evals/runner.py - Batch evaluator → Answer comparator: checks answers
src/autoprompt/evals/runner.py - Batch evaluator → Episode retriever: requests lessons
src/autoprompt/evals/runner.py - Episode retriever → Episodic memory: reads episodes
src/autoprompt/memory/retriever.py - Prompt refiner → Versioned prompts: validates candidates
src/autoprompt/agents/refiner.py - Solver agent → Prompt templates: uses templates
src/autoprompt/agents/solver.py - Solver agent → LLM interface: requests completion
src/autoprompt/agents/solver.py - Failure judge → LLM interface: requests diagnosis
src/autoprompt/agents/judge.py - Prompt refiner → LLM interface: requests mutation
src/autoprompt/agents/refiner.py - Groq client → LLM interface: implements
src/autoprompt/llm/groq_client.py - Groq client → Groq API: calls
src/autoprompt/llm/groq_client.py - Run coordinator → Batch evaluator: tests held-out split
src/autoprompt/run.py - Run coordinator → Run reports: persists run results
src/autoprompt/run.py - Memory ablation → Run coordinator: compares runs
src/autoprompt/reporting/ablation.py - Settings → Domain schemas: validates settings
src/autoprompt/config.py - Dataset loader → Domain schemas: creates examples
src/autoprompt/data/loader.py - Workflow stages → Domain schemas: uses state models
src/autoprompt/graph/nodes.py