Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Where you see what bindu was actually built for.
| Folder | What it is | Notable |
| --- | --- | --- |
| [`agent_swarm/`](agent_swarm/) | Planner → Researcher → Summarizer → Critic → Reflection. | 5-stage in-process chain. |
| [`crewai-agent/`](crewai-agent/) | Researcher + Writer crew — any topic in, clean summary out. | CrewAI. |
| [`ag2_research_team/`](ag2_research_team/) | researcher / analyst / writer under AutoPattern GroupChat. | AG2 (AutoGen) with LLM-driven speaker selection. |
| [`cerina_bindu/`](cerina_bindu/cbt/) | CBT exercise generator: Drafter → SafetyGuardian → ClinicalCritic, supervised. | Real LangGraph `StateGraph`. |
| [`langgraph_blog_writing_agent/`](langgraph_blog_writing_agent/) | Plan → fan out → reduce, map-reduce style. | LangGraph `Send` for fan-out. |
Expand Down
1 change: 1 addition & 0 deletions examples/crewai-agent/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
OPENROUTER_API_KEY=your_openrouter_api_key_here # pragma: allowlist secret
45 changes: 45 additions & 0 deletions examples/crewai-agent/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# CrewAI Research Agent

A two-agent CrewAI crew wrapped with Bindu. Send any topic — a Researcher gathers key facts, a Writer turns them into a clean summary. Served over A2A with a DID identity.

## Prerequisites

- `OPENROUTER_API_KEY` — get one at https://openrouter.ai/keys

## Setup

```bash
cp .env.example .env
# fill in your OPENROUTER_API_KEY
uv sync --extra agents
```

## Run

```bash
uv run examples/crewai-agent/main.py
# http://localhost:3773
```

## Talk to it

```bash
curl -sS http://localhost:3773/ \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "message/send",
"id": "00000000-0000-0000-0000-000000000004",
"params": {
"message": {
"role": "user",
"parts": [{"kind": "text", "text": "What is quantum computing?"}],
"kind": "message",
"messageId": "00000000-0000-0000-0000-000000000001",
"contextId": "00000000-0000-0000-0000-000000000002",
"taskId": "00000000-0000-0000-0000-000000000003"
},
"configuration": {"acceptedOutputModes": ["application/json"]}
}
}'
```
82 changes: 82 additions & 0 deletions examples/crewai-agent/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
import os

from crewai import Agent, Crew, LLM, Task
from dotenv import load_dotenv

from bindu.penguin.bindufy import bindufy

load_dotenv()

openrouter_api_key = os.getenv("OPENROUTER_API_KEY")
if not openrouter_api_key:
raise RuntimeError("OPENROUTER_API_KEY environment variable is required")

llm = LLM(
model="openrouter/openai/gpt-4o-mini",
api_key=openrouter_api_key,
)

researcher = Agent(
role="Researcher",
goal="Research the given topic and gather key facts and insights.",
backstory="You are an expert researcher who finds accurate, concise information on any topic.",
llm=llm,
verbose=False,
)

writer = Agent(
role="Writer",
goal="Write a clear and engaging summary based on the research provided.",
backstory="You are a skilled writer who turns raw research into readable, well-structured summaries.",
llm=llm,
verbose=False,
)


def handler(messages):
if not messages:
return "No messages received. Please provide a topic to research."

last = messages[-1]
query = last.get("content", "") if isinstance(last, dict) else str(last)
Comment on lines +36 to +41

if not query.strip():
return "Please provide a topic to research."

research_task = Task(
description=f"Research this topic thoroughly: {query}",
expected_output="A list of key facts, insights, and important points about the topic.",
agent=researcher,
)

write_task = Task(
description="Using the research provided, write a clear 3-5 paragraph summary.",
expected_output="A well-structured, readable summary of the topic.",
agent=writer,
)

crew = Crew(
agents=[researcher, writer],
tasks=[research_task, write_task],
verbose=False,
)

result = crew.kickoff()
return str(result)


config = {
"author": "your.email@example.com",
"name": "crewai_research_agent",
"description": "A two-agent CrewAI crew that researches any topic and writes a clear summary.",
"deployment": {
"url": "http://localhost:3773",
"expose": True,
"cors_origins": ["*"],
},
"skills": ["skills/crewai-research"],
"auth": {"enabled": False},
}

if __name__ == "__main__":
bindufy(config, handler)
27 changes: 27 additions & 0 deletions examples/crewai-agent/skills/crewai-research/skill.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
id: crewai-research
name: CrewAI Research Skill
version: 1.0.0
author: your.email@example.com
description: >
A two-agent CrewAI crew that researches any topic and returns a structured summary.
A Researcher agent gathers key facts and insights, then a Writer agent turns them
into a clear, readable summary.

tags:
- crewai
- research
- multi-agent
- openrouter
- summarization

input_modes:
- text/plain

output_modes:
- text/plain

examples:
- input: "What is quantum computing?"
output: |
Quantum computing is a type of computation that harnesses quantum mechanical
phenomena such as superposition and entanglement...
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ dependencies = [
agents = [
"ag2[openai]>=0.11.0",
"agno>=2.5.2",
"crewai>=0.130.0",
"langchain>=1.2.9",
"langchain-openai>=1.1.8",
"langgraph>=1.0.8",
Expand Down