Skip to content

Documentation

Architecture

A composable AI framework with 250+ modules, accessed via Claude Code MCP, with railway-oriented pipelines.

Workspace Structure

G6Solver is built on a Polylith workspace — a monorepo architecture where code is organized into composable bricks, served to your Claude Code client via MCP.

  • 200+ component bricks — pure logic modules (self-learning, alignment, formal methods, etc.)
  • 16 base bricks — delivery mechanisms (CLI, Autofix CLI, REST, MCP, gRPC, SOAP, Erlang, CI/CD, Computer Use, VirtualBox, Desktop, Web, GUI API, Patch, Extension Catalog, Self-Improve). Only MCP and Web are part of the hosted product today
  • Deployable projects — assembled from components and bases

The Seven Intelligence Classes

01

Self-Learning

Agents that remember, adapt, and improve with every interaction. Components: adapt_memory, adapt_pandas, adapt_sklearn, adapt_optimisation, adapt_pygad.

02

Self-Modification

Code rewriting behind safety gates, rollback, tests, and optional formal verification. Components: meta_programming, cegis, adapt_healing.

03

Failure Engineering

Constructive safety with formal bounds, not post-hoc guardrails. Components: csf, adapt_healing, grounding.

04

Alignment Engineering

Specification-driven alignment with evaluation feedback loops. Components: align_specs, align_evals, align_csf, align_prompt_library.

05

Formal Methods

SAT, SMT, DPLL, and Z3 integrations across 19 MCP sub-packages. Stronger guarantees require the relevant backend to be installed and the property to be formally specified. Component: formal_methods.

06

Symbolic ML

Retrieval, search, and knowledge grounding. Components: ctx_rag, ctx_colbert, ctx_elastic, ctx_search, ctx_recursive.

07

Self-Improvement (T2–T3)

Evolutionary skill synthesis — programs that evolve, compete, and improve across generations via Pareto-optimal selection. This is the T2–T3 mechanism: at T2 the system learns better strategies; at T3 it learns better rules for learning strategies. Component: evoskill.

Architecture Stack

G6Solver runs on G6’s servers. Your Claude Code client connects over the network to the hosted MCP endpoint, which orchestrates 250+ components with configurable LLM backends. Extension packages add specialized capabilities.

Your Claude Code MCP Client
HTTPS · SSE
G6 Hosted Service Core + Extension Packages — FastMCP
Cognitive Layer
Memory · Reasoning · Safety · Learning
Alignment
Failure Eng.
Symbolic ML
Formal Methods
Self Learning
Self Mod.
Self Improve
LLM Backends Ollama (local GPU) / OpenRouter (cloud)

Optional Cloud Services

Automatic patch delivery is a separate service behind the same account.

All components run on the hosted service, and LLM inference runs through OpenRouter. Ollama is a local-GPU backend and is not available on the hosted service — a server cannot reach a model running on your machine — so it stays a development backend until a desktop application ships.

Components (200+)

Pure Python modules with no delivery-mechanism coupling. Each component is a focused cognitive capability.

Core Infrastructure

core, config, llm_router, database

Self-Learning

adapt_memory, adapt_pandas, adapt_sklearn, adapt_optimisation, adapt_pygad

Self-Modification

meta_programming, cegis, adapt_healing

Alignment

align_specs, align_evals, align_csf, align_prompt_library

Formal Methods

formal_methods — optional prover and solver backends across 19 MCP sub-packages

Symbolic ML & Retrieval

ctx_rag, ctx_colbert, ctx_elastic, ctx_search, ctx_recursive

Bases

Delivery mechanisms — thin adapters that expose components via different protocols. MCP is the primary interface for Claude Code users.

MCP Server (Primary)

Tier-gated

FastMCP over SSE — the primary integration for Claude Code. Components execute on the hosted service. Connect with claude mcp add g6 --transport sse --url https://g6solver.com/mcp/sse --header "Authorization: Bearer YOUR_API_KEY".

