Skip to content

Add multi-agent example (research + summary workflow using Bindu)#457

Open
ManoharBM29 wants to merge 2 commits intoGetBindu:mainfrom
ManoharBM29:add-multi-agent-example
Open

Add multi-agent example (research + summary workflow using Bindu)#457
ManoharBM29 wants to merge 2 commits intoGetBindu:mainfrom
ManoharBM29:add-multi-agent-example

Conversation

@ManoharBM29
Copy link
Copy Markdown

@ManoharBM29 ManoharBM29 commented Apr 17, 2026

🚀 Added Multi-Agent Example using Bindu

📌 Summary

This PR introduces a multi-agent example demonstrating how multiple agents can collaborate sequentially using Bindu.

🧠 What’s included

  • Research Agent → generates information from user input
  • Summary Agent → processes and summarizes the research output
  • Sequential workflow: User → Research → Summary → Final Output

💡 Why this matters

This example demonstrates agent orchestration using Bindu’s async architecture. It helps developers understand how to build multi-step agent workflows without relying on external APIs.

🧪 Testing

  • Verified locally using Bindu server (localhost:3773)
  • Tested end-to-end flow via Postman:
    • message/send → task submission
    • tasks/get → result retrieval
  • Confirmed structured multi-agent output

📂 Files added

  • examples/crewai_multi_agent/main.py
  • examples/crewai_multi_agent/README.md

🎯 Scope

  • Adds a new example only
  • No changes to existing codebase

Summary by CodeRabbit

Release Notes

  • New Features

    • Added example implementations demonstrating simple and multi-agent orchestration patterns.
  • Documentation

    • Added comprehensive guide for multi-agent workflow example with research and summary agents, including setup instructions, testing steps, and end-to-end workflow examples.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 17, 2026

📝 Walkthrough

Walkthrough

Two new CrewAI-style agent examples are introduced for the Bindu framework. The multi-agent example demonstrates a sequential pipeline with a research agent and summary agent, complete with documentation and implementation. A simpler single-agent example provides a minimal starting point. Both integrate with Bindu through configuration and handler functions.

Changes

Cohort / File(s) Summary
Multi-Agent Example Documentation
examples/crewai_multi_agent/README
Comprehensive documentation describing a two-agent research-to-summary pipeline, including workflow description, execution instructions, JSON-RPC request examples with message/send and tasks/get endpoints, and key concepts demonstrated.
Multi-Agent Example Implementation
examples/crewai_multi_agent/main.py
Entrypoint script implementing research_agent and summary_agent helper functions with a handler that orchestrates them sequentially, plus Bindu configuration dictionary and bindufy registration.
Simple Agent Example
examples/crewai_simple_agent/main.py
Minimal agent implementation with a handler function that echoes user messages, Bindu deployment configuration with local URL and expose setting, and empty skills list.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Suggested reviewers

  • Paraschamoli

Poem

🐰 Two agents hop into Bindu's warren,
Research and summary in perfect barren,
One simple friend joins the fray,
Examples shine in a brand new way!
CrewAI orchestrates with grace and might,
Where collaborative workflows take flight! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is incomplete; it lacks multiple required template sections including Change Type, Scope, Linked Issues, Security Impact, Verification, Evidence, Human Verification, Compatibility, Failure Recovery, Risks/Mitigations, and Checklist. Fill out all required sections from the template, especially Change Type (mark Feature), Scope checkboxes, Security Impact assessment, Verification steps with test results, and Human Verification details confirming local testing.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and specifically describes the main change: adding a multi-agent example with a research + summary workflow using Bindu.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ManoharBM29 ManoharBM29 changed the title Add multi aAdd multi-agent example (research + summary workflow using Bindu)gent example Add multi-agent example (research + summary workflow using Bindu) Apr 17, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🧹 Nitpick comments (2)
examples/crewai_multi_agent/main.py (1)

9-17: Same unsafe indexing as the simple example.

