# jabrennem/juno-agent-sdk architecture

> Architecture diagram of the GitHub repository jabrennem/juno-agent-sdk, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jabrennem/juno-agent-sdk
- Repository: https://github.com/jabrennem/juno-agent-sdk

## Overview

Juno is a C++ SDK for embedding tool-using agents in native applications. The main workflow accepts a user turn, runs a conversation through a model, dispatches requested tools, and returns streamed events and a final response. Optional capabilities include steering, memory, context compaction, and saved sessions; TerminalHarness adds an interactive interface and session commands. The README documents the Weather Agent and its live forecast tool. Source excerpts are incomplete, so links not directly evidenced are omitted or marked unverified.

Main entry points: [`src/terminal_harness.cpp`](https://github.com/jabrennem/juno-agent-sdk/blob/main/src/terminal_harness.cpp) (Terminal harness), [`src/agent.cpp`](https://github.com/jabrennem/juno-agent-sdk/blob/main/src/agent.cpp) (Agent runtime), [`src/memory.cpp`](https://github.com/jabrennem/juno-agent-sdk/blob/main/src/memory.cpp) (Memory manager), [`include/juno_sdk/session_store.hpp`](https://github.com/jabrennem/juno-agent-sdk/blob/main/include/juno_sdk/session_store.hpp) (Session storage)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_conversation["Agent conversations"]
  node_agent["Agent runtime<br/>[agent.cpp]"]
  node_conversation_api["Conversation API<br/>[agent.hpp]"]
  node_tool_api["Tool handlers<br/>[agent.hpp]"]
  node_steering["Steering documents<br/>[agent.hpp]"]
  node_types["Conversation types<br/>[types.hpp]"]
  node_expected["Error results<br/>[expected.hpp]"]
end

subgraph group_inference["Model inference"]
  node_model_api["Model interface<br/>[model.hpp]"]
  node_llama["llama.cpp backend"]
end

subgraph group_state["Memory and sessions"]
  node_memory_manager["Memory manager<br/>[memory.cpp]"]
  node_memory_store[("Memory stores<br/>[memory.hpp]")]
  node_session_api["Session storage<br/>[session_store.hpp]"]
  node_session_store[("Session checkpoints<br/>[session_store.cpp]")]
end

subgraph group_terminal["Terminal interface"]
  node_harness_api["Terminal harness"]
  node_markdown["Markdown renderer"]
  node_thinking["Thinking animation"]
end

node_user(("App user"))
node_weather_tool["Forecast tool<br/>[weather_agent.cpp]"]
node_open_meteo(("Open-Meteo"))

node_user -->|"enters prompt"| node_harness_api
node_harness_api -->|"runs turn"| node_conversation_api
node_agent -->|"requests generation"| node_model_api
node_llama -->|"implements"| node_model_api
node_agent -->|"dispatches calls"| node_tool_api
node_agent -.->|"uses guidance"| node_steering
node_agent -.->|"uses memory"| node_memory_manager
node_memory_manager -->|"delegates operations"| node_memory_store
node_harness_api -->|"manages saved sessions"| node_session_api
node_session_api -->|"implements storage"| node_session_store
node_harness_api -->|"renders responses"| node_markdown
node_harness_api -->|"animates status"| node_thinking
node_weather_tool -->|"fetches forecasts"| node_open_meteo

click node_agent "https://github.com/jabrennem/juno-agent-sdk/blob/main/src/agent.cpp"
click node_conversation_api "https://github.com/jabrennem/juno-agent-sdk/blob/main/include/juno_sdk/agent.hpp"
click node_tool_api "https://github.com/jabrennem/juno-agent-sdk/blob/main/include/juno_sdk/agent.hpp"
click node_steering "https://github.com/jabrennem/juno-agent-sdk/blob/main/include/juno_sdk/agent.hpp"
click node_types "https://github.com/jabrennem/juno-agent-sdk/blob/main/include/juno_sdk/types.hpp"
click node_expected "https://github.com/jabrennem/juno-agent-sdk/blob/main/include/juno_sdk/expected.hpp"
click node_model_api "https://github.com/jabrennem/juno-agent-sdk/blob/main/include/juno_sdk/model.hpp"
click node_llama "https://github.com/jabrennem/juno-agent-sdk/blob/main/src/llama_cpp_model.cpp"
click node_memory_manager "https://github.com/jabrennem/juno-agent-sdk/blob/main/src/memory.cpp"
click node_memory_store "https://github.com/jabrennem/juno-agent-sdk/blob/main/include/juno_sdk/memory.hpp"
click node_session_api "https://github.com/jabrennem/juno-agent-sdk/blob/main/include/juno_sdk/session_store.hpp"
click node_session_store "https://github.com/jabrennem/juno-agent-sdk/blob/main/src/session_store.cpp"
click node_harness_api "https://github.com/jabrennem/juno-agent-sdk/blob/main/src/terminal_harness.cpp"
click node_markdown "https://github.com/jabrennem/juno-agent-sdk/blob/main/src/terminal_markdown.cpp"
click node_thinking "https://github.com/jabrennem/juno-agent-sdk/blob/main/src/terminal_thinking_animation.hpp"
click node_weather_tool "https://github.com/jabrennem/juno-agent-sdk/blob/main/examples/weather_agent/weather_agent.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_agent,node_conversation_api,node_tool_api,node_steering,node_types,node_expected,node_user toneBlue
class node_model_api,node_llama toneAmber
class node_memory_manager,node_memory_store,node_session_api,node_session_store toneMint
class node_harness_api,node_markdown,node_thinking toneRose
class node_weather_tool toneTeal
class node_open_meteo toneIndigo
```

## Components

### Agent conversations

- [Agent runtime](https://github.com/jabrennem/juno-agent-sdk/blob/main/src/agent.cpp): `src/agent.cpp`
- [Conversation API](https://github.com/jabrennem/juno-agent-sdk/blob/main/include/juno_sdk/agent.hpp): `include/juno_sdk/agent.hpp`
- [Tool handlers](https://github.com/jabrennem/juno-agent-sdk/blob/main/include/juno_sdk/agent.hpp): `include/juno_sdk/agent.hpp`
- [Steering documents](https://github.com/jabrennem/juno-agent-sdk/blob/main/include/juno_sdk/agent.hpp): `include/juno_sdk/agent.hpp`
- [Conversation types](https://github.com/jabrennem/juno-agent-sdk/blob/main/include/juno_sdk/types.hpp): `include/juno_sdk/types.hpp`
- [Error results](https://github.com/jabrennem/juno-agent-sdk/blob/main/include/juno_sdk/expected.hpp): `include/juno_sdk/expected.hpp`

### Model inference

- [Model interface](https://github.com/jabrennem/juno-agent-sdk/blob/main/include/juno_sdk/model.hpp): `include/juno_sdk/model.hpp`
- [llama.cpp backend](https://github.com/jabrennem/juno-agent-sdk/blob/main/src/llama_cpp_model.cpp): `src/llama_cpp_model.cpp`

### Memory and sessions

- [Memory manager](https://github.com/jabrennem/juno-agent-sdk/blob/main/src/memory.cpp): `src/memory.cpp`
- [Memory stores](https://github.com/jabrennem/juno-agent-sdk/blob/main/include/juno_sdk/memory.hpp): `include/juno_sdk/memory.hpp`
- [Session storage](https://github.com/jabrennem/juno-agent-sdk/blob/main/include/juno_sdk/session_store.hpp): `include/juno_sdk/session_store.hpp`
- [Session checkpoints](https://github.com/jabrennem/juno-agent-sdk/blob/main/src/session_store.cpp): `src/session_store.cpp`

### Terminal interface

- [Terminal harness](https://github.com/jabrennem/juno-agent-sdk/blob/main/src/terminal_harness.cpp): `src/terminal_harness.cpp`
- [Markdown renderer](https://github.com/jabrennem/juno-agent-sdk/blob/main/src/terminal_markdown.cpp): `src/terminal_markdown.cpp`
- [Thinking animation](https://github.com/jabrennem/juno-agent-sdk/blob/main/src/terminal_thinking_animation.hpp): `src/terminal_thinking_animation.hpp`

### Other components

- **App user**
- [Forecast tool](https://github.com/jabrennem/juno-agent-sdk/blob/main/examples/weather_agent/weather_agent.cpp): `examples/weather_agent/weather_agent.cpp`
- **Open-Meteo**

## Connections

- App user → Terminal harness: enters prompt (evidence: `README.md`)
- Terminal harness → Conversation API: runs turn (evidence: `src/terminal_harness.cpp`)
- Agent runtime → Model interface: requests generation (evidence: `README.md`)
- llama.cpp backend → Model interface: implements
- Agent runtime → Tool handlers: dispatches calls (evidence: `README.md`)
- Agent runtime → Steering documents: uses guidance (evidence: `src/agent.cpp`)
- Agent runtime → Memory manager: uses memory
- Memory manager → Memory stores: delegates operations (evidence: `include/juno_sdk/memory.hpp`)
- Terminal harness → Session storage: manages saved sessions
- Session storage → Session checkpoints: implements storage (evidence: `src/session_store.cpp`)
- Terminal harness → Markdown renderer: renders responses (evidence: `src/terminal_harness.cpp`)
- Terminal harness → Thinking animation: animates status (evidence: `src/terminal_harness.cpp`)
- Forecast tool → Open-Meteo: fetches forecasts (evidence: `README.md`)
