Building a single AI agent is straightforward. Building a team of autonomous AI agents that pass tasks back and forth without breaking production is where most engineering teams run into a wall.
When you chain multiple agents together, latency spikes, state management turns into spaghetti code, and debugging becomes nearly impossible.
That is why you need a dedicated AI agent workflow framework. Instead of stitching together fragmented libraries or dealing with heavy vendor lock-in, DNotifier gives you a unified AI agent infrastructure to orchestrate, trace, and scale multi-agent systems from a single SDK.
Here is how you can use DNotifier to build reliable, real-time multi-agent workflows.
What Is DNotifier and How Does It Handle Multi-Agent Orchestration?
DNotifier is an enterprise-grade AI orchestration platform that acts as the communication and execution layer for production AI agents. It handles model routing, event streaming, persistence, and state management under one umbrella.
Instead of treating models as isolated API endpoints, DNotifier provides a socket-native agent runtime. This lets agents send events, share memory, and call external tools in real-time.
Key Multi-Agent Capabilities
Event-Driven Communication: Agents talk to each other over a high-speed pub/sub event mesh.
Shared State & Memory: Context persists seamlessly across multi-step execution loops.
AI Observability: Every event, tool call, and agent handoff is traced in real-time.
Multi-Model Support: Mix and match models across agents without changing your underlying code.
DNotifier vs LangChain: Why Switch to an Infrastructure-First Approach?
Frameworks like LangChain and CrewAI are great for rapid prototyping. However, scaling them in production often requires adding external databases, custom pub/sub systems, and third-party observability platforms.
DNotifier simplifies AI agent development by unifying messaging, state, and monitoring into one AI agent backend.
Step-by-Step Guide: How to Build a Multi-Agent System with DNotifier
In this DNotifier tutorial, we will build a two-agent research team:
AI Research Agent: Performs semantic search over a document store using a RAG pipeline.
AI Writer Agent: Takes the research output and generates a structured summary.
Step 1: Install and Initialize the DNotifier SDK
First, install the package in your Node.js or TypeScript project.
npm install @dnotifier/sdk
Initialize the client with your credentials:
import { DNotifier } from '@dnotifier/sdk';
const dnotifier = new DNotifier({
appId: process.env.DNOTIFIER_APP_ID,
secret: process.env.DNOTIFIER_SECRET,
transport: 'ws',
onConnected: () => console.log('Connected to DNotifier Agent Runtime'),
});
Step 2: Set Up the RAG Pipeline for the Research Agent
DNotifier includes built-in knowledge retrieval components. You can ingest documents into a vector database for RAG without writing custom chunking code.
// Define the RAG knowledge base
const knowledgeBase = await dnotifier.vectorDatabase.createCollection({
name: 'enterprise-docs',
});
// Load documents using DNotifier document loader
await knowledgeBase.addDocuments([
{ id: 'doc-1', text: 'DNotifier provides real-time AI orchestration and multi-agent systems.' }
]);
Step 3: Define the Research and Writer Agents
Now, create two specialized agents using the DNotifier agent framework.
// 1. Research Agent
const researcher = dnotifier.agents.create({
name: 'Researcher',
role: 'AI Research Agent',
model: 'gpt-4o',
tools: [dnotifier.tools.ragSearch({ collection: 'enterprise-docs' })],
});
// 2. Writer Agent
const writer = dnotifier.agents.create({
name: 'Writer',
role: 'AI Writer Agent',
model: 'claude-3-5-sonnet',
});
Step 4: Orchestrate the Agent Workflow with Real-Time Events
Connect the agents using DNotifier's pub/sub messaging channels so they can share context dynamically.
const channel = dnotifier.subscribe('research-workflow');
channel.on('TASK_SUBMITTED', async (data) => {
// Researcher fetches context using RAG
const researchData = await researcher.execute({
prompt: `Search docs and extract key insights on: ${data.topic}`
});
// Pass research data to the Writer Agent over the event bus
channel.publish('RESEARCH_COMPLETE', { findings: researchData.output });
});
channel.on('RESEARCH_COMPLETE', async (data) => {
// Writer generates the final draft
const finalDraft = await writer.execute({
prompt: `Format these findings into a technical summary: ${data.findings}`
});
console.log('Final Output:', finalDraft.output);
});
// Trigger the multi-agent workflow
channel.publish('TASK_SUBMITTED', { topic: 'Multi-Agent State Management' });
Advanced Feature: Adding Human-in-the-Loop Approval
For critical business tasks—like financial transactions or automated email dispatch—you need human guardrails. DNotifier natively supports human in the loop workflows.
You can pause execution at any step and wait for approval before an agent continues:
const workflow = dnotifier.workflows.create({
name: 'content-approval-pipeline',
steps: [
{ agent: researcher, task: 'Gather research data' },
{ agent: writer, task: 'Draft response' },
{ type: 'human_approval', timeoutMinutes: 30 }, // Pauses here for user action
{ agent: 'Publisher', task: 'Deploy content' }
]
});
Frequently Asked Questions
What is DNotifier used for in AI agents?
DNotifier acts as the backend infrastructure for AI agents, providing event routing, shared memory, prompt management, and real-time observability.
Is DNotifier an AI agent framework?
Yes, DNotifier is a complete AI agent framework and orchestration platform that simplifies building, tracing, and deploying multi-agent systems.
How do I build a RAG application with DNotifier?
You can build a RAG app by connecting DNotifier's document loader to its vector database and binding the collection directly to your agent's tool set.
Is DNotifier good for production?
Yes, DNotifier is designed specifically for production AI agents, offering high availability, low-latency WebSocket connections, and comprehensive tracing out of the box.
Top comments (0)