messages[-1]["content"] will raise on empty or malformed input. Consider messages[-1].get("content", "") if messages else "" for a friendlier failure mode in an example meant for beginners.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@examples/crewai_multi_agent/main.py` around lines 9 - 17, The handler
function currently indexes messages unsafely with messages[-1]["content"];
change it to safely handle empty or malformed input by first checking if
messages is truthy and then using .get("content", "") on the last message (e.g.,
compute user_input = messages[-1].get("content", "") if messages else ""), so
research_agent and summary_agent always receive a string rather than raising an
exception.
examples/crewai_simple_agent/main.py (1)

4-10: Guard against missing/malformed messages.

messages[-1]["content"] will raise IndexError on empty lists and KeyError/TypeError if the last message lacks a content key or isn't a dict. A beginner-friendly example should fail gracefully.

🛡️ Proposed fix
 def handler(messages):
-    user_input = messages[-1]["content"]
-    
+    user_input = (messages[-1].get("content", "") if messages else "")
+
     return [{
         "role": "assistant",
         "content": f"👋 Hello! You said: {user_input}\n\nThis is a simple CrewAI-style agent running on Bindu."
     }]
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@examples/crewai_simple_agent/main.py` around lines 4 - 10, The handler
currently does messages[-1]["content"] which can raise
IndexError/KeyError/TypeError; update the handler to validate that messages is a
non-empty list, that the last element is a dict with a "content" key (and that
its value is a string), and use a safe fallback (e.g., a default prompt like
"<no input provided>") when validation fails; then build and return the
assistant response using that safe user_input. Reference the handler function
and the messages[-1]["content"] access when making the checks and fallback
handling.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@examples/crewai_multi_agent/main.py`:
- Line 20: Replace the placeholder value for the "author" field (the string
"your_email@example.com") in the examples' metadata so it doesn't ship as-is:
update the "author" value to a real maintainer email or, if you prefer not to
publish a real address, replace it with a clear inline comment instructing users
to substitute their own email before running. Apply this change to the "author"
entry in both the examples/crewai_multi_agent main module and the
examples/crewai_simple_agent main module so the key "author" no longer contains
the placeholder string.
- Around line 6-7: summary_agent currently ignores its parameter and returns a
constant string (the f-string is redundant); update the function (summary_agent)
to incorporate the research_text parameter into the returned summary (e.g.,
produce a short summary or include the original research_text/context in the
output) and remove the unnecessary f prefix if you don't interpolate — ensure
the returned string references research_text so data flows from the research
agent into the summary agent.

In `@examples/crewai_multi_agent/README`:
- Around line 76-80: The README example output is out of sync with the actual
text returned by research_agent() in main.py; update the README block to match
the handler's real response (or change research_agent() to produce the README
text). Specifically, locate the research_agent() handler in main.py and either
adjust its returned string to "📊 Research Data on 'Explain AI agents': AI
agents are systems that can perform tasks autonomously using LLMs." and matching
summary text, or edit the README example to exactly match the current handler
output: "📊 Research Data:\n'Explain AI agents' involves autonomous systems that
use reasoning, memory, and tools to complete tasks." and the corresponding
summary line so copy-pasted examples produce the same result.
- Around line 30-104: The README has an unclosed ```bash fence causing the rest
to render as a single code block; close the initial ```bash fence and add
appropriate fenced blocks and heading markers: close the ```bash after the two
commands shown, add "## 🧪 Testing (Postman)" and "### 1️⃣ Send Request"/"###
2️⃣ Get Result" headings, wrap each JSON payload in ```json fences, wrap the
example output in a fenced block, and add "##" headings for "📌 Example Output",
"💡 Key Concepts Demonstrated", "🎯 Purpose", and "📦 Scope"; also rename the
file from README to README.md so markdown renders correctly.

In `@examples/crewai_simple_agent/main.py`:
- Line 14: The manifest/example contains a placeholder author email under the
"author" field ("your_email@example.com"); replace this with a real
project-owned or maintainer email (consistent with other examples, e.g., a
bindu.dev or team address) or add an inline comment next to the "author" field
telling users to swap in their own email before running so the required agent
identity is not left as a placeholder.

---

Nitpick comments:
In `@examples/crewai_multi_agent/main.py`:
- Around line 9-17: The handler function currently indexes messages unsafely
with messages[-1]["content"]; change it to safely handle empty or malformed
input by first checking if messages is truthy and then using .get("content", "")
on the last message (e.g., compute user_input = messages[-1].get("content", "")
if messages else ""), so research_agent and summary_agent always receive a
string rather than raising an exception.

In `@examples/crewai_simple_agent/main.py`:
- Around line 4-10: The handler currently does messages[-1]["content"] which can
raise IndexError/KeyError/TypeError; update the handler to validate that
messages is a non-empty list, that the last element is a dict with a "content"
key (and that its value is a string), and use a safe fallback (e.g., a default
prompt like "<no input provided>") when validation fails; then build and return
the assistant response using that safe user_input. Reference the handler
function and the messages[-1]["content"] access when making the checks and
fallback handling.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: da8c6b8c-6e5a-4c5f-a49a-ec0d4d357b21

📥 Commits

Reviewing files that changed from the base of the PR and between a888d4a and dbc167e.

