Skip to content

Latest commit

 

History

History
29 lines (24 loc) · 1.27 KB

File metadata and controls

29 lines (24 loc) · 1.27 KB
title Architecture
description Core architecture and runtime flow

The system is based on a loop that runs at a fixed frequency of self.config.hertz. This loop looks for the most recent data from various sources, fuses the data into a prompt, sends that prompt to one or more LLMs, and then sends the LLM responses to virtual agents or physical robots.

Specific runtime flow:

  1. Input plugins collect sensor data (vision, audio, social media, etc.)
  2. The Fuser combines inputs into a prompt
  3. The LLM generates commands based on the prompt
  4. The ActionOrchestrator executes commands through actions
  5. Connectors map OM1 data/commands to external data buses and data distribution systems such as custom APIs, ROS2, Zenoh, or CycloneDDS.
# /src/runtime/cortex.py
async def _run_cortex_loop(self) -> None:
    while True:
        await asyncio.sleep(1 / self.config.hertz)
        await self._tick()

async def _tick(self) -> None:
    finished_promises, _ = await self.action_orchestrator.flush_promises()
    prompt = self.fuser.fuse(self.config.agent_inputs, finished_promises)
    output = await self.config.cortex_llm.ask(prompt)
    logging.debug("I'm thinking... ", output)
    await self.action_orchestrator.promise(output.commands)