StackA2A
generalcrewaipython

The Poet And The Sage

18

by babanomania

What would Tagore write, if he knew our history

Updated 2025-08-02MIT
Quality Score18/100
Community
0
Freshness
19
Official
30
Skills
10
Protocol
30
🔒 Security
20

Getting Started

1Clone the repository
$ git clone https://github.com/babanomania/the-poet-and-the-sage
2Navigate to the project
$ cd the-poet-and-the-sage
3Install dependencies
$ pip install -r requirements.txt
4Run the agent
$ python main.py

README

🌸 The Poet and the Sage

"Computers can calculate faster than you. They’ll never forget what you teach them. But remember, they’ll never write poetry like Rabindranath Tagore."
— My childhood computer teacher, sometime in 2000

I still remember the pause in the room after he said that; the kind of silence that makes you wonder whether you're learning machines, or learning yourself.

For years, those words stayed with me. Not as a challenge, but as a truth.
Tagore wasn’t just a poet. He was a seer, a sage, a symphony of nature and soul. His poetry wasn’t code; it was longing turned into language.

And yet, here we are.

The Poet and the Sage is a meditation on that very moment. Built with Google’s Agent-to-Agent (A2A) framework, this project doesn’t claim to replicate Tagore. It tries, instead, to listen like him.

A network of agents — the researcher, the dreamer, the critic — work together to take a seed of history or emotion, and nurture it into something that feels almost human, almost sacred. A poem.

Not to replace Tagore. But to remember that even machines can learn to pause, to wonder, and maybe, just maybe, to weep.

Project Highlights

  • Wikipedia WebBrowsingAgent: Queries Wikipedia to fetch structured historical or philosophical context
  • Research Agent: Synthesizes raw Wikipedia text into meaningful summaries, timelines, and figures
  • Context Agent: Translates facts into symbolic, emotional, and thematic material for poetry
  • Poet Agent: Writes free verse inspired by Tagore’s tone, emotion, and rhythm
  • Critique Agent: Reviews and revises output using a cyclic agent feedback loop
  • Traceable Reasoning: Every poem is born from citations, transformations, and structured thought

Agent Architecture (Google A2A)

Agents Overview

Agent Name Responsibility Framework
WebBrowsingAgent Queries Wikipedia and retrieves key article sections Crew AI
ResearchAgent Synthesizes Wikipedia sections into summary, timeline, and figures A2A SDK
ContextAgent Extracts emotional and symbolic resonance from the research summary A2A SDK
PoetAgent Composes Tagore-style free verse using themes and metaphors LangChain
CritiqueAgent Provides feedback and requests revision if the poem lacks depth LangChain

Sequence Diagram

sequenceDiagram
    participant U as User Prompt
    participant H as HostAgent
    participant W as WebBrowsingAgent
    participant R as ResearchAgent
    participant C as ContextAgent
    participant P as PoetAgent
    participant K as CritiqueAgent
    participant F as Final Output

    U->>H: Prompt with topic or emotion
    H->>W: Fetch Wikipedia article
    W->>R: Provide article sections
    R->>R: (optional) Ask W for deeper articles
    R->>C: Send summarized context
    C->>P: Send symbolic & emotional themes
    P->>K: Send generated poem
    K-->>P: Request revision (if needed)
    K->>H: Approve final poem
    H->>U: Generated Poem

Tech Stack

  • Google A2A Framework – For orchestrating structured multi-agent workflows
  • LangChain – For LLM orchestration and step-by-step tool use
  • CrewAI - For LLM orchestration and step-by-step tool use
  • Gemini 2.0 Flash – Backend LLMs for contextual, creative, and poetic reasoning
  • Wikipedia API – Source of truth for historical/philosophical grounding
  • Custom Prompt Templates – Each agent has its own refined voice and objective

Example Use Case

Input Prompt:

“Compose a poem about the fall of Constantinople in Tagore's voice.”

Generated Poem:

The walls wept before the sea did,  
And in the hush of twilight’s prayer,  
Faith fell not to fire, but to silence,  
Where once hymns echoed, now only dust remembers.

Agent Trace:

  • WebBrowsingAgent: Retrieved article sections on the siege and aftermath
  • ResearchAgent: Synthesized summary, highlighted key figures and consequences
  • ContextAgent: Extracted themes of mourning, rebirth, silence
  • PoetAgent: Generated 4-line poem
  • CritiqueAgent: Approved with minor metaphor alignment suggestions

Setup Instructions

For installation, agent execution, and local development steps, please refer to SETUP.md.

License

MIT License. You are free to remix, share, and build on this project with attribution.

Capabilities

StreamingPush NotificationsMulti-TurnAuth: none
crewaigeminilangchain
View on GitHub