📒 Files selected for processing (3)
  • examples/crewai_multi_agent/README
  • examples/crewai_multi_agent/main.py
  • examples/crewai_simple_agent/main.py

Comment on lines +6 to +7
def summary_agent(research_text):
return f"📝 Summary:\nThis topic explains how AI agents work step-by-step to solve problems efficiently."
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

summary_agent ignores its input and has a useless f-string.

research_text is never referenced in the body, and the returned string contains no interpolation, so the f prefix is redundant (flagged by Ruff F541). This defeats the purpose of a "summary" agent — regardless of what the research agent produced (or what the user asked), the summary is a fixed sentence. At minimum, incorporate research_text (or the original query) into the output so the pipeline demonstrates data flow between agents.

♻️ Proposed fix
-def summary_agent(research_text):
-    return f"📝 Summary:\nThis topic explains how AI agents work step-by-step to solve problems efficiently."
+def summary_agent(research_text):
+    # Trivially summarize by taking the first sentence of the research output.
+    first_sentence = research_text.split(".")[0].strip()
+    return f"📝 Summary:\n{first_sentence}."
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
def summary_agent(research_text):
return f"📝 Summary:\nThis topic explains how AI agents work step-by-step to solve problems efficiently."
def summary_agent(research_text):
# Trivially summarize by taking the first sentence of the research output.
first_sentence = research_text.split(".")[0].strip()
return f"📝 Summary:\n{first_sentence}."
🧰 Tools
🪛 Ruff (0.15.10)

[error] 7-7: f-string without any placeholders

Remove extraneous f prefix

(F541)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@examples/crewai_multi_agent/main.py` around lines 6 - 7, summary_agent
currently ignores its parameter and returns a constant string (the f-string is
redundant); update the function (summary_agent) to incorporate the research_text
parameter into the returned summary (e.g., produce a short summary or include
the original research_text/context in the output) and remove the unnecessary f
prefix if you don't interpolate — ensure the returned string references
research_text so data flows from the research agent into the summary agent.

}]

config = {
"author": "your_email@example.com",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Replace placeholder author email.

"your_email@example.com" ships as-is. Either use a real maintainer address or add a comment telling users to substitute theirs before running. Same note applies to examples/crewai_simple_agent/main.py.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@examples/crewai_multi_agent/main.py` at line 20, Replace the placeholder
value for the "author" field (the string "your_email@example.com") in the
examples' metadata so it doesn't ship as-is: update the "author" value to a real
maintainer email or, if you prefer not to publish a real address, replace it
with a clear inline comment instructing users to substitute their own email
before running. Apply this change to the "author" entry in both the
examples/crewai_multi_agent main module and the examples/crewai_simple_agent
main module so the key "author" no longer contains the placeholder string.

Comment on lines +30 to +104
```bash
cd examples/crewai_multi_agent
python main.py
🧪 Testing (Postman)

1️⃣ Send Request

POST → http://localhost:3773/

{
"jsonrpc": "2.0",
"method": "message/send",
"params": {
"message": {
"role": "user",
"parts": [
{
"kind": "text",
"text": "Explain AI agents"
}
],
"kind": "message",
"messageId": "550e8400-e29b-41d4-a716-446655440100",
"contextId": "550e8400-e29b-41d4-a716-446655440101",
"taskId": "550e8400-e29b-41d4-a716-446655440102"
},
"configuration": {
"acceptedOutputModes": ["application/json"]
}
},
"id": "550e8400-e29b-41d4-a716-446655440199"
}


2️⃣ Get Result
{
"jsonrpc": "2.0",
"method": "tasks/get",
"params": {
"taskId": "550e8400-e29b-41d4-a716-446655440102"
},
"id": "550e8400-e29b-41d4-a716-446655441299"
}


📌 Example Output
📊 Research Data on 'Explain AI agents':
AI agents are systems that can perform tasks autonomously using LLMs.

📝 Summary:
AI agents are autonomous systems that use models to complete tasks efficiently.


💡 Key Concepts Demonstrated
Multi-agent collaboration
Sequential task execution
Bindu async workflow:
message/send → task creation
tasks/get → result retrieval
Agent orchestration using bindufy()


🎯 Purpose

This example helps developers:

Understand how to build multi-agent systems
Learn Bindu’s request-response lifecycle
Experiment without external API dependencies


📦 Scope
No external APIs required
Beginner to intermediate friendly
Focused on core agent orchestration No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Markdown fencing is broken — most of the README renders as one giant code block.

The ```bash fence opened on Line 30 is never closed. As a result, everything from Line 33 onward ("🧪 Testing (Postman)", the JSON request/response bodies, "Key Concepts", "Purpose", "Scope") renders as bash code rather than formatted prose. Additionally, the two JSON payloads and the example output section have no fences of their own, and headings like "🧪 Testing (Postman)", "📌 Example Output", "💡 Key Concepts Demonstrated", "🎯 Purpose", "📦 Scope" are missing ##/`###` prefixes so they don't render as headings.

