feat: add agent loop and context builder

Agent loop runs on Core 1: pops inbound messages, builds system
prompt from bootstrap files + memory, calls Claude API, saves
session, pushes response to outbound queue. PSRAM-allocated buffers.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
crispyberry
2026-02-05 18:55:38 +08:00
parent cbd137c3fa
commit 0c517b734f
4 changed files with 235 additions and 0 deletions

14
main/agent/agent_loop.h Normal file
View File

@@ -0,0 +1,14 @@
#pragma once
#include "esp_err.h"
/**
* Initialize the agent loop.
*/
esp_err_t agent_loop_init(void);
/**
* Start the agent loop task (runs on Core 1).
* Consumes from inbound queue, calls Claude API, pushes to outbound queue.
*/
esp_err_t agent_loop_start(void);