Agentra LabsAgentra Labs DocsPublic Documentation

Get Started

API Reference

AgenticCognition exposes its functionality through four primary surfaces: the Rust library API, the MCP server, the CLI, and C FFI bindings.

AgenticCognition exposes its functionality through four primary surfaces: the Rust library API, the MCP server, the CLI, and C FFI bindings.

Rust Library

The core library (agentic-cognition crate) provides two primary engine types and supporting modules.

WriteEngine

All mutation operations for the living user model.

MethodDescription
create_model(name: Option<&str>)Create a new living user model
heartbeat(model_id, context)Record an interaction heartbeat
add_belief(model_id, text, domain, confidence)Add a belief to the model
strengthen_belief(model_id, belief_id, evidence)Increase belief confidence
weaken_belief(model_id, belief_id, evidence)Decrease belief confidence
connect_beliefs(model_id, a, b, rel_type)Create an entanglement link
crystallize_belief(model_id, belief_id)Force-crystallize a belief
collapse_belief(model_id, belief_id)Trigger belief collapse
delete_model(model_id)Delete a model and its data

QueryEngine

All read operations for the living user model.

MethodDescription
vitals(model_id)Model health metrics and activity summary
portrait(model_id, depth)Natural-language portrait of the user
soul_reflect(model_id, focus)Deep soul reflection across all dimensions
belief_query(model_id, query, domain, min_confidence)Query beliefs by text, domain, or property
belief_graph(model_id, depth, center)Full belief graph with entanglements
keystones(model_id)Identify keystone beliefs
contradictions(model_id)Detect contradictory belief pairs
self_topology(model_id)Self-concept topology map
pattern_fingerprint(model_id, domain)Decision-making fingerprint
shadow_map(model_id)Shadow map with projections and blindspots
drift_track(model_id, range, domain)Longitudinal drift analysis
predict(model_id, query)Preference prediction
simulate(model_id, scenario, options)Decision simulation
consciousness_map(model_id)Consciousness region activity
list_models()List all models in storage

CognitionStore

Storage abstraction for .acog file persistence.

MethodDescription
new(path)Create a store at the given directory path
save(model)Write model to .acog file with BLAKE3 integrity
load(model_id)Load model from .acog file with integrity check
delete(model_id)Delete model file
list()List all model IDs in the store

format::AcogFile

Direct file I/O for .acog format.

MethodDescription
write(path, model)Write model to file with atomic temp-rename
read(path)Read model from file with BLAKE3 verification
verify(path)Verify file integrity without loading

MCP Tools (14)

All 14 MCP tools are accessible through agentic-cognition-mcp over JSON-RPC 2.0 stdio transport. See MCP Tools for full parameter tables and response formats.

ToolOperation
cognition_model_createCreate a new living user model
cognition_model_heartbeatRecord an interaction heartbeat
cognition_model_vitalsRetrieve model health metrics
cognition_model_portraitGenerate natural-language portrait
cognition_belief_addAdd a belief to the model
cognition_belief_queryQuery beliefs
cognition_belief_graphRetrieve belief graph
cognition_soul_reflectDeep soul reflection
cognition_self_topologySelf-concept topology
cognition_pattern_fingerprintDecision fingerprint
cognition_shadow_mapShadow map
cognition_drift_trackDrift tracking
cognition_predictPreference prediction
cognition_simulateDecision simulation

CLI Commands (40+)

The acog binary provides 40+ commands organized into groups. See CLI Reference for complete command documentation.

GroupCommandsPurpose
model9Model lifecycle management
belief12Belief graph operations
self6Self-concept topology
pattern3Behavioral pattern analysis
shadow3Shadow psychology mapping
bias2Cognitive bias detection
drift2Longitudinal drift tracking
predict3Prediction engine

FFI Bindings

The agentic-cognition-ffi crate exposes a C-compatible FFI surface. See FFI Reference for the complete header file and memory management rules.

Available bindings:

LanguagePackage
Pythonpip install agentic-cognition
Node.js / WASMnpm/wasm package directory
C / C++agentic_cognition_ffi.h header
SwiftVia C FFI bridge
GoVia cgo with C header