REST API

FastAPI + Uvicorn — present in the codebase, not part of the hosted product today. The /api/ route is closed at the edge, so these endpoints are not reachable on g6solver.com.

CLI (TUI)

Textual TUI — local interactive interface with 17-tab dashboard.

Advanced Integrations

gRPC — betterproto SOAP — spyne Erlang — OTP bridge

Infrastructure & Automation

CI/CD — pipeline orchestration Computer Use — GUI automation VirtualBox — VM management

Plugin & Interface

Skill — internal skill/plugin system Desktop — desktop automation Web — Django documentation portal GUI API — graphical interface API Patch — code patching

Component Model

Every component is built on three primitives: AIBlock for computation, Protocol contracts for capabilities, and Result[T] for error handling.

AIBlock[Input, Output, State]

The universal building block. Every component extends this generic dataclass.

AIBlock[I, O, S]
  Fields: name: str, state: S
  Methods:
    infer(input: I) → Result[O]       # Run inference
    learn(data: list[I]) → Result[S]  # Update state
    save(path: str) → Result[str]     # Persist state
    load(path: str) → Result[str]     # Restore state
    >> (other: AIBlock) → PipelineBlock  # Compose

Concrete Example

# Using the Bayesian inference component
from mvp.adapt_bayesian import AdaptBayesianBlock

block = AdaptBayesianBlock(name="my_estimator")
result = block.infer({
    "data": [2.1, 3.4, 2.8, 3.1, 2.9],
    "model_type": "gaussian"
})

# result.is_ok() == True
# result.value:
# "Model: gaussian | Posterior mean=2.86, std=0.21 | 95% CI: [2.45, 3.27]"

Protocol Contracts

Structural typing that declares what a component can do.

Protocol Method Description
Ingestibleingest(raw) → ResultParse raw input
Emittableemit(data) → ResultFormat output
Storablesave/load(path) → ResultPersistence
Inferrableinfer(input) → ResultCore inference
Learnablelearn(data) → ResultOnline learning
InductiveBiasbias() → dictDeclare assumptions

Result[T]

Railway-oriented error type. Every operation returns a Result instead of raising exceptions.

Result[T]
  .ok(value: T) → Result[T]    # Success
  .fail(error: str) → Result[T] # Failure
  .map(fn) → Result[U]          # Transform value
  .flat_map(fn) → Result[U]     # Chain operations
  .or_else(fn) → Result[T]      # Handle errors
  .is_ok() → bool            # method, not a property
  .is_fail() → bool          # method, not a property

Result in Action

# Success path
result = block.infer(valid_input)     # Result.ok("Model: gaussian | ...")
doubled = result.map(len)             # Result.ok(42)

# Failure path — errors short-circuit
result = block.infer(bad_input)       # Result.fail("Empty data not allowed")
doubled = result.map(len)             # Result.fail("Empty data not allowed") — map skipped
fallback = result.or_else("default")  # "default"

Pipeline Architecture

Components compose via railway-oriented programming with explicit error handling.

# Compose components with the >> operator
search = CtxSearchBlock(name="search")
grounding = GroundingBlock(name="verify")

pipeline = search >> grounding
result = pipeline.infer({"query": "What is gradient descent?"})
# Result.ok({"answer": "...", "confidence": 0.91, "sources": [...]})
# If search fails, grounding is never called (railway short-circuit)
result = pipeline.infer({"query": ""})
# Result.fail("Empty query not allowed")

PipelineStep

Declarative step definition for the execution engine.

PipelineStep
  component: str     # Component name
  operation: str     # Operation to invoke
  params: dict       # Operation parameters

Execution Functions

run_pipeline(steps: list[PipelineStep]) → Result[list]
  Sequential execution, stops on first failure.

run_parallel(steps: list[PipelineStep]) → Result[list]
  Concurrent execution via trio nursery.

ComponentRegistry

Auto-discovers all 250+ components at import time.

