deepwiki-rs 1.2.7

deepwiki-rs(also known as Litho) is a high-performance automatic generation engine for C4 architecture documentation, developed using Rust. It can intelligently analyze project structures, identify core components, parse dependency relationships, and leverage large language models (LLMs) to automatically generate professional architecture documentation.
use crate::generator::research::memory::MemoryScope;
use crate::generator::research::types::AgentType;
use crate::generator::step_forward_agent::{
    AgentDataConfig, DataSource, FormatterConfig, LLMCallMode, PromptTemplate, StepForwardAgent,
};

/// Architecture Researcher - Responsible for analyzing the overall architecture of the project
#[derive(Default)]
pub struct ArchitectureResearcher;

impl StepForwardAgent for ArchitectureResearcher {
    type Output = String; // Returns text result

    fn agent_type(&self) -> String {
        AgentType::ArchitectureResearcher.to_string()
    }

    fn agent_type_enum(&self) -> Option<AgentType> {
        Some(AgentType::ArchitectureResearcher)
    }

    fn memory_scope_key(&self) -> String {
        MemoryScope::STUDIES_RESEARCH.to_string()
    }

    fn data_config(&self) -> AgentDataConfig {
        AgentDataConfig {
            required_sources: vec![
                DataSource::ResearchResult(AgentType::SystemContextResearcher.to_string()),
                DataSource::ResearchResult(AgentType::DomainModulesDetector.to_string()),
            ],
            optional_sources: vec![
                DataSource::PROJECT_STRUCTURE,
                DataSource::DEPENDENCY_ANALYSIS,
            ],
        }
    }

    fn prompt_template(&self) -> PromptTemplate {
        PromptTemplate {
            system_prompt:
                "You are a professional software architecture analyst, analyze system architecture based on research reports, output project architecture research documentation"
                    .to_string(),

            opening_instruction: "The following research reports are provided for analyzing the system architecture:".to_string(),

            closing_instruction: r#"
## Analysis Requirements:
- Draw system architecture diagram based on the provided project information and research materials
- Use mermaid format to represent architecture relationships
- Highlight core components and interaction patterns"#
                .to_string(),

            llm_call_mode: LLMCallMode::PromptWithTools, // Use prompt mode
            formatter_config: FormatterConfig::default(),
        }
    }
}