Back to Playground
2024 AI AGENTS

CREWAI EDITOR

Orchestrating a digital newsroom of expert agents to proofread at scale.

CrewAI Python Multi-Agent Systems Automation
Use arrow keys or buttons below to navigate
PART I: THE PROBLEM 02 / 09

The Cost of Complexity

This wasn't a startup idea; it was a tuition fee. I built this to understand the "Hidden Taxes" of agentic workflows: latency, token costs, and orchestration fragility.

Orchestration Hell

Getting three LLMs to agree on a diff is harder than managing three human interns.

Token Burn

Learning CrewAI revealed how quickly context windows fill up when agents "talk" to each other.

PART II: THE SOLUTION 03 / 09

Digital Newsroom

Elevator Pitch:
A CLI-based multi-agent system where specialized AI personas (Grammarian, Stylist, Fact-Checker) critique documents in parallel.

Approach Pros Cons Verdict
Single LLM (ChatGPT) Cheap & Fast. Lacks nuance; prioritizes speed over rigor. Baseline
Human Editor High Agency. Expensive ($50/hr); Slow turnover. Too Slow
Agent Crew Multi-perspective critique. High Token Cost. Selected
Specialized Agents
  • The Grammarian: Validates syntax.
  • The Stylist: Enforces brand voice.
  • The Manager: Compiles final diffs.
PART III: TECHNOLOGY 04 / 09

CrewAI Framework

Defining "Personas" to constrain LLM behavior.

  • Role: Defines the agent's expertise.
  • Goal: The specific outcome (e.g., "Find 5 errors").
  • Backstory: Prompt context to enforce persona (e.g., "You hate passive voice").
editor = Agent(
  role='Senior Editor',
  goal='Fix tone inconsistencies',
  backstory="""You are a veteran editor at wired.com. 
  You prefer punchy, active sentences.""",
  verbose=True,
  allow_delegation=True
)

task = Task(
  description=f"Critique this section: {text_chunk}",
  agent=editor
)
PART IV: LEARNINGS 05 / 09

The Hallucination Loop

Agent Conflict
"Without a strict Manager agent, the 'Stylist' would rewrite a sentence to be punchy, and the 'Grammarian' would rewrite it back to be formal, creating an infinite loop."

Solution: Implementing a hierarchical process where agents submit proposals, but only the Manager agent has write access to the final document.

PART V: RESULTS 06 / 09

The "Lesson"

Time Saved

~80%

Reduction in "first pass" editing time.

Token Cost

HIGH

Taught me the value of frugal prompting.

Outcome

Learned

Deep dive into CrewAI architecture.

PART VI: VISUALS 07 / 09

Terminal Demo

📟

(CLI Output Visualization)

APPENDIX 08 / 09

Stack Details

Framework

CrewAI

Agent orchestration & task delegation.

LLM

GPT-4o

High reasoning capability for nuance.

Input

PyPDF2

Text extraction and chunking.

STATUS: ARCHIVED

A successful experiment in multi-agent workflows.

Back to Playground
© 2024 Ashar Rai Mujeeb

Detailed Project Archive

Full writeup below

BACK TO PLAYGROUND

CrewAI Proofreader

STATUS: ARCHIVED PLATFORM: PYTHON / CLI YEAR: 2024
CrewAI Agentic Workflows Python PDF Processing
📄

Agents as Editors

Editing large technical documents is tedious. You need to check for grammar, consistency in tone, formatting standards, and technical accuracy. Doing this sequentially takes hours. I wanted to see if I could spin up a "team" of AI agents to do it in parallel.

Using the CrewAI framework, I built a system where different agents took on different personas:

The Workflow

The system digests a PDF, splits it into chunks, and assigns these chunks to the agent crew. The agents critique the text and propose changes. A final "Manager Agent" reviews these proposals and compiles the final output.

# Defining the agents
editor = Agent(
  role='Senior Editor',
  goal='Ensure the document flows logically and is free of errors',
  backstory="""You are a veteran editor at a top tech publisher. 
  You hate passive voice and love clarity.""",
  verbose=True,
  allow_delegation=True
)

# Defining the task
proofread_task = Task(
  description=f"""Analyze the following text section: {text_chunk}""",
  agent=editor
)

Challenges & Learnings

Building this taught me a lot about Agent orchestration. The biggest challenge was "hallucination loops," where one agent would correct something, and another would correct it back. Strict prompt engineering and clear hierarchy (using the Manager agent) were essential to break these loops.

While effective for rough drafts, I found that for final polish, a human in the loop is still indispensable. However, this tool cut down the "first pass" editing time by about 80%.