class HybridAISystem: def __init__(self, rag_system, agent_system): self.rag = rag_system self.agent = agent_system self.router = TaskRouter() def process_request(self, request): task_type = self.router.classify_request(request) if task_type == "information_lookup": return self.rag.process_query(request) elif task_type == "workflow_execution": return self.agent.execute_workflow(request) else: # Complex hybrid workflow context = self.rag.gather_context(request) return self.agent.execute_with_context(request, context) __ __