Decentralised Pub/Sub Network
  • What is Pub/Sub
  • DPSN + Virtual Protocol: Empowering 17,000+ AI Agents with Real-Time Data
  • DPSN + GOAT SDK: Real-Time Data Streams Now Live
  • How to Publish Real-Time Data Streams on DPSN: A Guide for Developers
  • How to Subscribe to DPSN Data Streams: A Guide for Developers
  • Real-Time Market Intelligence for AI Agents: The DPSN Approach
  • MCP vs. Bridging Agents: Which One Powers AI Agents Best?
  • How DPSN Unlocks 99% of the Data
  • AI Agent Builders+DPSN: Unlocking Real-Time, Scalable Intelligence
  • DPSN+MCP: Bridging Real-Time Data for AI Agents
  • Improving AI Agent Decision-Making with Workflow Tags and JSON
  • Exploring DPSN SDK: Transforming Pub/Sub Networks in a Decentralised World
  • DPSN: Secure and Scalable Real-Time Messaging for a Decentralized Future
  • Understanding Price Feed Oracles and Why DPSN Is Essential for Decentralized Infrastructure
  • How DPSN supports Fully Homomorphic Encryption to Secure Data
  • Revolutionizing Data Feeds: How DPSN is Democratizing Web3 Connectivity
  • Enhancing Machine-to-Machine Communication in DePIN: How DPSN Powers Data Transfer
  • How DPSN Powers High-Throughput, Low-Latency Applications
  • DPSN for DeFi: Powering High-Speed Oracles and Financial Innovation
  • Harnessing DPSN for IoT: A Game-Changer for Smart Cities and Beyond
  • Building Resilient dApps: How DPSN Drives Scalability and Security
  • DPSN vs. Centralized Systems: A Case for Decentralization
  • Topic Ownership and Privacy in DPSN: Why It Matters for Developers
  • ChainPulse & DPSN: Revolutionizing Decentralized Communication for Web3
  • Boosting High-Performance Applications with DPSN's Advanced Clusters
  • The Evolution of Decentralized Messaging: From Bitcoin to DPSN
  • Optimizing Smart City Infrastructure with DPSN’s IoT Data Handling
  • Building Censorship-Resistant Applications with DPSN
  • 5 Key Features That Make DPSN Stand Out in Blockchain Networks
  • 7 Ways DPSN Enhances Data Privacy and Security
  • 6 Innovations in DPSN That Are Shaping the Blockchain Ecosystem
  • How DPSN is Transforming Data Security in Financial Applications
  • How DPSN Powers Secure Data Sharing in the Era of IoT Expansion
  • Exploring DPSN’s Role in Blockchain Interoperability
  • How DPSN Enhances Decentralized Messaging for Web3 Innovation
  • Why DPSN's Pub-Sub Model is Perfect for Web3
  • DPSN as the Backbone of Real-Time Messaging for Blockchain
  • How to Set Up Topic-Based Messaging in DPSN
  • 5 Common Challenges in Blockchain Communication and How to Solve Them
  • AI Agents Need Real-Time Data, DPSN Delivers
  • DPSN Dynamic Streams: The Future of Real-Time, Decentralized Data Feeds
  • Why Real-Time Data is the Next Frontier for Web3
Powered by GitBook
On this page
  • 1. Create Workflow Tags for Different Tasks
  • 2. Build a JSON Structure for Each Tag
  • 3. Assign Tags to Users Based on Their Needs
  • 4. Fill in the JSON Step-by-Step
  • 5. Finish and Move On
  • Why This Works
  • How It Helps Your Case

Improving AI Agent Decision-Making with Workflow Tags and JSON

PreviousDPSN+MCP: Bridging Real-Time Data for AI AgentsNextExploring DPSN SDK: Transforming Pub/Sub Networks in a Decentralised World

Last updated 2 months ago

If you are working on AI agents for conversations and running into issues with decision-making, especially as the number of instructions grows, here is a great framework to follow:

The agents forget, mix up, or misorder tasks, and while better prompting (like decision-tree styles) helps a little, it’s not enough for complex workflows with tens or hundreds of instructions. You’re asking how we solve this, and I’m happy to share an approach that’s been working well for us.

Instead of relying solely on prompts, we use a system with workflow tags and structured JSON objects to guide the AI step-by-step. This keeps things organized and prevents confusion, even with lots of instructions. Here’s how it works in a clear, practical way:

1. Create Workflow Tags for Different Tasks

We define specific tags to represent the types of tasks the AI needs to handle. For example:

  • book_ticket: For booking a flight.

  • cancel_order: For canceling a customer’s order.

Each tag is like a label that tells the AI what kind of job it’s dealing with.

2. Build a JSON Structure for Each Tag

For every workflow tag, we set up a JSON object in our database that lists the information the AI needs to collect. The keys are the required details, and the values start empty. For example, here’s what the JSON for book_ticket might look like:

{ 
"name": "",
 "email": "",
 "from_airport": "",
 "to_airport": "",
 "from_date": "",
 "to_date": ""
 }

This acts like a checklist the AI fills out as it talks to the user.

3. Assign Tags to Users Based on Their Needs

During the conversation, the AI listens to what the user wants and assigns the right workflow tag. For instance:

  • If the user says, “I want to book a flight,” the AI maps them to the book_ticket tag.

This step is key—it tells the AI which “checklist” to focus on.

4. Fill in the JSON Step-by-Step

Once the tag is assigned, the AI’s job is to gather the missing info by asking questions like:

  • “What’s your name?”

  • “Which airport are you flying from?”

  • “When do you want to leave?”

As the user answers, the AI updates the JSON. For example, after the user says “John” and “JFK,” it might look like:

{
  "name": "John",
  "email": "",
  "from_airport": "JFK",
  "to_airport": "",
  "from_date": "",
  "to_date": ""
}

The AI keeps going until every field is filled.

5. Finish and Move On

When all the values in the JSON are completed, the workflow is done. The AI can then:

  • Process the task (e.g., book the ticket).

  • Remove the book_ticket tag from the user.

If the user has another request (like canceling an order), the AI assigns a new tag and starts over.

Why This Works

  • Keeps Things Organized: Breaking tasks into small, clear steps prevents the AI from getting overwhelmed.

  • Tracks Progress: The JSON shows what’s done and what’s left, so the AI doesn’t repeat or forget steps.

  • Scales Well: Even with hundreds of instructions across different workflows, the AI stays focused because it only deals with one tag at a time.

How It Helps Your Case

Since your agents struggle with forgetting or mixing up instructions, this method offloads the complexity from the prompt to a structured system. The AI doesn’t have to “remember” everything—it just follows the JSON checklist and updates it as it goes. We store these workflows in a database, so the agent can always check what’s next.

This has been a game-changer for our agents, and I think it could help you too. Let me know if you’d like more details on setting it up!