How malevrigns/agent-jev works
AgentJev is a zero-decoding decision model: callers provide a state and typed questions, and receive probability distributions over supplied candidates. Its main workflow runs through the HTTP service, which validates and prepares requests, encodes candidate paths with shared-prefix inference, scores them, and formats answers. The repository also contains a distinct, gated tool-routing path and data/training code. Some implementation excerpts are partial, so links between unsampled components are limited to documented or directly evidenced behavior.
Main entry points: engine.py Decision engine · train.py Training pipeline · model.py Decision model · server.py HTTP service
Components 18
Decision serving
- HTTP service
jev_service/server.py - Decision engine
jev_service/engine.py - Request contract
jev_service/contract.py - Prefix encoder
jev_service/prefix.py - Decision model
agentjev/model.py - Model checkpoint
Tool routing
- Routing data conversion
agentjev/routing_data.py - Route semantics
agentjev/routing.py - Gated action router
agentjev/routing_runtime.py
Model training
- Decision data
agentjev/data.py - Synthetic data
agentjev/synth.py - Training pipeline
agentjev/train.py - Training losses
agentjev/losses.py - Typed evaluation
typed_decisions/experiment.py
Product clients
- Python client
agentjev_client.py - Pre-tool safety hook
agentjev_hook.py
Other components
- Decision caller
- Claude Code
Connections 19
- Decision caller → Python client: submits decisions
- Python client → HTTP service: POST evaluate
- Claude Code → Pre-tool safety hook: provides tool action
- Pre-tool safety hook → HTTP service: requests risk assessment
- HTTP service → Decision engine: dispatches evaluation
- Decision engine → Request contract: prepares requests
- Decision engine → Prefix encoder: encodes paths
- Prefix encoder → Decision model: encodes candidates
- Decision engine → Decision model: scores vectors
- Decision engine → Request contract: formats answers
- Decision engine → Model checkpoint: loads checkpoint
- Routing data conversion → Route semantics: uses route labels
- Gated action router → Route semantics: uses compact state
- Gated action router → Model checkpoint: loads routing weights
- Decision data → Training pipeline: supplies examples
- Synthetic data → Training pipeline: supplies examples
- Training pipeline → Training losses: computes objectives
- Training pipeline → Decision model: updates parameters
- Typed evaluation → Decision model: evaluates predictions