Skip to content

feat: AutoGen multi-agent email system with Commune (30-cell deep-dive)#40

Merged
shanjairaj7 merged 1 commit intomainfrom
feat/autogen-email-notebook
Mar 1, 2026
Merged

feat: AutoGen multi-agent email system with Commune (30-cell deep-dive)#40
shanjairaj7 merged 1 commit intomainfrom
feat/autogen-email-notebook

Conversation

@shanjairaj7
Copy link
Copy Markdown
Collaborator

Summary

  • Adds notebooks/autogen_email_agent.ipynb — a 30-cell deep-dive on building a multi-agent AutoGen system where agents communicate with real humans via Commune email inboxes
  • Covers the full architecture: ResearchAgent + OutreachAgent using separate Commune inboxes, FastAPI webhook handler with HMAC verification, asyncio reply queue, and AutoGen GroupChat coordination
  • Unique depth: explicit treatment of connection pool exhaustion (why singleton CommuneClient matters), immediate-200 webhook pattern with failure mode illustrated, idempotency via deque, and prompt injection pre-check

What makes this 10x better than typical notebooks

  • Common Mistake cell: shows the singleton vs. per-call client anti-pattern with concrete failure mode (100 open connection pools at 100 calls/min)
  • ASCII architecture diagram with 3 layers: Python process, Commune API, external email
  • Production Warning cells: why not returning 200 immediately causes duplicate delivery (with timeline)
  • Webhook explained deeply: HMAC verification with constant-time comparison to prevent timing attacks, idempotency with deque(maxlen=10_000)
  • Why one inbox per agent: concrete failure mode for shared inbox (subject-line routing breaks at ~50 threads)
  • Every code cell preceded by a markdown "why" cell

Test plan

  • Notebook renders correctly in Jupyter/Colab
  • Install cell includes all required dependencies
  • All code cells have realistic expected output in comments
  • Architecture ASCII diagram is readable in GitHub preview

@shanjairaj7 shanjairaj7 merged commit 856daad into main Mar 1, 2026
0 of 3 checks passed
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