Status: Implemented — corpus generator, training pipeline, and 1B model support are all functional. See docs/cognet-integration.md for the user-facing guide. Last updated: 2026-06-20 Owner: Philippe-Antoine Robert (@AFKmoney)
This document explains how the CogNet ↔ AICL integration works. The corpus
generator produces spec→code pairs (using AX sub-language behaviors), and
CogNet is fine-tuned on them via the cloud_train.py pipeline.
Bidirectional bridge between AICL specifications and the CogNet cognitive engine (a non-transformer language model with hierarchical memory and cognitive routing). The bridge lets CogNet reason over AICL programs as first-class cognitive representations, and lets AICL programs invoke CogNet as a reasoning backend.
The full design is specced in AICL itself in
examples/86_cognet_aicl_bridge.aicl
through
examples/91_cognet_autonomous_deployment.aicl.
Those six example programs collectively form the integration specification.
python/src/aicl/cognet/
├── __init__.py Public API surface (currently empty — see below)
└── README.md This file's shorter sibling, viewable from the package
The cognet/ subpackage is reserved. Importing aicl.cognet today succeeds
but exposes no symbols. This lets us:
- Add the import path in
__init__.pywithout breaking existing code. - Land type stubs and protocol definitions incrementally.
- Keep the public API stable across the integration rollout.
- The actual bridge implementation (translation layer between AICL AST and CogNet cognitive graph).
- CogNet model loading / inference glue.
- Round-trip fidelity tests.
- A
cognetsubcommand on theaiclCLI.
- Implement
aicl.cognet.bridge.AICLCognetBridgewith two methods:spec_to_graph(source: str) -> CognetGraphgraph_to_spec(graph: CognetGraph) -> str
- Property-based round-trip test:
graph_to_spec(spec_to_graph(p)) ~ p - Add
aicl cognet translate <file>subcommand
- New
Native:section handler in the compiler that delegates to CogNet for runtime reasoning (cognitive routing decisions). - Wire
runtime.pyRisk → Recovery selection through CogNet when aNative: CogNetsection is present.
- Implement the spec from example 87 (
87_cognet_self_evolution.aicl). - The autonomous compilation loop (
aicl evolve) gains a CogNet mode where the LLM-backedai_generator.pyis replaced by a local CogNet model for fully offline self-modification.
- Bidirectional AICL ↔ CogNet loop where AICL specs drive CogNet training data, and CogNet reasoning drives AICL spec evolution.
- Examples 89–91 (training pipeline, evaluation, autonomous deployment) become executable end-to-end.
When the CogNet runtime is published:
- Add
cognet-runtimeas an optional dependency inpyproject.toml:[project.optional-dependencies] cognet = ["cognet-runtime>=1.0"]
- Implement
bridge.pyin this folder. - Re-export public symbols from
__init__.py. - Add the
cognetsubcommand incli.py. - Land property-based round-trip tests in
tests/test_cognet_bridge.py.
Until then, this folder is a deliberate placeholder. Do not remove it.