How gregmos/memoforge works
Memoforge is a legal-research workflow that turns a question into an audited, cited memorandum, primarily through the Claude/Cowork model’s next → act → report protocol and the Python mf CLI. The README documents intake, routed research, source freezing, drafting, review, revision and export, plus multilingual output, decision briefs and dependency fallbacks. The graph preserves those capabilities; some subsystem links use README-level evidence because their source was not sampled.
Main entry points: machine.py Workflow machine · cli.py mf CLI · renderer.py DOCX renderer · sources.py Source registry and freeze
Components 23
Research workflow
- Workflow machine
scripts/memoforge/machine.py - Intake and gates
scripts/memoforge/gates.py - Jurisdiction routing
scripts/memoforge/routing.py - Legal research
scripts/memoforge/analyze.py - Memo drafting
scripts/memoforge/draft.py
Evidence and quality
- Source registry and freeze
scripts/memoforge/sources.py - Quote verification
scripts/memoforge/quotes.py - Citation provenance
scripts/memoforge/citations.py - Draft lint
scripts/memoforge/lint.py
Review and delivery
- Reviewer and mediator
scripts/memoforge/review.py - Draft revision
scripts/memoforge/revision.py - Verdict and finalization
scripts/memoforge/finalize.py - DOCX renderer
scripts/memoforge/docx/renderer.py - Markdown fallback
scripts/memoforge/docx/fallback.py
Runtime foundation
- mf CLI
scripts/memoforge/cli.py - Run state
scripts/memoforge/state_io.py - Audit journal
scripts/memoforge/events.py
Additional capabilities
- Decision brief
scripts/memoforge/brief.py - MCP availability probe
scripts/memoforge/probe.py
Other components
- Legal question
- Orchestrating model
- Legal MCP databases
- Memo deliverable
Connections 29
- Legal question → Orchestrating model: poses question
- Orchestrating model → mf CLI: issues commands
- mf CLI → Workflow machine: dispatches workflow
scripts/memoforge/cli.py - Workflow machine → Orchestrating model: requests next action
- Workflow machine → Intake and gates: runs intake gates
scripts/memoforge/machine.py - Workflow machine → Jurisdiction routing: selects research route
scripts/memoforge/machine.py - Workflow machine → Legal research: coordinates research
- Legal research → Legal MCP databases: queries authorities
- Jurisdiction routing → Legal MCP databases: selects tools
scripts/memoforge/routing.py - Workflow machine → Source registry and freeze: manages source pack
scripts/memoforge/machine.py - Source registry and freeze → Legal MCP databases: fetches legal material
- Workflow machine → Memo drafting: coordinates drafting
- Memo drafting → Source registry and freeze: cites frozen pack
- Workflow machine → Quote verification: checks quotations
- Workflow machine → Citation provenance: tracks provenance
scripts/memoforge/machine.py - Workflow machine → Draft lint: checks draft
scripts/memoforge/machine.py - Workflow machine → Reviewer and mediator: runs review loop
scripts/memoforge/machine.py - Workflow machine → Draft revision: coordinates revision
scripts/memoforge/machine.py - Workflow machine → Verdict and finalization: finalizes verdict
scripts/memoforge/machine.py - Verdict and finalization → DOCX renderer: exports memorandum
scripts/memoforge/finalize.py - DOCX renderer → Markdown fallback: falls back on failure
scripts/memoforge/docx/__init__.py - DOCX renderer → Memo deliverable: writes DOCX and Markdown
- Markdown fallback → Memo deliverable: writes Markdown
scripts/memoforge/docx/fallback.py - Workflow machine → Run state: reads and writes state
scripts/memoforge/machine.py - Workflow machine → Audit journal: records run events
scripts/memoforge/machine.py - Run state → Audit journal: journals state writes
scripts/memoforge/state_io.py - mf CLI → Decision brief: dispatches brief commands
scripts/memoforge/cli.py - mf CLI → MCP availability probe: dispatches probe commands
scripts/memoforge/cli.py - MCP availability probe → Legal MCP databases: reports availability