Skip to content

Commit c9d71dc

Browse files
authored
copy examples from public sdk, rename galileo to splunk
1 parent ffaf2a2 commit c9d71dc

446 files changed

Lines changed: 49779 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

examples/.gitignore

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
*.py,cover
50+
.hypothesis/
51+
.pytest_cache/
52+
cover/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
.pybuilder/
76+
target/
77+
78+
# Jupyter Notebook
79+
.ipynb_checkpoints
80+
81+
# IPython
82+
profile_default/
83+
ipython_config.py
84+
85+
# pyenv
86+
# For a library or package, you might want to ignore these files since the code is
87+
# intended to run in multiple environments; otherwise, check them in:
88+
# .python-version
89+
90+
# pipenv
91+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94+
# install all needed dependencies.
95+
#Pipfile.lock
96+
97+
# UV
98+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99+
# This is especially recommended for binary packages to ensure reproducibility, and is more
100+
# commonly ignored for libraries.
101+
#uv.lock
102+
103+
# poetry
104+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105+
# This is especially recommended for binary packages to ensure reproducibility, and is more
106+
# commonly ignored for libraries.
107+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108+
#poetry.lock
109+
110+
# pdm
111+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
112+
#pdm.lock
113+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
114+
# in version control.
115+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
116+
.pdm.toml
117+
.pdm-python
118+
.pdm-build/
119+
120+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
121+
__pypackages__/
122+
123+
# Celery stuff
124+
celerybeat-schedule
125+
celerybeat.pid
126+
127+
# SageMath parsed files
128+
*.sage.py
129+
130+
# Environments
131+
.env
132+
.venv
133+
env/
134+
venv/
135+
ENV/
136+
env.bak/
137+
venv.bak/
138+
139+
# Spyder project settings
140+
.spyderproject
141+
.spyproject
142+
143+
# Rope project settings
144+
.ropeproject
145+
146+
# mkdocs documentation
147+
/site
148+
149+
# mypy
150+
.mypy_cache/
151+
.dmypy.json
152+
dmypy.json
153+
154+
# Pyre type checker
155+
.pyre/
156+
157+
# pytype static type analyzer
158+
.pytype/
159+
160+
# Cython debug symbols
161+
cython_debug/
162+
163+
# PyCharm
164+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
165+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
166+
# and can be added to the global gitignore or merged into this file. For a more nuclear
167+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
168+
#.idea/
169+
170+
# Ruff stuff:
171+
.ruff_cache/
172+
173+
# PyPI configuration file
174+
.pypirc

