# campusx-official/crewai_masterclass architecture

> Architecture diagram of the GitHub repository campusx-official/crewai_masterclass, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-06-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/campusx-official/crewai_masterclass
- Repository: https://github.com/campusx-official/crewai_masterclass

## Overview

1. This repository is a small mono-repo of two separate CrewAI-based Python applications: `market_research_crew` and `research_and_blog_crew`. They are structurally similar, each packaged as its own installable project with its own `pyproject.toml`, `uv.lock`, source tree, config, knowledge base, and generated output folder.

2. The main architectural pattern in both projects is “configuration-driven multi-agent orchestration.” The code under `src/...` is minimal glue; the behavior is mostly defined by YAML files in `config/` and executed through a central `crew.py` module.

3. Each project has the same top-level runtime path:
   - `main.py` is the entrypoint.
   - `crew.py` assembles agents, tasks, and the CrewAI execution flow.
   - `config/agents.yaml` defines agent roles and behavior.
   - `config/tasks.yaml` defines the work to be performed and how outputs are chained.

4. The agent/task boundary is important. Agents represent specialized workers, while tasks represent units of work assigned to those workers. The architecture suggests sequential or coordinated task execution inside a CrewAI “crew,” rather than a traditional service/controller/model split.

5. Both projects include a `tools/` package with `custom_tool.py`. This is the extension point where agents can access non-LLM capabilities or external data sources. In architecture terms, this is the escape hatch between the agent framework and the outside world.

6. Both projects also have a `knowledge/user_preference.txt` file. This acts as a persistent local context layer that influences generation and decision-making without being code. It is separate from runtime logic and separate from generated outputs, so it should be shown as an input artifact feeding the crew.

7. The output side differs by project:
   - `market_research_crew/reports/report.md`
   - `research_and_blog_crew/blogs/blog.md`
   These are generated artifacts, likely produced by the final task in each workflow. They are the main persistence boundary for results.

8. The two subprojects target different deliverables but share the same pipeline shape. `market_research_crew` is oriented around producing a research report, while `research_and_blog_crew` turns research into a blog post. That means the second project likely has a more content-generation-focused task chain, but both are still CrewAI orchestration systems.

9. `resources/` contains `CrewAI MasterClass.pdf` and `crewai_masterclass.html`. These appear to be source/reference material for the examples rather than runtime dependencies. They sit outside either package and act as static inputs or documentation assets.

10. The repository depends on Python packaging and environment management via `pyproject.toml` and `uv.lock`, which indicates reproducible local execution with `uv`. There is no sign of a separate backend, database, or web UI; the core runtime is a local Python agent workflow.

11. A useful architecture diagram should show three layers for each project:
   - configuration and knowledge inputs,
   - CrewAI orchestration and custom tools,
   - generated markdown artifacts.
   The only likely external boundary is the LLM/provider used by CrewAI, which is abstracted away behind the framework rather than implemented directly in the repo.

12. One notable repository detail is that `research_and_blog_crew` uses a package directory named `reaseach_and_blog_crew` inside `src/`, which looks like a spelling inconsistency. It likely does not change the architecture, but it matters for import paths and packaging boundaries.

