Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions examples/market_monitoring/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#AGENTOPS_API_KEY=...
#OPENAI_API_KEY=...

# Tools
AGENTQL_API_KEY=...
166 changes: 166 additions & 0 deletions examples/market_monitoring/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
.pdm.toml
.pdm-python
.pdm-build/

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

.agentops/
agentstack.log
.agentstack*
10 changes: 10 additions & 0 deletions examples/market_monitoring/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

MIT License

Copyright (c) 2025 Name <Email>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
46 changes: 46 additions & 0 deletions examples/market_monitoring/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# market_monitoring

Tracks competitor websites for pricing and product updates.

## How to Build this Project

### With the CLI

```bash
agentstack init market_monitoring

agentstack generate agent web_scraper
agentstack generate task scrape_site

agentstack generate agent market_reporter
agentstack generate task report

agentstack tools add agentql
```

Add more agents with `agentstack agent <agent_name>` and more tasks with `agentstack task <task_name>`

Add tools with `agentstack tools add <tool_name>` and view tools available with `agentstack tools list`

## How to use your Agent

In this directory, run `uv pip install --requirements pyproject.toml`

To run your project, use the following command:
`agentstack run`

This will initialize your crew of AI agents and begin task execution as defined in your configuration in the main.py file.

#### Replay Tasks from Latest Crew Kickoff:

CrewAI now includes a replay feature that allows you to list the tasks from the last run and replay from a specific one. To use this feature, run:
`crewai replay <task_id>`
Replace <task_id> with the ID of the task you want to replay.

#### Reset Crew Memory

If you need to reset the memory of your crew before running it again, you can do so by calling the reset memory feature:
`crewai reset-memory`
This will clear the crew's memory, allowing for a fresh start.

> 🪩 Project built with [AgentStack](https://github.com/AgentOps-AI/AgentStack)
11 changes: 11 additions & 0 deletions examples/market_monitoring/agentstack.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"framework": "crewai",
"tools": [
"agentql"
],
"default_model": "openai/gpt-4o",
"agentstack_version": "0.3.5",
"template": "market_monitoring",
"template_version": "4",
"use_git": false
}
13 changes: 13 additions & 0 deletions examples/market_monitoring/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[project]
name = "market_monitoring"
version = "0.0.1"
description = ""
authors = [
{ name = "Name <Email>" }
]
license = { text = "MIT" }
requires-python = ">=3.10"

dependencies = [
"agentstack[crewai]>=0.3.5",
]
Empty file.
16 changes: 16 additions & 0 deletions examples/market_monitoring/src/config/agents.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
web_scraper:
role: >-
web scraper
goal: >-
Access the website and extract all relevant information about the product in a structured format.
backstory: >-
You are an expert web scraper and data extractor.
llm: openai/gpt-4o
market_reporter:
role: >-
market monitoring reporter
goal: >-
Track competitor websites for pricing and product updates, delivering insights into the dashboard.
backstory: >-
You are an expert in reporting and tracking competitor's websites.
llm: openai/gpt-4o
1 change: 1 addition & 0 deletions examples/market_monitoring/src/config/inputs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

16 changes: 16 additions & 0 deletions examples/market_monitoring/src/config/tasks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
scrape_site:
description: >-
Extract all the data about each electronic product from the following URL links:
https://www.amazon.com/gp/browse.html?rw_useCurrentProtocol=1&node=565108&ref_=amb_link_BpW_pJfGS-SH8sCy2LOykw_2
https://www.bestbuy.com/site/computers-pcs/laptop-computers/abcat0502000.c?id=abcat0502000
expected_output: >-
A json file.
agent: >-
web_scraper
report:
description: >-
Compare products and their prices between the competitor websites and give a report on their performances.
expected_output: >-
A few paragraphs about the market products.
agent: >-
market_reporter
48 changes: 48 additions & 0 deletions examples/market_monitoring/src/crew.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
from crewai import Agent, Crew, Process, Task
from crewai.project import CrewBase, agent, crew, task
import agentstack


@CrewBase
class MarketmonitoringCrew:
"""market_monitoring crew"""

@agent
def web_scraper(self) -> Agent:
return Agent(
config=self.agents_config["web_scraper"],
tools=[
*agentstack.tools["agentql"]
], # add tools here or use `agentstack tools add <tool_name>
verbose=True,
)

@agent
def market_reporter(self) -> Agent:
return Agent(
config=self.agents_config["market_reporter"],
tools=[], # add tools here or use `agentstack tools add <tool_name>
verbose=True,
)

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

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

@crew
def crew(self) -> Crew:
"""Creates the Test crew"""
return Crew(
agents=self.agents, # Automatically created by the @agent decorator
tasks=self.tasks, # Automatically created by the @task decorator
process=Process.sequential,
verbose=True,
)
Loading