Cog Arch Dgm¶
Discovering Gödel Machine (DGM) cognitive architecture component.
Cluster: Experience & Autonomy | Type: component | MCP Tools: 42
Overview¶
Discovering Godel Machine (DGM) cognitive architecture that implements self-improving program search: programs can be defined, mutated, crossed over, benchmarked, safety-checked, evolved through a lineage-tracked archive, and inspected through deterministic backend-native capability discovery. Delegates 37 operations to an inner DGMMCPBlock backed by SQLite, storing programs, evaluation results, proof attempts, and evolution history.
Launch caveat: Treat this as an advanced or experimental value-add, not a first-10-minutes onboarding feature for vibe coders. It is functional and useful for users who understand benchmarks, archive search, and verification loops, but most end users should encounter it through simple workflow templates or guided examples rather than raw DGM concepts. Do not position it as autonomous production self-improvement without domain-specific evaluation and review.
Safety caveat: Public evolution can run without caller-supplied invariants, but those runs are qualified-draft and heuristic/benchmark-only. Treat verified safety as requiring supplied invariants and proof evidence.
When to use:
- Building self-improving agents that propose and verify code rewrites before execution
- Maintaining a lineage of evolving program versions with evidence-backed improvement checks
- Integrating self-modification into the G6 pipeline under explicit safety constraints
Example:
from mvp.cog_arch_dgm import CogArchDGMBlock, DGMInput
block = CogArchDGMBlock(name="dgm")
defined = block.infer(DGMInput(
op="program_define",
program_json='{"source_repr":"def policy(x): return x.get(\\"a\\", 0) + x.get(\\"b\\", 0)"}',
))
result = block.infer(DGMInput(op="program_analyze", program_id=defined.value.programs[0]["id"]))
# result.ok -> True; result.value -> DGMOutput with records and diagnostics
Works well with: cegis, formal_methods, recursive_architect
Public API¶
CogArchDGMBlock(AIBlock[DGMInput, DGMOutput, dict])¶
Top-level DGM block — delegates to DGMMCPBlock.
| Field | Type | Default |
|---|---|---|
name | str | 'cog_arch_dgm' |
state | dict \| None | None |
db_path | str | ':memory:' |
resource_bounds | ResourceBounds \| None | _DEFAULT_RESOURCE_BOUNDS |
usage | ResourceUsage | field(default_factory=ResourceUsage) |
Methods:
infer(data: DGMInput) -> Result[DGMOutput]¶
DGMInput(BaseModel)¶
Input for CogArchDGMBlock.
| Field | Type | Default |
|---|---|---|
op | str | required |
program_id | str | '' |
program_json | str | '{}' |
benchmark_id | str | '' |
config_json | str | '{}' |
query | str | '' |
DGMOutput(BaseModel)¶
Output from CogArchDGMBlock.
| Field | Type | Default |
|---|---|---|
op | str | required |
ok | bool | required |
programs | list[dict] | Field(default_factory=list) |
evaluations | list[dict] | Field(default_factory=list) |
proofs | list[dict] | Field(default_factory=list) |
message | str | '' |
error | str | '' |
data_json | str | '' |
degraded | bool | False |
degradation_reason | str | '' |
confidence | float | 0.0 |
next_steps | list[str] | Field(default_factory=list) |
Functions¶
compute_weighted_fitness(foundational: float, intermediate: float, advanced: float, weights: tuple[float, float, float] = (0.5, 0.3, 0.2)) -> float¶
Aggregate per-stage benchmark scores into a single fitness value.
MCP Tools¶
| Operation | Source |
|---|---|
archive_create | cog_arch_dgm_mcp |
archive_get | cog_arch_dgm_mcp |
archive_list | cog_arch_dgm_mcp |
archive_branch | cog_arch_dgm_mcp |
archive_prune | cog_arch_dgm_mcp |
program_define | cog_arch_dgm_mcp |
program_mutate | cog_arch_dgm_mcp |
program_crossover | cog_arch_dgm_mcp |
program_analyze | cog_arch_dgm_mcp |
benchmark_define | cog_arch_dgm_mcp |
benchmark_run | cog_arch_dgm_mcp |
benchmark_stage | cog_arch_dgm_mcp |
benchmark_compare | cog_arch_dgm_mcp |
verify_safety | cog_arch_dgm_mcp |
check_invariant | cog_arch_dgm_mcp |
prove_improvement | cog_arch_dgm_mcp |
proof_status | cog_arch_dgm_mcp |
evolve_step | cog_arch_dgm_mcp |
evolve_run | cog_arch_dgm_mcp |
evolve_status | cog_arch_dgm_mcp |
evolve_history | cog_arch_dgm_mcp |
find_analogy | cog_arch_dgm_mcp |
realtime_bridge | cog_arch_dgm_mcp |
dgm_search | cog_arch_dgm_mcp |
dgm_info | cog_arch_dgm_mcp |
list_patterns | cog_arch_dgm_mcp |
list_capabilities | cog_arch_dgm_mcp |
describe_engine | cog_arch_dgm_mcp |
describe_mutation_backends | cog_arch_dgm_mcp |
describe_evaluation_policy | cog_arch_dgm_mcp |
describe_sandbox_policy | cog_arch_dgm_mcp |
probe_formal_backends | cog_arch_dgm_mcp |
describe_proof_status | cog_arch_dgm_mcp |
describe_llm_proposal_backends | cog_arch_dgm_mcp |
describe_store_schema | cog_arch_dgm_mcp |
describe_archive_policy | cog_arch_dgm_mcp |
describe_pattern_mechanisms | cog_arch_dgm_mcp |
proved | cog_arch_dgm_mcp |
disproved | cog_arch_dgm_mcp |
unknown | cog_arch_dgm_mcp |
solver_unavailable | cog_arch_dgm_mcp |
fallback_only | cog_arch_dgm_mcp |