react-observer-agent
is an experimental project by a solo developer exploring whether it's possible to build an AI agent system that:
- Observes a live React app’s state and UI
- Understands what the user is doing and what actions are possible
- Uses large language models (LLMs) to suggest or execute actions, safely
- Does all of this through a simple
<Provider>
and registered tools
My vision is to be able to use it like this:
import { AIAgentProvider, registerTool, openAIAdapter } from 'react-observer-agent';
import { useStore } from './store';
const tools = [
registerTool('goToPage', (path) => navigate(path)),
registerTool('submitForm', () => handleSubmit()),
];
const getAppState = () => {
const state = useStore.getState();
return {
user: state.user,
cart: state.cart,
};
};
export default function App() {
return (
<AIAgentProvider
model={openAIAdapter({ apiKey: process.env.OPENAI_API_KEY })}
state={getAppState}
tools={tools}
permissions={{
canAccess: ['user', 'cart'],
canExecute: ['goToPage', 'submitForm'],
}}
>
<YourApp />
</AIAgentProvider>
);
}
This is a personal research initiative — not a commercial product.
Most "AI integrations" in frontend apps today are:
- Shallow (just chats or autocomplete)
- Stateless (no awareness of what’s on the page or in the app)
- Unsafe (not designed to act in complex UIs)
I'm interested in pushing this further — to see if an AI can:
- Understand app structure and user state
- Safely invoke pre-defined actions
- Integrate flexibly with tools like Zustand, Redux, and OpenAI
- Respect privacy and permission boundaries
- Can an AI agent understand enough about a live React app to be useful?
- Can state and action exposure be automated with zero glue code?
- Can I support multiple LLM backends (OpenAI, Claude, local) through adapters?
- Can this be done safely, privately, and scalably?
- 🔜 Manual state observation + tool registry + OpenAI support
- 🔜 DOM awareness + page context mapping
- 🔜 Consent model + permission boundaries
- 🔜 Model adapter layer (Claude, Ollama, etc.)
- 🔜 In-memory agent "short-term memory"
- 🔜 Developer-friendly logging & test tools
This is a solo experiment.
It is not production-ready.
It may change, break, or stop at any time.
If you're at a company curious about intelligent UIs, you're welcome to explore it, fork it, or reach out. Feedback is appreciated.