registry = get_registry()
registry.list_all()      → list[ComponentMeta]
registry.invoke(name, op, params) → Result

Registry Invocation Example

registry = get_registry()

# Invoke any component by name
result = registry.invoke("grounding", "infer", {
    "query": "What is backpropagation?",
    "domain": "ai_ml"
})

# result is returns.Result — unwrap with .unwrap() or match
# Success: {"answer": "Backpropagation is...", "confidence": 0.87}
# Failure: "Component 'xyz' not found"

Railway Data Flow

Input → [Block A] →ok→ [Block B] →ok→ [Block C] → Output
                   →fail→ Error (short-circuits)

Data Flow Patterns

Three primary integration patterns depending on delivery mechanism.

REST Lifecycle

HTTP Request → FastAPI route → Block.infer(input)
  → Result.ok(output) → JSON response (200)
  → Result.fail(error) → JSON error (422/500)

MCP Lifecycle (hosted SSE)

Claude Code → HTTPS / SSE → hosted MCP endpoint
  → API-key authentication
  → rate limit (per key, per tier)
  → tier gate (is this tool on your plan?)
  → admin gate (privileged tools refused)
  → billing context → FastMCP @server.tool()
  → Block.infer(input) → LLM backend (OpenRouter)
  → string response back to Claude

Parallel Execution

trio.open_nursery():
  nursery.start_soon(block_a.infer, input_a)
  nursery.start_soon(block_b.infer, input_b)
  → Results collected after all complete

Security Architecture

Security architecture for G6.

Security Controls

Control Implementation
Access authentication Bearer API key, checked against your account on every request. No device binding and no offline mode — nothing is installed on your machine.
TLS/HTTPS Cloud services only — TLS 1.2+ for patch delivery
Tool access control Tier-based tool gating per plan (Free: 30 tools, Researcher: 66, Builder: full tool access).
Rate limiting Redis sliding-window per API key (10–500 req/min by tier). Every request is served by the hosted stack, so the limit always applies.
Secrets management Environment variables via .env, no hardcoded credentials
Dependency pinning Version-pinned requirements files for both web and MCP Dockerfiles
Container hardening Non-root user, multi-stage builds, health checks, selective COPY

CSF Safety Framework

  • ResourceBounds enforces token limits, budget caps, and timeouts per operation
  • Safety queries are verified with formal bounds (union_bound + worst_case strategies)
  • Git rollback manager enables safe code modification with automatic revert on failure
  • Shape: ResourceBounds(max_tokens, max_budget_usd, timeout_sec, max_retries)

Component Runtime Security

  • Tier-based tool access control (15 categories)
  • Extension sandbox (subprocess isolation by default)
  • No hardcoded credentials — environment variables via .env
  • CSF safety framework with formal resource bounds

Cloud Services Security

  • TLS 1.2+ for patch delivery
  • Per-license rate limiting by tier (cloud services only)
  • CORS origins restricted
  • Container images pinned to minor version

Licensing Model

G6Solver is proprietary software, licensed rather than sold. Access is authenticated with an API key tied to your account; which tools that key can reach depends on your plan (Free, Researcher or Builder). Source code is available for audit by licensed users but is not open source. See our Terms of Service for the terms that govern your use, and License for what happens to your work when access ends.

Commercial License

All G6Solver components are proprietary software (Copyright 2026 Daniel Busch Dental Care Pty Ltd). Licensed users can inspect source for audit purposes. The MCP tool API is fully documented and provides programmatic access to all components without requiring source access.

The Type I/II compression engine and learning oscillation mechanism are documented at the behavioral level only.

Key Design Decisions

01

Model agnostic — works with any LLM, never locked to one vendor

02

Safety first — CSF with formal bounds, not post-hoc guardrails

03

Composable — 250+ components that connect via typed pipelines

04

Railway-oriented — explicit error handling with Result[T]

05

Resource bounded — token limits, budget caps, timeout enforcement