惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

量子位
F
Fortinet All Blogs
J
Java Code Geeks
Y
Y Combinator Blog
Stack Overflow Blog
Stack Overflow Blog
V
Visual Studio Blog
M
MIT News - Artificial intelligence
腾讯CDC
Last Week in AI
Last Week in AI
The Cloudflare Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Jina AI
Jina AI
Microsoft Security Blog
Microsoft Security Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
P
Proofpoint News Feed
博客园 - 叶小钗
Recent Announcements
Recent Announcements
T
Tailwind CSS Blog
Engineering at Meta
Engineering at Meta
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
人人都是产品经理
人人都是产品经理
L
LangChain Blog
博客园 - 司徒正美
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
We built a bidirectional context loop between web apps an...
Svetozar Radojcin · 2026-06-25 · via DEV Community

Svetozar Radojcin

Source code: Tabforge AI
Most AI integrations in business apps feel the same:

You send a prompt → the model returns an answer → you try to glue it into your app.

It works, but it always feels slightly disconnected from what’s actually happening in the UI.

The AI doesn’t really know what the user is doing.

And the app doesn’t really know what the AI just did.

We ran into that problem while building EasyAI / TabForge, and ended up with something we didn’t originally set out to build:

a bidirectional context loop between the application and the AI runtime.

The problem: AI in apps is stateless

Even when you pass “context”, it’s usually:

  • a string
  • a JSON blob
  • or a manually assembled prompt

But the real state lives elsewhere:

  • which record is open
  • what tab the user is on
  • what action just happened
  • what step in a workflow the user is in

So you end up doing things like:

  • passing IDs around
  • re-sending state on every request
  • rebuilding context for every AI call

It works, but it’s fragile.
**
Ambient Activity Memory (App → AI)**

The first thing we added was a way for the application to continuously describe what is happening inside it.

Not as logs.Not as analytics.
But as structured semantic events tied to actual UI actions.

So instead of:

“here is an order id”

the system already knows:

  • user is currently viewing Order #248
  • user just switched from payment tab to details tab
  • user just triggered refund flow

Now when the user says:

“cancel this order”

there is no ambiguity about what “this” refers to. The AI doesn’t guess context.It already has it.

EasyAIEvent (AI → App)

Once the AI started understanding the app state, the next obvious question was:

what does the AI give back to the application?

Not just a final answer, but the execution itself.

So every agent run can optionally emit a structured event stream:

  • started
  • planning
  • tool calls
  • progress updates
  • completion This is exposed via a simple hook:

.withEventListener(event -> {
log.info("[{}] {} — {}", event.source(), event.phase(), event.title());
})

No framework coupling.No HTTP assumptions.No UI dependencies.
Just a pure event stream that your app can consume however it wants.

What this enables (more interesting part)

Once you have both directions:
App → AI

The system knows what the user is doing.
AI → App

The system exposes what the agent is doing. You end up with something simple but powerful:

a closed loop between UI state and AI execution state
**
Why this matters in practice**

This removes a bunch of glue code that usually creeps into AI integrations:

  • passing IDs back and forth
  • manually constructing prompts
  • debugging “what did the agent actually do?”
  • rebuilding context on every request

Instead:

  • the app continuously emits context
  • the AI continuously emits execution state
  • both stay decoupled, but synchronized

Important design choice

The event model is intentionally framework-agnostic:
(source, phase, status, title, detail, toolName, sequence, timestamp)

It does not know anything about:

HTTP, WebSockets, SSE, UI frameworks

That part is left to the application.

We ship a minimal example that maps the event stream to a real-time UI panel using SSE, but it stays outside the core library.

Where this is going

The interesting part is not the event system itself. It’s what becomes possible when:

  • the app knows what the user is doing
  • the AI knows what it is doing
  • and both sides share the same runtime context

You start to move from “AI calls inside an app” toward something closer to:

AI as a participant in application execution, not just a function you call

If you strip everything away

At its core, this is all we tried to solve:

How do we make AI systems aware of application state without coupling them to the UI?

And the answer turned out to be:

Don’t pass state. Stream it in both directions.

If you want to explore it:
GitHub: https://github.com/tabforgeai/tabforge-ai
Full example: https://github.com/tabforgeai/tabforge-ai-demo