Skip to content

API Reference

Public Python API surface for COGANT. Use this section if you are embedding COGANT in another tool, scripting custom pipelines, or building plugins. For CLI usage see ../cli_reference.md; for narrative tutorials see ../tutorials/.

Contents

Orientation

Page Description Level
Overview Bird's-eye map of the public API surface Beginner
Installation Install the package and verify the import works Beginner
Quick Start Minimal Session example end-to-end Beginner
Complete Example Longer worked example covering scan -> review -> export Intermediate
API Stability Stability tiers, deprecation policy, semver guarantees Intermediate
See Also Cross-links to related documentation Beginner

Core orchestration

Page Description Level
Session API Top-level Session orchestrator, the recommended entry point Beginner
PipelineRunner API Lower-level pipeline executor for custom stage composition Intermediate
Bundle API Read, write, and inspect COGANT result bundles Intermediate
Export Stage and GNN Package Export final mappings as a GNN package Intermediate
Execute Exported GNN Models Categorical filtering, action selection, typed traces, and source-bound figures Intermediate

Translation, scoring, and review

Page Description Level
Fixpoint Translation API Iterative rule-based translation engine Advanced
Scoring API Confidence scoring of role assignments Intermediate
Confidence Model API Underlying confidence model and tier policy Advanced
Review API Human-in-the-loop review and curation Intermediate

Analysis stages

Page Description Level
Static Analysis (cogant.static) AST parse, symbol extraction, type inference, call graph Intermediate
Dynamic Analysis API Runtime / dynamic analysis hooks Advanced
Dynamic Enrichment API Augment a static graph with dynamic facts Advanced
Translate Package (cogant.translate) Priority-ordered rule set + fixpoint, emits SemanticMapping records Intermediate
State Space (cogant.statespace) Variables, actions, and transitions compiled from rule output Intermediate
Explicit finite models Authored probability kernels, exhaustive checks, and runtime handoff Intermediate
Markov Blanket (cogant.markov) Partition the graph into μ / s / a / η sets Intermediate
GNN Package (cogant.gnn) GNNPackageBuilder + GNNValidator (0–100 score) Intermediate
Reverse (cogant.reverse) GNN → runnable Python synthesis Advanced
Runtime (cogant.runtime) Active Inference agent runtime (multi-episode Bayesian learning) Advanced
Simulate (cogant.simulate) Forward simulation of compiled state-space models Advanced
Visualization API Render program graphs, GNNs, and Markov blanket diagrams Intermediate
FastAPI Server (cogant.server) REST + WebSocket endpoints for a deployable pipeline Intermediate

Extension points

Page Description Level
Plugin API Author parser / translator / validator / exporter plugins Advanced

Operational reference

Page Description Level
Error Handling Exception hierarchy and recovery patterns Intermediate
Performance Tips Profiling and tuning recommendations Intermediate
Debugging Logging, breakpoints, and diagnostic helpers Intermediate
  1. Overview — orient yourself in the API surface.
  2. Installation and Quick Start — get the import path working and run a single session.
  3. Session API — the main supported entry point for nearly all use cases.
  4. Complete Example — see how the moving parts fit together.
  5. Bundle API and Export Stage and GNN Package — read and write COGANT artifacts programmatically.
  6. Review API and Scoring API — gate and curate the results.
  7. Plugin API — only when you have a concrete extension to build.
  8. API Stability — review before pinning a production dependency.

Agent notes: AGENTS.md - Hub: ../index.md