examples/agent/crewAI/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# CrewAI + Splunk AO Examples
2+
3+
This repo contains examples of how to use Splunk AO to instrument [CrewAI](https://www.crewai.com/) agents for observability and evaluation engineering.
4+
5+
## research_crew
6+
7+
The [resarch-crew](./research_crew/) is a quickstart tutorial. It is a completed version of the [CrewAI quickstart](https://docs.crewai.com/en/quickstart) and adds the
8+
Splunk AO's [CrewAIEventListener](https://docs.galileo.ai/sdk-api/python/reference/handlers/crewai/handler),
9+
an event handler implemented on top of OpenTelemetry (OTel). For more information, see
10+
Splunk AO’s [Add Splunk AO to a CrewAI Application](https://docs.galileo.ai/how-to-guides/third-party-integrations/add-galileo-to-crewai/add-galileo-to-crewai)
11+
how-to guide.
12+
13+
See the [README.md](./research_crew/README.md) for detailed setup instructions.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.env
2+
__pycache__/
3+
.DS_Store
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# CrewAI and Splunk AO Cookbook
2+
3+
This tutorial is a completed version of the [CrewAI quickstart](https://docs.crewai.com/en/quickstart) and adds the
4+
Splunk AO [CrewAIEventListener](https://docs.galileo.ai/sdk-api/python/reference/handlers/crewai/handler),
5+
an event handler implemented on top of OpenTelemetry (OTel). For more information, see
6+
Splunk AO’s [Add Splunk AO to a CrewAI Application](https://docs.galileo.ai/how-to-guides/third-party-integrations/add-galileo-to-crewai/add-galileo-to-crewai)
7+
how-to guide.
8+
9+
Below you'll find concise setup steps, configuration notes, and a short primer on Splunk AO so you know why we add it and what it provides.
10+
11+
## Resources
12+
13+
The relevant guides:
14+
15+
- [Add Splunk AO to CrewAI](https://docs.galileo.ai/how-to-guides/third-party-integrations/add-galileo-to-crewai/add-galileo-to-crewai)
16+
- [CrewAI quickstart](https://docs.crewai.com/en/guides/crews/first-crew)
17+
18+
## What is Splunk AO?
19+
20+
[Splunk AO](https://galileo.ai) is an observability and evaluation platform for generative AI agents. Integrating Splunk AO into a CrewAI project gives you:
21+
22+
- Structured logging of prompts, agent decisions, and model responses.
23+
- Metrics, logs, and traces to evaluate agent performance and behavior over time.
24+
- A centralized dashboard for debugging, auditing, and running evaluations on AI agents.
25+
26+
## Why add Splunk AO here?
27+
28+
- Faster troubleshooting: quickly find which agent produced what output and why
29+
- Better evaluation: collect examples, compare model versions, and compute metrics
30+
- Reproducibility: attach metadata (env, model, prompt) to recorded runs for later analysis
31+
32+
## Prerequisites
33+
34+
- Python 3.10–3.13
35+
- `uv` installed and available.
36+
- [CrewAI CLI](https://docs.crewai.com/en/installation) installed and available.
37+
- A [Splunk AO API key](https://app.galileo.ai/)
38+
- A [Serper API Key](https://serper.dev/)
39+
- An [OpenAI Key](https://platform.openai.com/)
40+
41+
## Quick setup
42+
43+
Run these steps from the repository root.
44+
45+
1. Clone and open the repo
46+
47+
```zsh
48+
git clone https://github.com/rungalileo/sdk-examples.git
49+
cd sdk-examples/python/agent/crewAI/research_crew
50+
```
51+
52+
2. Copy the .env.example and configure credentials
53+
54+
```zsh
55+
cp .env.example .env
56+
```
57+
58+
In addition to API keys, you’ll need to specify a Splunk AO project and log stream (e.g. SPLUNK_AO_PROJECT and SPLUNK_AO_LOG_STREAM). All CrewAI run data will be logged to this destination in Splunk AO. See
59+
[Understanding the Splunk AO Integration](#understanding-the-galileo-integration) for more detail.
60+
61+
3. Install project dependencies into the active environment:
62+
63+
```zsh
64+
crewai install
65+
```
66+
67+
4. Run the Crew
68+
69+
```zsh
70+
crewai run
71+
```
72+
73+
## Understanding the Splunk AO Integration
74+
75+
Splunk AO integrates with CrewAI by registering an event listener that captures Crew execution events (e.g., agent actions, tool calls, model responses) and forwards them to Splunk AO for observability and evaluation. Under the hood, this integration is built on OpenTelemetry (OTel) for standardized tracing and telemetry collection.
76+
77+
### Register the event listener
78+
79+
At the beginning of your run() function (or before starting the Crew), instantiate the Splunk AO event listener:
80+
81+
```python
82+
83+
def run():
84+
# Create the event listener (registers itself with CrewAI)
85+
CrewAIEventListener()
86+
87+
# The rest of your existing code goes here
88+
```
89+
90+
This is instrumented in [main.py](research_crew/src/research_crew/main.py).
91+
92+
### What this does
93+
94+
Creating a CrewAIEventListener() instance is all that’s required to enable Splunk AO for a CrewAI run. When instantiated, the listener:
95+
96+
- Automatically registers itself with CrewAI
97+
- Uses OpenTelemetry (OTel) to instrument Crew execution events
98+
- Reads Splunk AO configuration from environment variables
99+
- Logs all run data to the Splunk AO project and log stream specified by
100+
`SPLUNK_AO_PROJECT` and `SPLUNK_AO_LOG_STREAM`
101+
102+
No additional configuration or code changes are required. All data from this run is logged to the Splunk AO project and log stream specified by your environment configuration (for example, SPLUNK_AO_PROJECT and SPLUNK_AO_LOG_STREAM).
103+
104+
## CrewAI Support
105+
106+
For support, questions, or feedback regarding the ResearchCrew Crew or crewAI.
107+
108+
- Visit the [CrewAI documentation](https://docs.crewai.com)
109+
- Reach out to CrewAI through their [GitHub repository](https://github.com/joaomdmoura/crewai)
110+
- [Join the CrewAI Discord](https://discord.com/invite/X4JWnZnxPb)
111+
- [Chat with the CrewAI docs](https://chatg.pt/DWjSBZn)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
User name is John Doe.
2+
User is an AI Engineer.
3+
User is interested in AI Agents.
4+
User is based in San Francisco, California.
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
---
2+
3+
# Comprehensive Report on Artificial Intelligence in Healthcare
4+
5+
**Executive Summary:**
6+
Artificial Intelligence (AI) is transforming the healthcare industry by enhancing diagnostic accuracy, revolutionizing treatment personalization, and improving operational efficiency. This report analyzes key concepts, historical developments, challenges, and opportunities associated with AI in healthcare. It also highlights prominent case studies and explores potential future developments. By examining current trends and future potential, this report provides a comprehensive perspective on AI's transformative role in the healthcare sector.
7+
8+
---
9+
10+
## 1. Key Concepts and Definitions
11+
12+
**Artificial Intelligence in Healthcare:**
13+
AI in healthcare entails the use of machine learning algorithms and software to emulate human cognition in analyzing, interpreting, and understanding complex medical and health data. It aims to provide solutions that enhance clinical practices and outcomes.
14+
15+
**Machine Learning:**
16+
A critical subset of AI, machine learning involves algorithms that empower computers to learn from new data and make informed decisions without human intervention. Its applications include predictive analytics and pattern recognition in patient data.
17+
18+
**Natural Language Processing:**
19+
Natural Language Processing (NLP) is the AI technology that enables machines to understand and generate human language. In healthcare, NLP is instrumental in augmenting clinical documentation and managing electronic health records.
20+
21+
_References:_
22+
- [NIH Overview of AI in Medicine](https://pmc.ncbi.nlm.nih.gov/articles/PMC6691444/).
23+
- [Arm Glossary on AI in Healthcare](https://www.arm.com/glossary/ai-in-healthcare).
24+
25+
---
26+
27+
## 2. Historical Development and Recent Trends
28+
29+
**Development Timeline:**
30+
The integration of AI in healthcare began in the 1960s. Its journey saw significant advancements with the adoption of electronic health records and evolving data analytics capabilities, proving crucial in contemporary medical practices.
31+
32+
**Current Trends:**
33+
AI currently plays a pivotal role in enhancing diagnostic accuracy, personalizing treatment, and optimizing healthcare operations. Emerging technological integrations have elevated its effectiveness in clinical workflows and patient management systems.
34+
35+
_References:_
36+
- [National Library of Medicine Historical Review](https://pmc.ncbi.nlm.nih.gov/articles/PMC11122160/).
37+
- [Inferscience Milestones in AI](https://www.inferscience.com/10-milestones-in-the-history-of-ai-in-healthcare).
38+
39+
---
40+
41+
## 3. Major Challenges and Opportunities
42+
43+
**Challenges:**
44+
The primary challenges faced include ethical considerations around data privacy and potential biases, the high initial investment costs, algorithmic accountability, and the complexities of integrating AI into existing healthcare frameworks.
45+
46+
**Opportunities:**
47+
AI opens numerous opportunities, such as enhancing diagnostic processes, advancing predictive analytics, tailoring patient care, and accelerating drug discovery. These innovations promise to bolster clinical efficiency and patient outcomes.
48+
49+
_References:_
50+
- [Forbes on AI Opportunities and Challenges](https://www.forbes.com/councils/forbesbusinesscouncil/2023/02/07/top-five-opportunities-and-challenges-of-ai-in-healthcare/).
51+
- [ScienceDirect on Ethical Implications](https://www.sciencedirect.com/science/article/pii/S1078143923004179).
52+
53+
---
54+
55+
## 4. Notable Applications or Case Studies
56+
57+
**AI-Assisted Diagnostics:**
58+
AI applications, like Aidoc, facilitate radiology workflows by accurately predicting anomalies in medical imaging, significantly improving diagnostic precision.
59+
60+
**Personalized Treatment Planning:**
61+
IBM Watson for Oncology exemplifies how AI can assist oncologists in customizing cancer treatment plans, thus illustrating AI's potential in personalizing healthcare strategies.
62+
63+
_References:_
64+
- [VKTR AI Case Studies](https://www.vktr.com/ai-disruption/5-ai-case-studies-in-health-care/).
65+
- [Philips Real-World AI Applications](https://www.philips.com/a-w/about/news/archive/features/2022/20221124-10-real-world-examples-of-ai-in-healthcare.html).
66+
67+
---
68+
69+
## 5. Future Outlook and Potential Developments
70+
71+
**Predictions:**
72+
AI is poised to revolutionize healthcare delivery through hybrid models that complement human decision-making with AI-powered insights, enhancing diagnostic speed and accuracy.
73+
74+
**Growth Areas:**
75+
Future expansions in AI applications are anticipated in areas like preventive care, mental health support, and chronic disease management, which promise to redefine standard healthcare delivery models.
76+
77+
_References:_
78+
- [Deloitte AI Future Insights](https://www.deloitte.com/us/en/Industries/life-sciences-health-care/articles/future-of-artificial-intelligence-in-health-care.html).
79+
- [International SOS AI Outlook](https://www.internationalsos.com/magazine/how-ai-is-transforming-the-future-of-healthcare).
80+
81+
---
82+
83+
**Conclusion:**
84+
AI is a transformative force in healthcare, promising improvements in diagnostic accuracy, treatment personalization, and operational efficiency. Overcoming the existing challenges, AI offers robust opportunities that can fundamentally reshape healthcare delivery. The ongoing advancements and integration of AI technologies are crucial for achieving future innovations in various sectors of healthcare.
85+
86+
---

0 commit comments

Comments
 (0)