Main entry points: [`market_research_crew/src/market_research_crew/crew.py`](https://github.com/campusx-official/crewai_masterclass/blob/main/market_research_crew/src/market_research_crew/crew.py) (crew.py), [`research_and_blog_crew/src/reaseach_and_blog_crew/crew.py`](https://github.com/campusx-official/crewai_masterclass/blob/main/research_and_blog_crew/src/reaseach_and_blog_crew/crew.py) (crew.py), [`market_research_crew/src/market_research_crew/config/tasks.yaml`](https://github.com/campusx-official/crewai_masterclass/blob/main/market_research_crew/src/market_research_crew/config/tasks.yaml) (tasks.yaml), [`research_and_blog_crew/src/reaseach_and_blog_crew/config/tasks.yaml`](https://github.com/campusx-official/crewai_masterclass/blob/main/research_and_blog_crew/src/reaseach_and_blog_crew/config/tasks.yaml) (tasks.yaml)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_market_research["Market Research"]
  node_mr_main["main.py<br/>entrypoint<br/>[main.py]"]
  node_mr_crew["crew.py<br/>orchestration<br/>[crew.py]"]
  node_mr_agents["agents.yaml<br/>agent config<br/>[agents.yaml]"]
  node_mr_tasks["tasks.yaml<br/>task config<br/>[tasks.yaml]"]
  node_mr_tool["custom_tool.py<br/>tooling<br/>[custom_tool.py]"]
  node_mr_knowledge["user prefs<br/>knowledge base"]
  node_mr_report["report.md<br/>generated artifact<br/>[report.md]"]
end

subgraph group_research_blog["Research & Blog"]
  node_rb_main["main.py<br/>entrypoint<br/>[main.py]"]
  node_rb_crew["crew.py<br/>orchestration<br/>[crew.py]"]
  node_rb_agents["agents.yaml<br/>agent config<br/>[agents.yaml]"]
  node_rb_tasks["tasks.yaml<br/>task config<br/>[tasks.yaml]"]
  node_rb_tool["custom_tool.py<br/>tooling<br/>[custom_tool.py]"]
  node_rb_knowledge["user prefs<br/>knowledge base"]
  node_rb_blog["blog.md<br/>generated artifact<br/>[blog.md]"]
end

subgraph group_shared_resources["Shared Resources"]
  node_resources_pdf["MasterClass PDF<br/>reference material"]
  node_resources_html["MasterClass HTML<br/>reference material"]
end

node_mr_main -->|"starts"| node_mr_crew
node_mr_crew -->|"loads"| node_mr_agents
node_mr_crew -->|"loads"| node_mr_tasks
node_mr_crew -->|"uses"| node_mr_tool
node_mr_crew -->|"reads"| node_mr_knowledge
node_mr_tasks -->|"produces"| node_mr_report
node_mr_agents -.->|"assigned to"| node_mr_tasks
node_rb_main -->|"starts"| node_rb_crew
node_rb_crew -->|"loads"| node_rb_agents
node_rb_crew -->|"loads"| node_rb_tasks
node_rb_crew -->|"uses"| node_rb_tool
node_rb_crew -->|"reads"| node_rb_knowledge
node_rb_tasks -->|"produces"| node_rb_blog
node_rb_agents -.->|"assigned to"| node_rb_tasks
node_resources_pdf -.->|"reference"| node_mr_crew
node_resources_html -.->|"reference"| node_rb_crew

click node_mr_main "https://github.com/campusx-official/crewai_masterclass/blob/main/market_research_crew/src/market_research_crew/main.py"
click node_mr_crew "https://github.com/campusx-official/crewai_masterclass/blob/main/market_research_crew/src/market_research_crew/crew.py"
click node_mr_agents "https://github.com/campusx-official/crewai_masterclass/blob/main/market_research_crew/src/market_research_crew/config/agents.yaml"
click node_mr_tasks "https://github.com/campusx-official/crewai_masterclass/blob/main/market_research_crew/src/market_research_crew/config/tasks.yaml"
click node_mr_tool "https://github.com/campusx-official/crewai_masterclass/blob/main/market_research_crew/src/market_research_crew/tools/custom_tool.py"
click node_mr_knowledge "https://github.com/campusx-official/crewai_masterclass/blob/main/market_research_crew/knowledge/user_preference.txt"
click node_mr_report "https://github.com/campusx-official/crewai_masterclass/blob/main/market_research_crew/reports/report.md"
click node_rb_main "https://github.com/campusx-official/crewai_masterclass/blob/main/research_and_blog_crew/src/reaseach_and_blog_crew/main.py"
click node_rb_crew "https://github.com/campusx-official/crewai_masterclass/blob/main/research_and_blog_crew/src/reaseach_and_blog_crew/crew.py"
click node_rb_agents "https://github.com/campusx-official/crewai_masterclass/blob/main/research_and_blog_crew/src/reaseach_and_blog_crew/config/agents.yaml"
click node_rb_tasks "https://github.com/campusx-official/crewai_masterclass/blob/main/research_and_blog_crew/src/reaseach_and_blog_crew/config/tasks.yaml"
click node_rb_tool "https://github.com/campusx-official/crewai_masterclass/blob/main/research_and_blog_crew/src/reaseach_and_blog_crew/tools/custom_tool.py"
click node_rb_knowledge "https://github.com/campusx-official/crewai_masterclass/blob/main/research_and_blog_crew/knowledge/user_preference.txt"
click node_rb_blog "https://github.com/campusx-official/crewai_masterclass/blob/main/research_and_blog_crew/blogs/blog.md"
click node_resources_pdf "https://github.com/campusx-official/crewai_masterclass/blob/main/resources/CrewAI MasterClass.pdf"
click node_resources_html "https://github.com/campusx-official/crewai_masterclass/blob/main/resources/crewai_masterclass.html"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_mr_main,node_mr_crew,node_mr_agents,node_mr_tasks,node_mr_tool,node_mr_knowledge,node_mr_report toneBlue
class node_rb_main,node_rb_crew,node_rb_agents,node_rb_tasks,node_rb_tool,node_rb_knowledge,node_rb_blog toneAmber
class node_resources_pdf,node_resources_html toneMint
```

## Components

### Market Research

CrewAI app for market research reporting.

- [main.py](https://github.com/campusx-official/crewai_masterclass/blob/main/market_research_crew/src/market_research_crew/main.py): entrypoint · Starts the market research workflow. · `market_research_crew/src/market_research_crew/main.py`
- [crew.py](https://github.com/campusx-official/crewai_masterclass/blob/main/market_research_crew/src/market_research_crew/crew.py): orchestration · Builds the crew and wires agents, tasks, and tools. · `market_research_crew/src/market_research_crew/crew.py`
- [agents.yaml](https://github.com/campusx-official/crewai_masterclass/blob/main/market_research_crew/src/market_research_crew/config/agents.yaml): agent config · Defines agent roles and behavior. · `market_research_crew/src/market_research_crew/config/agents.yaml`
- [tasks.yaml](https://github.com/campusx-official/crewai_masterclass/blob/main/market_research_crew/src/market_research_crew/config/tasks.yaml): task config · Defines the work sequence and task outputs. · `market_research_crew/src/market_research_crew/config/tasks.yaml`
- [custom_tool.py](https://github.com/campusx-official/crewai_masterclass/blob/main/market_research_crew/src/market_research_crew/tools/custom_tool.py): tooling · Extension point for external data or non-LLM capability. · `market_research_crew/src/market_research_crew/tools/custom_tool.py`
- [user prefs](https://github.com/campusx-official/crewai_masterclass/blob/main/market_research_crew/knowledge/user_preference.txt): knowledge base · Persistent local context that influences generation. · `market_research_crew/knowledge/user_preference.txt`
- [report.md](https://github.com/campusx-official/crewai_masterclass/blob/main/market_research_crew/reports/report.md): generated artifact · Final research report output. · `market_research_crew/reports/report.md`

### Research & Blog

CrewAI app that turns research into blog content.

- [main.py](https://github.com/campusx-official/crewai_masterclass/blob/main/research_and_blog_crew/src/reaseach_and_blog_crew/main.py): entrypoint · Starts the research-to-blog workflow. · `research_and_blog_crew/src/reaseach_and_blog_crew/main.py`
- [crew.py](https://github.com/campusx-official/crewai_masterclass/blob/main/research_and_blog_crew/src/reaseach_and_blog_crew/crew.py): orchestration · Builds the crew and wires agents, tasks, and tools. · `research_and_blog_crew/src/reaseach_and_blog_crew/crew.py`
- [agents.yaml](https://github.com/campusx-official/crewai_masterclass/blob/main/research_and_blog_crew/src/reaseach_and_blog_crew/config/agents.yaml): agent config · Defines agent roles and behavior. · `research_and_blog_crew/src/reaseach_and_blog_crew/config/agents.yaml`
- [tasks.yaml](https://github.com/campusx-official/crewai_masterclass/blob/main/research_and_blog_crew/src/reaseach_and_blog_crew/config/tasks.yaml): task config · Defines the work sequence and task outputs. · `research_and_blog_crew/src/reaseach_and_blog_crew/config/tasks.yaml`
- [custom_tool.py](https://github.com/campusx-official/crewai_masterclass/blob/main/research_and_blog_crew/src/reaseach_and_blog_crew/tools/custom_tool.py): tooling · Extension point for external data or non-LLM capability. · `research_and_blog_crew/src/reaseach_and_blog_crew/tools/custom_tool.py`
- [user prefs](https://github.com/campusx-official/crewai_masterclass/blob/main/research_and_blog_crew/knowledge/user_preference.txt): knowledge base · Persistent local context that influences generation. · `research_and_blog_crew/knowledge/user_preference.txt`
- [blog.md](https://github.com/campusx-official/crewai_masterclass/blob/main/research_and_blog_crew/blogs/blog.md): generated artifact · Final blog post output. · `research_and_blog_crew/blogs/blog.md`

### Shared Resources

Reference material used across examples.

- [MasterClass PDF](https://github.com/campusx-official/crewai_masterclass/blob/HEAD/resources/CrewAI%20MasterClass.pdf): reference material · Static reference asset for the examples. · `resources/CrewAI MasterClass.pdf`
- [MasterClass HTML](https://github.com/campusx-official/crewai_masterclass/blob/main/resources/crewai_masterclass.html): reference material · Static reference asset for the examples. · `resources/crewai_masterclass.html`

## Connections

- main.py → crew.py: starts · Entrypoint hands off to orchestration.
- crew.py → agents.yaml: loads · Crew is configured from agent definitions.
- crew.py → tasks.yaml: loads · Crew is configured from task definitions.
- crew.py → custom_tool.py: uses · Agents can invoke custom external capability.
- crew.py → user prefs: reads · Local preference context informs execution.
- tasks.yaml → report.md: produces · Final task writes the report artifact.
- agents.yaml → tasks.yaml: assigned to · Agents execute the configured tasks.
- main.py → crew.py: starts · Entrypoint hands off to orchestration.
- crew.py → agents.yaml: loads · Crew is configured from agent definitions.
- crew.py → tasks.yaml: loads · Crew is configured from task definitions.
- crew.py → custom_tool.py: uses · Agents can invoke custom external capability.
- crew.py → user prefs: reads · Local preference context informs execution.
- tasks.yaml → blog.md: produces · Final task writes the blog artifact.
- agents.yaml → tasks.yaml: assigned to · Agents execute the configured tasks.
- MasterClass PDF → crew.py: reference · Static source material can inform the market research workflow.
- MasterClass HTML → crew.py: reference · Static source material can inform the blog workflow.
