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
Translation, scoring, and review
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 |
Recommended Reading Order
- Overview — orient yourself in the API surface.
- Installation and Quick Start — get the import path working and run a single session.
- Session API — the main supported entry point for nearly all use cases.
- Complete Example — see how the moving parts fit together.
- Bundle API and Export Stage and GNN Package — read and write COGANT artifacts programmatically.
- Review API and Scoring API — gate and curate the results.
- Plugin API — only when you have a concrete extension to build.
- API Stability — review before pinning a production dependency.
Agent notes: AGENTS.md - Hub: ../index.md