feat(rag): Implement RAG engine, configuration schema, and vector store integration

This commit is contained in:
2026-05-04 05:38:23 -04:00
parent 5a1c157295
commit e80cd6bd3f
5 changed files with 236 additions and 0 deletions
+11
View File
@@ -201,6 +201,7 @@ class AppController:
self._pending_actions: Dict[str, ConfirmDialog] = {}
self._pending_ask_dialog: bool = False
self.mcp_config: models.MCPConfiguration = models.MCPConfiguration()
self.rag_config: Optional[models.RAGConfig] = None
# AI settings state
self._current_provider: str = "gemini"
self._current_model: str = "gemini-2.5-flash-lite"
@@ -948,6 +949,12 @@ class AppController:
else:
self.mcp_config = models.MCPConfiguration()
rag_data = self.config.get('rag')
if rag_data:
self.rag_config = models.RAGConfig.from_dict(rag_data)
else:
self.rag_config = models.RAGConfig()
from src.personas import PersonaManager
self.persona_manager = PersonaManager(Path(self.active_project_path).parent if self.active_project_path else None)
self.personas = self.persona_manager.load_all()
@@ -2526,6 +2533,10 @@ class AppController:
self.config["ai"]["system_prompt"] = self.ui_global_system_prompt
self.config["ai"]["base_system_prompt"] = self.ui_base_system_prompt
self.config["ai"]["use_default_base_prompt"] = self.ui_use_default_base_prompt
if self.rag_config:
self.config["rag"] = self.rag_config.to_dict()
self.config["projects"] = {"paths": self.project_paths, "active": self.active_project_path}
from src import bg_shader
# Update gui section while preserving other keys like bg_shader_enabled