agentglow 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,141 @@
1
+ # agentglow
2
+
3
+ **Live 3D views of agent systems, as a React component.** Every agent your system spawns appears as a
4
+ living shape (a neuron, a bee, a star, a tree, a flight…): it's born when its span starts, thinks while it
5
+ calls the LLM, waits on MCP servers, passes messages to other agents, and fades out when its span ends.
6
+ It is driven only by OpenTelemetry, via the [`agentglow`](https://github.com/Nideesh1/agentglow#quickstart)
7
+ Python server, so it works with LangGraph, deepagents, LangChain and anything else that emits OTel spans.
8
+
9
+ ![neural theme](https://raw.githubusercontent.com/Nideesh1/agentglow/main/docs/media/hero.gif)
10
+
11
+ ## Install
12
+
13
+ ```bash
14
+ npm i agentglow
15
+ ```
16
+
17
+ Requires React 19. `three`, `@react-three/fiber`, `@react-three/drei` and `@react-three/postprocessing` are
18
+ regular dependencies (installed for you, and deduped against your own copies when versions match), so a
19
+ project that already uses react-three-fiber v9 doesn't end up with two copies of three.js.
20
+
21
+ ## Run the server
22
+
23
+ ```bash
24
+ pip install agentglow
25
+ agentglow serve # http://localhost:8100
26
+ ```
27
+
28
+ ```python
29
+ import agentglow
30
+ agentglow.watch() # before your agents run
31
+ ```
32
+
33
+ See the [Python quickstart](https://github.com/Nideesh1/agentglow#quickstart) for details.
34
+
35
+ ## Use
36
+
37
+ ```tsx
38
+ import { AgentScene } from "agentglow";
39
+
40
+ export default function Page() {
41
+ return (
42
+ <div style={{ height: 600 }}>
43
+ <AgentScene theme="neural" source="http://localhost:8100" />
44
+ </div>
45
+ );
46
+ }
47
+ ```
48
+
49
+ The scene fills its container, so give the container a height. Styles load automatically when you import the
50
+ package. If your bundler drops CSS imported from `node_modules`, import them yourself:
51
+ `import "agentglow/style.css"`.
52
+
53
+ No server yet? `<AgentScene theme="orbit" sim />` runs the built-in simulator. If `source` can't be
54
+ reached, the scene falls back to the simulator on its own and shows a "simulated" badge.
55
+
56
+ ### Next.js
57
+
58
+ The package is marked `"use client"`, so you can import it straight into an App Router page. To skip server
59
+ rendering of the WebGL canvas entirely, load it with `dynamic`:
60
+
61
+ ```tsx
62
+ "use client";
63
+ import dynamic from "next/dynamic";
64
+
65
+ const AgentScene = dynamic(() => import("agentglow").then((m) => m.AgentScene), { ssr: false });
66
+
67
+ export default function Live() {
68
+ return <AgentScene theme="subway" source="http://localhost:8100" style={{ height: "80vh" }} />;
69
+ }
70
+ ```
71
+
72
+ ## Props
73
+
74
+ | Prop | Type | Default | What it does |
75
+ |-------------|-----------------------|------------|--------------|
76
+ | `theme` | `Theme` | `"neural"` | Which view to render (see below). Each theme loads lazily as its own chunk. |
77
+ | `source` | `string` | `""` | Base URL of the agentglow server. `""` means same origin. The scene reads `${source}/live/stream` (SSE), `/live/graph` and `/live/health`. |
78
+ | `hud` | `boolean` | `true` | Show the glass HUD: counts, event ticker and the agent inspector panel. |
79
+ | `sim` | `boolean` | `false` | Use the built-in simulator instead of a server. |
80
+ | `style` | `CSSProperties` | none | Applied to the container (set a `height` here or on a parent). |
81
+ | `className` | `string` | none | Added to the container. |
82
+
83
+ The package also exports `THEMES` (the list of theme ids), `THEME_INFO` (names and one-liners) and the
84
+ `WorldEvent` type (the event contract streamed by the server).
85
+
86
+ If the server exposes `POST /live/run`, the HUD shows a **Run agents** button. Otherwise the button stays hidden.
87
+
88
+ A cross-origin `source` requires the server to send CORS headers for `/live/*`.
89
+
90
+ ## Themes
91
+
92
+ | Theme | Picture |
93
+ |-----------|---------|
94
+ | `orbit` | Agents orbit a graph galaxy. Runs are rings and MCP servers are satellites. |
95
+ | `neural` | A living brain. Agents fire as neurons and messages pulse along synapses. |
96
+ | `subway` | A neon transit map. Each run is a line and each agent is a train. |
97
+ | `city` | A night city. Agents rise as skyscrapers in run districts. |
98
+ | `ocean` | Bioluminescent jellyfish drift on run currents over a coral graph. |
99
+ | `circuit` | Agent chips sit on run buses, wired to a memory bank and MCP I/O ports. |
100
+ | `tunnel` | A time warp. Runs are lanes and gates, and agents are ships. |
101
+ | `flow` | A murmuration. Agents condense as eddies out of the current. |
102
+ | `hive` | A glowing honeycomb. Agents are bees; subagents fly out as workers. |
103
+ | `forest` | A moonlit forest. Agents grow as trees, subagents as saplings, LLM calls as fireflies. |
104
+ | `constellation` | A night sky. Delegation draws constellation lines between agent stars. |
105
+ | `factory` | A neon factory floor. Agents are machines; work rides conveyor belts. |
106
+ | `airport` | A radar scope. Agents are flights; handoffs are flight paths. |
107
+ | `mycelium`| A glowing fungal network. Agents bloom as mushrooms on spreading threads. |
108
+ | `atom` | An atom. Agents are electrons; subagents orbit their parent. |
109
+
110
+ | | | |
111
+ |:-:|:-:|:-:|
112
+ | ![neural](https://raw.githubusercontent.com/Nideesh1/agentglow/main/docs/media/neural.jpg) **neural** | ![hive](https://raw.githubusercontent.com/Nideesh1/agentglow/main/docs/media/hive.jpg) **hive** | ![constellation](https://raw.githubusercontent.com/Nideesh1/agentglow/main/docs/media/constellation.jpg) **constellation** |
113
+ | ![orbit](https://raw.githubusercontent.com/Nideesh1/agentglow/main/docs/media/orbit.jpg) **orbit** | ![forest](https://raw.githubusercontent.com/Nideesh1/agentglow/main/docs/media/forest.jpg) **forest** | ![mycelium](https://raw.githubusercontent.com/Nideesh1/agentglow/main/docs/media/mycelium.jpg) **mycelium** |
114
+ | ![atom](https://raw.githubusercontent.com/Nideesh1/agentglow/main/docs/media/atom.jpg) **atom** | ![airport](https://raw.githubusercontent.com/Nideesh1/agentglow/main/docs/media/airport.jpg) **airport** | ![factory](https://raw.githubusercontent.com/Nideesh1/agentglow/main/docs/media/factory.jpg) **factory** |
115
+ | ![city](https://raw.githubusercontent.com/Nideesh1/agentglow/main/docs/media/city.jpg) **city** | ![ocean](https://raw.githubusercontent.com/Nideesh1/agentglow/main/docs/media/ocean.jpg) **ocean** | ![subway](https://raw.githubusercontent.com/Nideesh1/agentglow/main/docs/media/subway.jpg) **subway** |
116
+ | ![circuit](https://raw.githubusercontent.com/Nideesh1/agentglow/main/docs/media/circuit.jpg) **circuit** | ![tunnel](https://raw.githubusercontent.com/Nideesh1/agentglow/main/docs/media/tunnel.jpg) **tunnel** | ![flow](https://raw.githubusercontent.com/Nideesh1/agentglow/main/docs/media/flow.jpg) **flow** |
117
+
118
+ ## Many agents
119
+
120
+ Above 12 live agents, older runs auto-group into clickable glowing clusters and the newest ~10 stay in full
121
+ detail, so a scene stays readable (and ~60 fps) with hundreds of agents.
122
+
123
+ ## One scene per page
124
+
125
+ All scenes on a page share one world model. Several `<AgentScene/>`s with the **same** `source` (or all with
126
+ `sim`) share a single connection and show the same agents, so they work fine side by side. Scenes with
127
+ **different** sources on one page aren't supported: the most recently mounted source wins.
128
+
129
+ ## Develop
130
+
131
+ ```bash
132
+ npm install
133
+ npm run dev # app at http://localhost:5173, proxies /live → http://localhost:8100 (AGENTGLOW_URL)
134
+ npm run build:lib # → dist/ (this package)
135
+ npm run build:app # → ../backend/agentglow/static (served by `agentglow serve`)
136
+ ```
137
+
138
+ In the app, `/` is the theme gallery and `/<theme>` is a full-screen scene. It accepts `?sim=1`,
139
+ `?source=http://host:8100` and `?hud=0`.
140
+
141
+ MIT License