📝 Proposed structural fix
 ```bash
 cd examples/crewai_multi_agent
 python main.py
-🧪 Testing (Postman)
+```
+
+---
 
-1️⃣ Send Request
+## 🧪 Testing (Postman)
 
-POST → http://localhost:3773/
+### 1️⃣ Send Request
 
+`POST → http://localhost:3773/`
+
+```json
 {
   "jsonrpc": "2.0",
   "method": "message/send",
   ...
   "id": "550e8400-e29b-41d4-a716-446655440199"
 }
+```
 
-
-2️⃣ Get Result
+### 2️⃣ Get Result
+
+```json
 {
   "jsonrpc": "2.0",
   "method": "tasks/get",
   ...
   "id": "550e8400-e29b-41d4-a716-446655441299"
 }
+```
 
-
-📌 Example Output
+## 📌 Example Output
+
+```
 📊 Research Data on 'Explain AI agents':
 AI agents are systems that can perform tasks autonomously using LLMs.
 
 📝 Summary:
 AI agents are autonomous systems that use models to complete tasks efficiently.
+```
 
-
-💡 Key Concepts Demonstrated
+## 💡 Key Concepts Demonstrated
+
+- Multi-agent collaboration
+- Sequential task execution
+- Bindu async workflow: `message/send` → task creation, `tasks/get` → result retrieval
+- Agent orchestration using `bindufy()`

Also worth fixing: the file is named README — rename to README.md (the PR description mentions README.md) so GitHub and IDEs render it as Markdown.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@examples/crewai_multi_agent/README` around lines 30 - 104, The README has an
unclosed ```bash fence causing the rest to render as a single code block; close
the initial ```bash fence and add appropriate fenced blocks and heading markers:
close the ```bash after the two commands shown, add "## 🧪 Testing (Postman)"
and "### 1️⃣ Send Request"/"### 2️⃣ Get Result" headings, wrap each JSON payload
in ```json fences, wrap the example output in a fenced block, and add "##"
headings for "📌 Example Output", "💡 Key Concepts Demonstrated", "🎯 Purpose",
and "📦 Scope"; also rename the file from README to README.md so markdown
renders correctly.

Comment on lines +76 to +80
📊 Research Data on 'Explain AI agents':
AI agents are systems that can perform tasks autonomously using LLMs.

📝 Summary:
AI agents are autonomous systems that use models to complete tasks efficiently.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Example output doesn't match what main.py actually returns.

The README shows 📊 Research Data on 'Explain AI agents': and a sentence about LLMs, but research_agent() in main.py produces 📊 Research Data:\n'Explain AI agents' involves autonomous systems that use reasoning, memory, and tools to complete tasks. Similarly the summary text differs. Users copy-pasting the request will see different output than documented — please sync the README with the actual handler output (or vice versa).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@examples/crewai_multi_agent/README` around lines 76 - 80, The README example
output is out of sync with the actual text returned by research_agent() in
main.py; update the README block to match the handler's real response (or change
research_agent() to produce the README text). Specifically, locate the
research_agent() handler in main.py and either adjust its returned string to "📊
Research Data on 'Explain AI agents': AI agents are systems that can perform
tasks autonomously using LLMs." and matching summary text, or edit the README
example to exactly match the current handler output: "📊 Research
Data:\n'Explain AI agents' involves autonomous systems that use reasoning,
memory, and tools to complete tasks." and the corresponding summary line so
copy-pasted examples produce the same result.



config = {
"author": "your_email@example.com",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Placeholder author email shipped as-is.

"your_email@example.com" is a placeholder. Since author is a required field used for agent identity, either use a real project-owned address (e.g., a bindu.dev / maintainer email consistent with other examples) or add an inline comment telling users to replace it before running.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@examples/crewai_simple_agent/main.py` at line 14, The manifest/example
contains a placeholder author email under the "author" field
("your_email@example.com"); replace this with a real project-owned or maintainer
email (consistent with other examples, e.g., a bindu.dev or team address) or add
an inline comment next to the "author" field telling users to swap in their own
email before running so the required agent identity is not left as a
placeholder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant