# liveloveapp/hashbrown architecture

> Architecture diagram of the GitHub repository liveloveapp/hashbrown, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/liveloveapp/hashbrown
- Repository: https://github.com/liveloveapp/hashbrown

## Overview

Hashbrown is a headless TypeScript framework for streaming AI chat and agents in React and Angular, with provider adapters and a .NET server integration. The main workflow is to configure a framework client, submit a run, stream model events through a provider or local transport, and render the resulting messages or registered UI components; tools and structured schemas extend that flow. Provider and framework internals are mostly unsampled, so those links follow explicit README descriptions. The .NET session and recovery areas are represented as subsystems where the tree supports them.

Main entry points: [`packages/core/src/transport`](https://github.com/liveloveapp/hashbrown/tree/main/packages/core/src/transport) (AG-UI transports), [`packages/react/src/hooks`](https://github.com/liveloveapp/hashbrown/tree/main/packages/react/src/hooks) (React hooks), [`packages/angular/src/resources`](https://github.com/liveloveapp/hashbrown/tree/main/packages/angular/src/resources) (Angular resources), [`packages/dotnet/src/NativeSessionContext.cs`](https://github.com/liveloveapp/hashbrown/blob/main/packages/dotnet/src/NativeSessionContext.cs) (Native sessions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Framework clients"]
  node_react["React hooks"]
  node_angular["Angular resources"]
  node_components["UI components"]
end

subgraph group_core["Core runtime"]
  node_schema["Skillet schemas<br/>[base.ts]"]
  node_runtime["Runtime and tools"]
  node_chat["Chat runtime<br/>[chat-runtime.ts]"]
  node_transport["AG-UI transports"]
  node_webllm["WebLLM transport"]
  node_webllmrun["WebLLM run stream<br/>[webllm-run.ts]"]
  node_eventstream["Local event stream"]
  node_runinput["Run input parsing"]
  node_toolmessages["WebLLM tool mapping"]
end

subgraph group_providers["Model providers"]
  node_openai["OpenAI adapter"]
  node_anthropic["Anthropic adapter"]
  node_google["Google adapter"]
  node_bedrock["Bedrock adapter"]
  node_azure["Azure adapter"]
  node_ollama["Ollama adapter"]
end

subgraph group_dotnet[".NET integration"]
  node_endpoint["Endpoint configuration"]
  node_requestclient["Request client"]
  node_nativesession["Native sessions"]
  node_recovery["Session recovery"]
  node_sessionhistory["Session history"]
  node_toolcatalog["Native tool catalog"]
end

node_developer(("App developer"))
node_model(("Model provider"))

node_developer -->|"configures hooks"| node_react
node_developer -->|"configures resources"| node_angular
node_react -->|"submits runs"| node_transport
node_angular -->|"submits runs"| node_transport
node_react -->|"renders output"| node_components
node_angular -->|"renders output"| node_components
node_react -->|"defines typed output"| node_schema
node_angular -->|"defines typed output"| node_schema
node_react -->|"registers tools"| node_runtime
node_angular -->|"registers tools"| node_runtime
node_transport -->|"streams requests"| node_openai
node_transport -->|"streams requests"| node_anthropic
node_transport -->|"streams requests"| node_google
node_transport -->|"streams requests"| node_bedrock
node_transport -->|"streams requests"| node_azure
node_transport -->|"streams requests"| node_ollama
node_openai -->|"calls model"| node_model
node_anthropic -->|"calls model"| node_model
node_google -->|"calls model"| node_model
node_bedrock -->|"calls model"| node_model
node_azure -->|"calls model"| node_model
node_ollama -->|"calls model"| node_model
node_webllm -->|"reads run metadata"| node_runinput
node_webllm -->|"creates run"| node_webllmrun
node_webllm -->|"creates event stream"| node_eventstream
node_toolmessages -->|"converts JSON schema"| node_schema
node_endpoint -->|"configures client"| node_requestclient
node_nativesession -->|"admits recovery"| node_recovery
node_nativesession -->|"uses history"| node_sessionhistory
node_nativesession -->|"checks tool policy"| node_toolcatalog
node_requestclient -->|"captures tool calls"| node_nativesession

click node_react "https://github.com/liveloveapp/hashbrown/tree/main/packages/react/src/hooks"
click node_angular "https://github.com/liveloveapp/hashbrown/tree/main/packages/angular/src/resources"
click node_components "https://github.com/liveloveapp/hashbrown/tree/main/packages/core/src/ui"
click node_schema "https://github.com/liveloveapp/hashbrown/blob/main/packages/core/src/schema/base.ts"
click node_runtime "https://github.com/liveloveapp/hashbrown/tree/main/packages/core/src/runtime"
click node_chat "https://github.com/liveloveapp/hashbrown/blob/main/packages/core/src/chat-runtime.ts"
click node_transport "https://github.com/liveloveapp/hashbrown/tree/main/packages/core/src/transport"
click node_webllm "https://github.com/liveloveapp/hashbrown/blob/main/packages/core/src/transport/experimental-webllm-transport.ts"
click node_webllmrun "https://github.com/liveloveapp/hashbrown/blob/main/packages/core/src/transport/webllm-run.ts"
click node_eventstream "https://github.com/liveloveapp/hashbrown/blob/main/packages/core/src/transport/local-text-event-stream.ts"
click node_runinput "https://github.com/liveloveapp/hashbrown/blob/main/packages/core/src/transport/hashbrown-run-agent-input.ts"
click node_toolmessages "https://github.com/liveloveapp/hashbrown/blob/main/packages/core/src/transport/webllm-tool-messages.ts"
click node_openai "https://github.com/liveloveapp/hashbrown/tree/main/packages/openai/src/stream"
click node_anthropic "https://github.com/liveloveapp/hashbrown/tree/main/packages/anthropic/src/stream"
click node_google "https://github.com/liveloveapp/hashbrown/tree/main/packages/google/src/stream"
click node_bedrock "https://github.com/liveloveapp/hashbrown/tree/main/packages/bedrock/src/stream"
click node_azure "https://github.com/liveloveapp/hashbrown/tree/main/packages/azure/src/stream"
click node_ollama "https://github.com/liveloveapp/hashbrown/tree/main/packages/ollama/src/stream"
click node_endpoint "https://github.com/liveloveapp/hashbrown/blob/main/packages/dotnet/src/HashbrownEndpointConfiguration.cs"
click node_requestclient "https://github.com/liveloveapp/hashbrown/blob/main/packages/dotnet/src/HashbrownRequestClient.cs"
click node_nativesession "https://github.com/liveloveapp/hashbrown/blob/main/packages/dotnet/src/NativeSessionContext.cs"
click node_recovery "https://github.com/liveloveapp/hashbrown/blob/main/packages/dotnet/src/NativeBrowserRecoveryAdmission.cs"
click node_sessionhistory "https://github.com/liveloveapp/hashbrown/blob/main/packages/dotnet/src/NativeSessionHistory.cs"
click node_toolcatalog "https://github.com/liveloveapp/hashbrown/blob/main/packages/dotnet/src/NativeToolCatalog.cs"

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_react,node_angular,node_components toneBlue
class node_schema,node_runtime,node_chat,node_transport,node_webllm,node_webllmrun,node_eventstream,node_runinput,node_toolmessages toneAmber
class node_openai,node_anthropic,node_google,node_bedrock,node_azure,node_ollama toneMint
class node_endpoint,node_requestclient,node_nativesession,node_recovery,node_sessionhistory,node_toolcatalog toneRose
class node_developer,node_model toneIndigo
```

## Components

### Framework clients

- [React hooks](https://github.com/liveloveapp/hashbrown/tree/main/packages/react/src/hooks): `packages/react/src/hooks`
- [Angular resources](https://github.com/liveloveapp/hashbrown/tree/main/packages/angular/src/resources): `packages/angular/src/resources`
- [UI components](https://github.com/liveloveapp/hashbrown/tree/main/packages/core/src/ui): `packages/core/src/ui`

### Core runtime

- [Skillet schemas](https://github.com/liveloveapp/hashbrown/blob/main/packages/core/src/schema/base.ts): `packages/core/src/schema/base.ts`
- [Runtime and tools](https://github.com/liveloveapp/hashbrown/tree/main/packages/core/src/runtime): `packages/core/src/runtime`
- [Chat runtime](https://github.com/liveloveapp/hashbrown/blob/main/packages/core/src/chat-runtime.ts): `packages/core/src/chat-runtime.ts`
- [AG-UI transports](https://github.com/liveloveapp/hashbrown/tree/main/packages/core/src/transport): `packages/core/src/transport`
- [WebLLM transport](https://github.com/liveloveapp/hashbrown/blob/main/packages/core/src/transport/experimental-webllm-transport.ts): `packages/core/src/transport/experimental-webllm-transport.ts`
- [WebLLM run stream](https://github.com/liveloveapp/hashbrown/blob/main/packages/core/src/transport/webllm-run.ts): `packages/core/src/transport/webllm-run.ts`
- [Local event stream](https://github.com/liveloveapp/hashbrown/blob/main/packages/core/src/transport/local-text-event-stream.ts): `packages/core/src/transport/local-text-event-stream.ts`
- [Run input parsing](https://github.com/liveloveapp/hashbrown/blob/main/packages/core/src/transport/hashbrown-run-agent-input.ts): `packages/core/src/transport/hashbrown-run-agent-input.ts`
- [WebLLM tool mapping](https://github.com/liveloveapp/hashbrown/blob/main/packages/core/src/transport/webllm-tool-messages.ts): `packages/core/src/transport/webllm-tool-messages.ts`

### Model providers

- [OpenAI adapter](https://github.com/liveloveapp/hashbrown/tree/main/packages/openai/src/stream): `packages/openai/src/stream`
- [Anthropic adapter](https://github.com/liveloveapp/hashbrown/tree/main/packages/anthropic/src/stream): `packages/anthropic/src/stream`
- [Google adapter](https://github.com/liveloveapp/hashbrown/tree/main/packages/google/src/stream): `packages/google/src/stream`
- [Bedrock adapter](https://github.com/liveloveapp/hashbrown/tree/main/packages/bedrock/src/stream): `packages/bedrock/src/stream`
- [Azure adapter](https://github.com/liveloveapp/hashbrown/tree/main/packages/azure/src/stream): `packages/azure/src/stream`
- [Ollama adapter](https://github.com/liveloveapp/hashbrown/tree/main/packages/ollama/src/stream): `packages/ollama/src/stream`

### .NET integration

- [Endpoint configuration](https://github.com/liveloveapp/hashbrown/blob/main/packages/dotnet/src/HashbrownEndpointConfiguration.cs): `packages/dotnet/src/HashbrownEndpointConfiguration.cs`
- [Request client](https://github.com/liveloveapp/hashbrown/blob/main/packages/dotnet/src/HashbrownRequestClient.cs): `packages/dotnet/src/HashbrownRequestClient.cs`
- [Native sessions](https://github.com/liveloveapp/hashbrown/blob/main/packages/dotnet/src/NativeSessionContext.cs): `packages/dotnet/src/NativeSessionContext.cs`
- [Session recovery](https://github.com/liveloveapp/hashbrown/blob/main/packages/dotnet/src/NativeBrowserRecoveryAdmission.cs): `packages/dotnet/src/NativeBrowserRecoveryAdmission.cs`
- [Session history](https://github.com/liveloveapp/hashbrown/blob/main/packages/dotnet/src/NativeSessionHistory.cs): `packages/dotnet/src/NativeSessionHistory.cs`
- [Native tool catalog](https://github.com/liveloveapp/hashbrown/blob/main/packages/dotnet/src/NativeToolCatalog.cs): `packages/dotnet/src/NativeToolCatalog.cs`

### Other components

- **App developer**
- **Model provider**

## Connections

- App developer → React hooks: configures hooks (evidence: `README.md`)
- App developer → Angular resources: configures resources (evidence: `README.md`)
- React hooks → AG-UI transports: submits runs (evidence: `README.md`)
- Angular resources → AG-UI transports: submits runs (evidence: `README.md`)
- React hooks → UI components: renders output (evidence: `README.md`)
- Angular resources → UI components: renders output (evidence: `README.md`)
- React hooks → Skillet schemas: defines typed output (evidence: `README.md`)
- Angular resources → Skillet schemas: defines typed output (evidence: `README.md`)
- React hooks → Runtime and tools: registers tools (evidence: `README.md`)
- Angular resources → Runtime and tools: registers tools (evidence: `README.md`)
- AG-UI transports → OpenAI adapter: streams requests (evidence: `README.md`)
- AG-UI transports → Anthropic adapter: streams requests (evidence: `README.md`)
- AG-UI transports → Google adapter: streams requests (evidence: `README.md`)
- AG-UI transports → Bedrock adapter: streams requests (evidence: `README.md`)
- AG-UI transports → Azure adapter: streams requests (evidence: `README.md`)
- AG-UI transports → Ollama adapter: streams requests (evidence: `README.md`)
- OpenAI adapter → Model provider: calls model (evidence: `README.md`)
- Anthropic adapter → Model provider: calls model (evidence: `README.md`)
- Google adapter → Model provider: calls model (evidence: `README.md`)
- Bedrock adapter → Model provider: calls model (evidence: `README.md`)
- Azure adapter → Model provider: calls model (evidence: `README.md`)
- Ollama adapter → Model provider: calls model (evidence: `README.md`)
- WebLLM transport → Run input parsing: reads run metadata (evidence: `packages/core/src/transport/experimental-webllm-transport.ts`)
- WebLLM transport → WebLLM run stream: creates run (evidence: `packages/core/src/transport/experimental-webllm-transport.ts`)
- WebLLM transport → Local event stream: creates event stream (evidence: `packages/core/src/transport/experimental-webllm-transport.ts`)
- WebLLM tool mapping → Skillet schemas: converts JSON schema (evidence: `packages/core/src/transport/webllm-tool-messages.ts`)
- Endpoint configuration → Request client: configures client (evidence: `packages/dotnet/src/HashbrownEndpointConfiguration.cs`)
- Native sessions → Session recovery: admits recovery (evidence: `packages/dotnet/src/NativeSessionContext.cs`)
- Native sessions → Session history: uses history (evidence: `packages/dotnet/src/NativeSessionContext.cs`)
- Native sessions → Native tool catalog: checks tool policy (evidence: `packages/dotnet/src/NativeSessionContext.cs`)
- Request client → Native sessions: captures tool calls (evidence: `packages/dotnet/src/HashbrownRequestClient.cs`)
