How togethercomputer/hybridagent works
Hybrid Reasoning Agents combines a runtime agent with supervised and reinforcement-learning post-training, batch inference, and latent-trace inspection. The principal user workflow is to submit a question, generate a mixed latent/text trajectory, call tools from text mode, and return an answer; inference can also emit readouts and tool statistics. The graph preserves the documented training and inspection branches. Several internal links are supported by the SOURCE INDEX or README rather than complete excerpts, so uncertain connections are omitted.
Main entry points: train.py RL trainer · engine.py Hybrid generation · trace.py Trace capture · model.py Model wrapper
Components 26
Agent runtime
- Hybrid generation
hybrid_agent/engine.py - Model wrapper
hybrid_agent/model.py - HybridLink
hybrid_agent/hybridlink.py - Agent prompt
hybrid_agent/prompts.py - Latent readout
hybrid_agent/readout.py - Tool executor
hybrid_agent/tools/executor.py - Python tool
hybrid_agent/tools/python_tool.py - Search tool
hybrid_agent/tools/search_tool.py - Search cache
hybrid_agent/tools/search_cache.py
HybridSFT
- Trajectory data
hybrid_sft/data.py - SFT model
hybrid_sft/model.py - SFT trainer
hybrid_sft/train.py
HybridRL
- RL configuration
hybrid_rl/config.py - Prompt data
hybrid_rl/data.py - Policy rollout
hybrid_rl/rollout.py - Trajectory records
hybrid_rl/trajectory.py - Reward scoring
hybrid_rl/reward.py - Exact replay
hybrid_rl/replay.py - Policy update
hybrid_rl/policy.py - RL trainer
hybrid_rl/train.py
Inference and inspection
- Batch inference
hybrid_inference/run_batch.py - Trace capture
interpretable_latent_mode/trace.py - Trace renderer
interpretable_latent_mode/render.py
Other components
- Questioner
- Tavily search
- Agent answer
Connections 27
- Questioner → Batch inference: submits questions
README.md - Batch inference → Hybrid generation: runs generation
hybrid_inference/run_batch.py - Hybrid generation → Model wrapper: uses model
hybrid_agent/engine.py - Model wrapper → HybridLink: applies adapter
hybrid_agent/model.py - Hybrid generation → Tool executor: dispatches tools
hybrid_agent/engine.py - Tool executor → Python tool: dispatches
hybrid_agent/tools/executor.py - Tool executor → Search tool: dispatches
hybrid_agent/tools/executor.py - Search tool → Search cache: reads and writes
hybrid_agent/tools/search_tool.py - Search tool → Tavily search: searches
hybrid_agent/tools/search_tool.py - Hybrid generation → Latent readout: records readout
hybrid_agent/engine.py - Batch inference → Agent answer: writes results
README.md - SFT trainer → Trajectory data: loads trajectories
hybrid_sft/train.py - SFT trainer → SFT model: trains model
hybrid_sft/train.py - SFT trainer → Model wrapper: uses shared model
hybrid_sft/train.py - RL trainer → RL configuration: uses settings
hybrid_rl/train.py - RL trainer → Prompt data: loads prompts
hybrid_rl/train.py - RL trainer → Policy rollout: samples trajectories
hybrid_rl/train.py - Policy rollout → Hybrid generation: runs agent
hybrid_rl/rollout.py - Policy rollout → Trajectory records: records rollout
hybrid_rl/rollout.py - RL trainer → Reward scoring: scores samples
hybrid_rl/train.py - RL trainer → Exact replay: replays trajectories
hybrid_rl/train.py - RL trainer → Policy update: updates policy
hybrid_rl/train.py - Policy update → Model wrapper: uses shared model
hybrid_rl/policy.py - Trace capture → Hybrid generation: extends generation
interpretable_latent_mode/trace.py - Trace capture → Latent readout: maps latent steps
interpretable_latent_mode/trace.py - Trace renderer → Trace capture: renders traces
interpretable_latent_mode/render.py - Questioner → Trace capture: requests inspection
README.md