Raja Patnaik Profile picture
Oct 27 8 tweets 2 min read Read on X
Has anyone looked at how @DSPyOSS + GEPA could optimize inter-agent communication protocols in multi-agent systems?

Instead of optimizing individual prompts for task performance, you’d optimize the language that agents use to communicate with each other. 1/🧵 Image
2/ Each DSPy signature becomes a communication interface, and GEPA optimizes:
3/ Information compression protocols - What’s the minimal information Agent A needs to convey to Agent B for effective coordination? GEPA could discover that certain verbose explanations are unnecessary, or that certain compact representations are more effective.
4/ Negotiation strategies - When agents disagree or have conflicting objectives, what communication patterns lead to better outcomes? This is different from prompt optimization - you’re optimizing the dialogue structure itself.
5/ Query routing efficiency - In a multi-agent system with specialists, GEPA could optimize how agents formulate requests to route to the right specialist, learning a shared vocabulary that maximizes routing accuracy.
6/ The metric would be end-to-end multi-agent task success, not individual prompt accuracy. This could discover emergent communication patterns that humans wouldn’t design.
Wouldn’t be surprised if @LakshyAAAgrawal has worked on this already?

GEPA: github.com/gepa-ai/gepa

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Raja Patnaik

Raja Patnaik Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @RajaPatnaik

Oct 24
I built an AI research agent that writes comprehensive reports with proper citations and optimizes its own prompts automatically - @LangChainAI + @ExaAILabs + @DSPyOSS + GEPA.

Link to blog post and full repo at the end. Here's how it works 🧵1/
2/ Most AI research systems have 3 problems:

- Prompts are static strings (can't be improved)
- Sequential execution (slow)
- Citation chaos (broken links, inconsistent numbering)

This system solves all three.
3/ The stack:

- LangGraph → workflow orchestration & parallelism
- DSPy → structured prompts as first-class objects
- GEPA → automatic prompt optimization
- Exa API → semantic search + full content retrieval
- Gemini → fast Flash/Pro models

Architecture in 2 minutes ↓
Read 25 tweets
Oct 21
Let SQL Be the Judge: Evolving an NL→SQL Generator with @DSPyOSS + GEPA (no labels required).

NL→SQL that self‑validates by executing its own output. No labels. Works on older GEPA via a scalar metric wrapper. Repo + blog below. 🧵1/12 Image
2/13
Why: “vibes‑based evals” don’t ship. I want system‑level signals.

SQLite is the judge: if your query is safe, runs, and returns the right rows/shape, you win. GEPA evolves the program toward higher scores.
3/13
Setup: in‑memory SQLite with authors, books, sales. I pass an LM‑friendly schema string (TABLE …, EXAMPLE_ROWS …) to anchor column names and reduce hallucinations.
Read 13 tweets
Oct 17
Practical @DSPyOSS example series: Build an LLM that self‑corrects instead of “RAG and pray.”

Pipeline: Retrieve → Generate → Verify → Refine.

If the verifier flags unsupported claims, we retry with feedback until it passes.

Blog post and GitHub link at the end. 1/13🧵 Image
2/13
Why this matters:
- Hallucinations still slip through plain RAG
- Users deserve verifiable answers
- Programmatic verification ⇒ reliability you can ship
3/13
We’ll use @DSPyOSS + @OpenAIDevs + @Wikipedia:
- Retriever: Wikipedia summaries
- Generator: answers only from context
- Verifier: lists unsupported claims
- Refiner: retries until verifier says “None”
Read 16 tweets
Oct 15
First in a series of practical GEPA + @DSPyOSS examples: Verifiable de‑identification (PII‑safe incident reports)

Most “privacy filters” are vibes. Let’s prove we removed PII while keeping the important bits intact. Link to blog post and repo ↓ 1/3🧵 Image
Using dspy.GEPA, we evolve a prompt until:

- No PII leaks (emails, phones, names → placeholders), and
- Structure is preserved (must keep Root cause + Action items sections).

2/3🧵
GEPA takes textual feedback from a metric (not just a score) and rewrites the instructions for the DSPy module until constraints pass. It’s optimization‑as‑reasoning - no RL loops.

3/3🧵
Read 5 tweets
Oct 13
Prompt engineering is brittle. Change your model? Rewrite all your prompts. Add a new feature? Pray that your carefully crafted examples still work.

@DSPyOSS solves all of this: program your models instead of prompting them.

Unsurprisingly, 28k+ GitHub stars: 🧵1/12↓
DSPy separates interface from implementation.

You define WHAT you want (signatures), HOW to structure it (modules), and let optimizers figure out the best prompts automatically.

Think: type hints + composable functions + auto-optimization. 🧵2/12
Signatures are type hints for AI tasks:

No prompt strings. Just Python. 🧵3/12 Image
Read 13 tweets
Sep 9
Hot take - Evolve prompts, not gradients: GEPA + DSPy > RL (for many pipelines). On 4 tasks, GEPA beat GRPO by ~10% on average (up to 20%) while using up to 35× fewer rollouts. That’s tailor‑made for small budgets.

More details ↓ Image
Why it clicks in DSPy: your “student” is a declarative program. GEPA reads structured traces, proposes targeted instruction edits per module, keeps a Pareto frontier of complementary candidates, and can even merge the best modules across lineages.
Define a minimal DSPy module + metric with textual feedback, then compile with dspy.GEPA. GEPA consumes your feedback string (not just a scalar) to evolve prompts fast. Image
Read 7 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(