use crate::generator::research::memory::MemoryScope;
use crate::generator::research::types::AgentType;
use crate::generator::step_forward_agent::{
AgentDataConfig, DataSource, FormatterConfig, LLMCallMode, PromptTemplate, StepForwardAgent,
};
#[derive(Default)]
pub struct ArchitectureResearcher;
impl StepForwardAgent for ArchitectureResearcher {
type Output = String;
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, formatter_config: FormatterConfig::default(),
}
}
}