pub struct ResearchManager { /* private fields */ }Expand description
Central coordinator for research operations
The ResearchManager orchestrates all analysis components and manages the research lifecycle. It provides the main public API for research queries.
Implementations§
Source§impl ResearchManager
impl ResearchManager
Sourcepub fn with_config(
project_analyzer: ProjectAnalyzer,
pattern_detector: PatternDetector,
standards_detector: StandardsDetector,
architectural_intent_tracker: ArchitecturalIntentTracker,
context_builder: ContextBuilder,
dependency_analyzer: DependencyAnalyzer,
cache_manager: CacheManager,
) -> Self
pub fn with_config( project_analyzer: ProjectAnalyzer, pattern_detector: PatternDetector, standards_detector: StandardsDetector, architectural_intent_tracker: ArchitecturalIntentTracker, context_builder: ContextBuilder, dependency_analyzer: DependencyAnalyzer, cache_manager: CacheManager, ) -> Self
Create a new ResearchManager with custom configuration
Sourcepub async fn analyze_project(
&self,
root: &Path,
) -> Result<ProjectContext, ResearchError>
pub async fn analyze_project( &self, root: &Path, ) -> Result<ProjectContext, ResearchError>
Analyze a project and gather comprehensive context
This method performs a multi-stage analysis:
- Detect project type
- Scan codebase and build semantic index
- Detect patterns
- Detect standards and conventions
- Analyze dependencies
- Track architectural intent
§Arguments
root- Root path of the project to analyze
§Returns
A ProjectContext containing all gathered information, or a ResearchError
Sourcepub async fn search_codebase(
&self,
query: &str,
semantic_index: &SemanticIndex,
) -> Result<Vec<SearchResult>, ResearchError>
pub async fn search_codebase( &self, query: &str, semantic_index: &SemanticIndex, ) -> Result<Vec<SearchResult>, ResearchError>
Search the codebase for symbols and patterns
Performs semantic search across the indexed codebase to find symbols, references, and patterns matching the query.
§Arguments
query- Search query stringsemantic_index- The semantic index to search
§Returns
A vector of search results, or a ResearchError
Sourcepub async fn get_context_for_query(
&self,
query: &str,
all_files: Vec<FileContext>,
) -> Result<CodeContext, ResearchError>
pub async fn get_context_for_query( &self, query: &str, all_files: Vec<FileContext>, ) -> Result<CodeContext, ResearchError>
Get context for a specific query
Automatically selects and prioritizes relevant files based on the query. This method combines semantic search with relevance scoring to provide the most relevant context for AI providers.
§Arguments
query- Query string describing what context is neededall_files- All available files to select from
§Returns
A CodeContext with relevant files and symbols, or a ResearchError
Sourcepub fn get_cache_statistics(&self) -> Result<CacheStatistics, ResearchError>
pub fn get_cache_statistics(&self) -> Result<CacheStatistics, ResearchError>
Get cache statistics
§Returns
Cache statistics including hit rate, miss rate, and size, or a ResearchError
Sourcepub fn clear_cache(&self) -> Result<(), ResearchError>
pub fn clear_cache(&self) -> Result<(), ResearchError>
Trait Implementations§
Source§impl Clone for ResearchManager
impl Clone for ResearchManager
Source§fn clone(&self) -> ResearchManager
fn clone(&self) -> ResearchManager
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more