Set up the project environment, configure language model access, and download the commercial contract your agents will review.
Project setup#
Create an isolated workspace and install the required dependencies:
1 $ mkdir contract-crew && cd contract-crew
2 $ python3.13 -m venv env
3 $ source env/bin/activate
4
5 ( env ) $ pip install crewai == 1.15 .28 crewai-tools == 1.15 .28
Note
CrewAI supports Python 3.10 through 3.13. You can also use uv or Poetry without changing any code.
Choose a model#
CrewAI reads provider configurations from environment variables. Set MODEL to your target language model in a .env file:
1 # .env
2
3 MODEL = gpt-4.1-mini
4 OPENAI_API_KEY = <your-openai-api-key>
To run models locally without API fees, install Ollama and pull an open-weights model:
1 # .env
2
3 MODEL = ollama/llama3.2
Heads up
Lightweight local models are suitable for experimentation but less consistent at complex tool calling and multi-step reasoning.
Exclude credentials and build artifacts from version control:
# .gitignore
.env env output __pycache__
Sample contract#
The crew reviews a commercial software agreement between Acme Analytics and Northwind Traders. Download the document into a contracts directory:
1 ( env ) $ mkdir contracts
2 ( env ) $ curl -o contracts/acme-saas-agreement.md https://textview.ai/learn-files/introduction-to-agentic-systems/acme-saas-agreement.md
Review the renewal and pricing terms in Section 2:
1 ## 2. Term and renewal
2
3 2.1 The initial term starts on the Effective Date and lasts 12 months.
4
5 2.2 After the initial term, this Agreement renews automatically for successive 12-month renewal terms unless either party gives written notice of non-renewal at least 60 days before the end of the then-current term.
6
7 2.3 Provider may increase the fees for any renewal term by up to 7% by giving Customer notice at least 30 days before that renewal term starts.
Verify your initial directory structure:
contract-crew ├── .env ├── .gitignore └── contracts └── acme-saas-agreement.md
Initialize version control to track project changes:
1 ( env ) $ git init && git add . && git commit -m "Initial commit"