Skip to main content

Module core

Module core 

Source
Expand description

§Core Agent Architecture

This module contains the core components of the VT Code agent system, implementing the main agent loop, context management, and supporting infrastructure.

§Architecture Overview

The core system is built around several key components:

  • Agent: Main agent implementation with conversation management
  • Prompt Caching: Strategic caching for improved response times
  • Decision Tracking: Audit trail of agent decisions and actions
  • Error Recovery: Intelligent error handling with context preservation
  • Timeout Detection: Prevents runaway operations
  • Trajectory Management: Session state and history tracking

§Key Components

§Agent System

use vtcode_core::core::agent::core::Agent;
use vtcode_core::VTCodeConfig;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let config = VTCodeConfig::load()?;
    let agent = Agent::new(config).await?;
    agent.run().await?;
    Ok(())
}

Re-exports§

pub use context_optimizer::ContextOptimizer;
pub use memory_pool::MemoryPool;
pub use memory_pool::global_pool;
pub use performance_profiler::BenchmarkResults;
pub use performance_profiler::BenchmarkUtils;
pub use performance_profiler::PerformanceProfiler;
pub use threads::SubmissionId;
pub use threads::ThreadBootstrap;
pub use threads::ThreadEventRecord;
pub use threads::ThreadId;
pub use threads::ThreadManager;
pub use threads::ThreadRuntimeHandle;
pub use threads::ThreadSnapshot;
pub use threads::build_thread_archive_metadata;
pub use threads::loaded_skills_from_session_listing;
pub use threads::messages_from_session_listing;

Modules§

agent
Agent system for intelligent conversation management
context_optimizer
Context optimization for efficient context usage.
decision_tracker
error_recovery
interfaces
Shared interface definitions bridging the CLI binary and reusable vtcode-core abstractions.
loop_detector
Loop detection for agent operations
memory_pool
Memory pool for reducing allocations in hot paths
orchestrator_retry
Orchestrator retry and error handling module
performance_profiler
Performance benchmarking and profiling tools for VT Code optimizations
prompt_caching
telemetry
threads
timeout_detector
Timeout detection and intelligent retry system for long-running operations
trajectory