How nifinet/gtm-brain works
gtm-brain is a small AI outbound system: it collects buying signals, remembers account history, judges which accounts merit action, drafts trigger-grounded outreach, and tracks outcomes to evaluate signal weights and prompt variants. The principal run is orchestrated by run.py; delivery is dry-run by default. The graph preserves the documented configuration and prompt-tuning capabilities. Source excerpts show the main calls and persistence behavior; outcome feedback and weight adjustment are capabilities, but their ongoing external wiring is not shown.
Main entry points: run.py Run pass · act.py Draft outreach · judge.py Judge accounts · loop.py Outcome learning
Components 15
Run orchestration
- Run pass
run.py - Runtime config
config
Brain stages
- Sense signals
brain/sense.py - Domain models
brain/models.py - Judge accounts
brain/judge.py - Draft outreach
brain/act.py - Prompt loader
brain/prompts.py - Reasoning prompts
prompts
Memory and learning
- Account history
brain/memory.py - Outcome learning
brain/loop.py
Adapters and inputs
- Signal source
adapters/signals_stub.py - Delivery adapter
adapters/delivery_stub.py
Other components
- Operator
- Claude API
- Outcome reporter
Connections 26
- Operator → Run pass: starts run
README.md - Run pass → Runtime config: loads settings
run.py - Run pass → Signal source: creates source
run.py - Run pass → Delivery adapter: creates sink
run.py - Run pass → Sense signals: calls sense
run.py - Sense signals → Signal source: fetches signals
brain/sense.py - Sense signals → Account history: records signals
brain/sense.py - Sense signals → Domain models: validates signals
brain/sense.py - Run pass → Judge accounts: judges accounts
run.py - Judge accounts → Account history: reads history
brain/judge.py - Judge accounts → Prompt loader: loads judge prompt
brain/judge.py - Judge accounts → Claude API: requests judgment
brain/judge.py - Run pass → Draft outreach: acts on verdicts
run.py - Run pass → Runtime config: passes sequences
run.py - Draft outreach → Prompt loader: loads draft prompt
brain/act.py - Draft outreach → Claude API: requests draft
brain/act.py - Draft outreach → Delivery adapter: sends draft
brain/act.py - Draft outreach → Account history: records touch
brain/act.py - Prompt loader → Reasoning prompts: reads prompt files
brain/prompts.py - Run pass → Outcome learning: selects variant
run.py - Run pass → Outcome learning: prints report
run.py - Outcome learning → Account history: records outcomes
brain/loop.py - Outcome learning → Account history: reads outcome stats
brain/loop.py - Outcome reporter → Outcome learning: reports outcomes
README.md - Runtime config → Judge accounts: supplies ICP
- Runtime config → Draft outreach: supplies sequences