# car-reason
Code reasoning engine for [Common Agent Runtime](https://github.com/Parslee-ai/car). Adaptive, graph-driven, learning.
## What it does
Instead of a hardcoded "diagnose → suggest → explain" pipeline, reasoning actions are **skills in the memgine graph**. The graph's spreading activation and success/failure tracking determine which actions to run, in what order, routed to which models. As outcomes accumulate, the routing improves without code changes.
## Usage
```rust,no_run
use std::sync::{Arc, Mutex};
use car_reason::ReasoningSession;
let inference = Arc::new(car_inference::InferenceEngine::new(Default::default()));
let mut memgine = car_memgine::MemgineEngine::new(None);
// Seed the default reasoning skills
car_reason::skills::seed_defaults(&mut memgine);
let memgine = Arc::new(Mutex::new(memgine));
let session = ReasoningSession::new(memgine, inference);
let result = session.reason("fix the off-by-one error in parse_header").await?;
println!("Diagnosis: {}", result.diagnosis);
for s in &result.suggestions {
println!("Fix: {}", s.suggested);
}
println!("Explanation: {}", result.explanation);
```
## Where it fits
A higher-level capability over `car-memgine` + `car-inference` + `car-ast`. Used by the `car` CLI's diagnostic / fix slash commands and by `.claude-plugin/agents/reason.md`.