deepwiki-rs 1.2.8

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 serde_json::Value;
use crate::generator::context::GeneratorContext;

pub struct MemoryScope;

impl MemoryScope {
    pub const STUDIES_RESEARCH: &'static str = "studies_research";
}

pub trait MemoryRetriever {
    async fn store_research(&self, agent_type: &str, result: Value) -> anyhow::Result<()>;

    async fn get_research(&self, agent_type: &str) -> Option<Value>;
}

impl MemoryRetriever for GeneratorContext {
    /// Store research results
    async fn store_research(&self, agent_type: &str, result: Value) -> anyhow::Result<()> {
        self.store_to_memory(MemoryScope::STUDIES_RESEARCH, agent_type, result).await
    }

    /// Get research results
    async fn get_research(&self, agent_type: &str) -> Option<Value> {
        self.get_from_memory(MemoryScope::STUDIES_RESEARCH, agent_type).await
    }
}