# Installation vs Documentation Syntax

**URL:** <https://community.crewai.com/t/installation-vs-documentation-syntax/755>\
**Category:** CrewAI Community Support\
**Created:** [October 13, 2024, 3:07am UTC](https://community.crewai.com/t/installation-vs-documentation-syntax/755 "2024-10-13T03:07:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Naxio](https://avatars.discourse-cdn.com/v4/letter/n/a183cd/32.png) [@Naxio](https://community.crewai.com/u/Naxio)\
**Post date:** [October 13, 2024, 3:07am UTC](https://community.crewai.com/t/installation-vs-documentation-syntax/755/1 "2024-10-13T03:07:25Z")

</div>

I’m a little confused by the different structures between what we are given as default in the installation process (_crewai install_, resulting in the file structure listed [here](https://docs.crewai.com/installation)) versus a structure largely to our own making.

For example, following the Quickstart guidance we create an Agent this way:

```auto
	@agent
	def researcher(self) -> Agent:
		return Agent(
			config=self.agents_config['researcher'],
			#tools=[search_tool],
			verbose=True
		)

```

But the Documentation describes it like this:

```auto
agent1 = CustomAgent(
    role="agent role",
    goal="who is {input}?",
    backstory="agent backstory",
    verbose=True,
)

```

In this example, it’s pretty simple to translate between the two, but when I attempt to do anything a little more advanced than what is given in the pre-installed example I keep getting errors. (How do I create a manager agent, for example?)

Am I missing something? Should I just scrap the structure provided during the _crewai create crew [project]_ process and make my own?

---

<div class="post-metadata">

**Author:** ![rokbenko](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/rokbenko/32/492_2.png) [@rokbenko](https://community.crewai.com/u/rokbenko)\
**Post date:** [October 13, 2024, 8:52am UTC](https://community.crewai.com/t/installation-vs-documentation-syntax/755/2 "2024-10-13T08:52:57Z")

</div>

There are two ways of creating a CrewAI project:

- using YAML files or
- not using YAML files.

When you use YAML files, you create an agent and a task with the `@agent` and `@task` decorators as follows (_Note: You need to use [Poetry](https://python-poetry.org/)._):

agents.yaml

```auto
researcher:
  role: >
    Researcher
  goal: >
    Write goal here.
  backstory: >
    Write backstory here.

```

tasks.yaml

```auto
research_task:
  agent: researcher
  description: >
    Write description here.
  expected_output: >
    Write expected output here.

```

crew.py

```auto
@agent
  def researcher(self) -> Agent:
    return Agent(
      config=self.agents_config['researcher'],
      verbose=True,
      tools=[SerperDevTool()]
    )

@task
  def research_task(self) -> Task:
    return Task(
      config=self.tasks_config['research_task'],
    )

```

When you don’t use YAML files, you create an agent and a task as follows:

main.py

```auto
researcher = Agent(
  role='Researcher',
  goal='Write goal here.',
  backstory='Write backstory here.',
  tools=[SerperDevTool()],
)

research_task = Task(
  agent: researcher,
  description: 'Write description here.',
  expected_output: 'Write expected output here.',

```

Which way of creating a CrewAI project should you choose? I would strongly recommend you use YAML files.

Why?

1. YAML provides a clear, organized way to configure agents and tasks. This structure makes it easier to manage and update your project configuration.
2. You’ll pick up the [Flows](https://docs.crewai.com/concepts/flows), which where introduced just a few days ago, way quicker since it uses YAML files for agent and task configuration.

If you choose using YAML files, please take a look at the [Quickstart](https://docs.crewai.com/quickstart) page or [Flows](https://docs.crewai.com/concepts/flows) page (_Note: If you don’t want to use Flows, just see this page as another example of YAML files and pay attention to the `@agent` and `@task` decorators._).

---

<div class="post-metadata">

**Author:** ![Naxio](https://avatars.discourse-cdn.com/v4/letter/n/a183cd/32.png) [@Naxio](https://community.crewai.com/u/Naxio)\
**Post date:** [October 13, 2024, 3:40pm UTC](https://community.crewai.com/t/installation-vs-documentation-syntax/755/3 "2024-10-13T15:40:01Z")

</div>

Thanks, Flows look pretty powerful! I’ll have to dig into them.

So if I’m understanding the process correctly, even if I use a YAML structure, I should be able to utilize any of the syntax structure as outlined in the documentation?

---

<div class="post-metadata">

**Author:** ![rokbenko](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/rokbenko/32/492_2.png) [@rokbenko](https://community.crewai.com/u/rokbenko)\
**Post date:** [October 13, 2024, 4:34pm UTC](https://community.crewai.com/t/installation-vs-documentation-syntax/755/4 "2024-10-13T16:34:16Z")

</div>

@Naxio Nothing you see in the docs is incorrect. It’s just a different way of creating a CrewAI project. The only thing you need to be careful about is not to mix both ways.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex025/uploads/crewai/original/1X/ecda97e72f77c7100e0a761444b1c991925cc789.png) [@system](https://community.crewai.com/u/system)\
**Post date:** [November 15, 2024, 8:18pm UTC](https://community.crewai.com/t/installation-vs-documentation-syntax/755/5 "2024-11-15T20:18:49Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
