Hello, CogStream
Ambient intelligence for your React app, in roughly a dozen lines.
By Pinar Patton
Most AI features in products today are chatboxes. A floating bubble in the corner. A command palette you have to remember exists. A modal that pops up asking if you'd like help with something.
CogStream is the opposite shape.
It watches what's happening in your product: hesitation, repetition, stalled progress, confusion. From there, it decides from the evidence whether the user needs a nudge, a highlight, a navigation, or nothing at all. The user doesn't ask. They don't even know the system is there until the moment it earns its presence.
This post is the minimum version of what it takes to wire that up.
What you're wiring up
Three things, roughly in order of where they live:
- A sensing layer that runs in the browser. It watches events, such as mouse movements, scrolling, form input, and optionally voice, then emits a structured description of user behavior called a behavioral episode. Raw events never leave the browser.
- An interpretation service that enriches episodes with app context and maintains a live User State Model: what the user is trying to do, how well it's going, where they're stuck.
- An agent layer that consumes that state and decides, moment to moment, whether and how to act.
Everything on the wire is high-level. No DOM dumps. No keystroke logs. No audio streaming home.
Install
npm install @cogstream/sensing @cogstream/copilotkit @cogstream/typesWire it into your app
The public interface is a single provider. It takes the URL of the interpretation service and a tenant API key.
import { CogStreamProvider } from "@cogstream/copilotkit";
export default function RootLayout({ children }) {
return (
<CogStreamProvider
serviceUrl="https://api.cogstream.ai"
apiKey={process.env.NEXT_PUBLIC_COGSTREAM_KEY}
>
{children}
</CogStreamProvider>
);
}That's the whole integration. Your app continues to render the way it always has. CogStream runs alongside, reading the room.
From here, interventions reach your UI through CopilotKit's native hooks — the same surface you'd use for a chatbox, but driven by ambient signal instead of a typed prompt.
What's on the wire
When CogStream decides to act, your client receives an AG-UI event. The
shapes are typed in @cogstream/types, but here's roughly what
flows:
type InterventionEvent =
| { kind: "ambient_cue"; target: string; message: string }
| { kind: "highlight"; target: string }
| { kind: "navigate"; to: string; reason: string }
| { kind: "intercept"; reason: string; alternative?: string }
| { kind: "intercom_ready"; context: SessionContext };Five action types, from the lightest possible nudge to a full intercept. The agent never escalates past what the evidence warrants, and never acts in the shadows. Every intervention is visible to the user.
See it running
- Live demos: demo.cogstream.ai/demo — a scripted scenario where you can watch the system read the room in real time.
- API reference: api.cogstream.ai/docs — OpenAPI spec for the hosted interpretation service, with every endpoint, request shape, and error code.
- Source: everything in the
@cogstream/*namespace on npm is open source.
Where this is going
Right now CogStream is in developer preview. If you're building something where the shape of the interaction matters — where a chatbox would feel wrong but you know there's real assistive value you could offer — that's the kind of product this is for.
Early access is by request while we onboard the first wave of users. If you want in, send a note and tell us what you're building. We read everything.
Not a chatbot bolted onto your product. Ambient intelligence, built in.