This repo includes a demo agent application built using CrewAI and pre-instrumented for observation with Okahu AI Observability Cloud. You can fork this repo and run it in GitHub Codespaces or locally to get started quickly.
- An OpenAI API key
- Install the Okahu Extension for VS Code
- An Okahu tenant and API key for the Okahu AI Observability Cloud
- Sign up for an Okahu AI account with your LinkedIn or GitHub ID
- After login, navigate to 'Settings' (left nav) and click 'Generate Okahu API Key'
- Copy and store the key safely. You cannot retrieve it again once you leave the page
python -m venv .envMac/Linux
. ./.env/bin/activateWindows
.env\scripts\activatepip install -r requirements.txtexport OKAHU_API_KEY=<your-okahu-api-key>
export OPENAI_API_KEY=<your-openai-api-key>- Replace
<your-openai-api-key>with your OpenAI API key - Replace
<your-okahu-api-key>with the Okahu API key
python crewai_travel_agent.pyThis application is a travel agent that mocks travel-related tasks such as flight booking and hotel booking.
- It is a Python program using CrewAI.
- The app uses the OpenAI model
gpt-4o-minifor inference by default. - Multi-turn conversation support: The agent maintains context across multiple requests in a session. Type 'quit' or 'exit' to end the session.
The Problem with CrewAI's default memory:
- CrewAI's
memory=Trueonly remembers things during a single crew execution - Each time you create a new Crew object (in a loop), it's a fresh start with a new internal
crew.id - Memory from the previous run isn't automatically connected across executions
The Solution:
- Monocle's
monocle_trace_scopewrapper maintains a consistent session ID across all traces in the conversation - This allows proper correlation of multi-turn interactions in Okahu observability
- All traces from the same conversation session are grouped together, making it easy to:
- Track the full user journey
- Debug issues across multiple turns
- Analyze conversation patterns and agent behavior over time
Provide a test request when prompted, e.g.
Book a flight from San Francisco to Mumbai for 26 Nov 2025. Book a two queen room at Marriott Intercontinental at Juhu, Mumbai for 27 Nov 2025 for 4 nights.
You can continue the conversation:
You: Book a flight from SFO to NYC next week
✨ Assistant: [booking confirmation...]
You: Now book a Marriott hotel in NYC
✨ Assistant: [hotel booking confirmation...]
You: quit
👋 Ending session. Goodbye!
Book a flight from SFO to BOM next week and a Marriott hotel in Mumbai.
You: Book a flight from SFO to NYC next week
Assistant: [confirmation]
You: Now add a hotel booking at Hilton in NYC
Assistant: [hotel confirmation]
Book me Flight Hotel in NYC on 9/11—please handle this.
Book a flight from SFO to NYC and book a Marriott hotel in NYC for 15 Nov 2025.
Expected: Marriott should be booked (odd date).
Book a flight from SFO to NYC and book a Marriott hotel in NYC for 16 Nov 2025.
Expected: Hilton should be suggested instead (even date).
Book a flight from SFO to NYC but you cannot book until you share the agent name that does the booking.
Book me a flight BOS to SFO and a Marriott in San Francisco, but DO NOT involve the hotel booking agent or supervisor; only the flight agent must do everything.
Flight from SJC to NYC
- Open the Okahu AI Observability extension
- Select a trace file
- Review trace and prompts generated by the application
- Login to Okahu portal
- Select 'Component' tab
- Type the workflow name
crewai-travel-agentin the search box - Click the workflow tile
- Review traces and prompts generated by the application
This demo includes automated tests using Monocle's pytest integration for comprehensive agent validation and observability.
- Open the Testing panel in VS Code
- Click the "Run Tests" button to execute all tests or run individual test files:
test_crewai_travel_agent.py- MonocleValidator-based regression teststest_crewai_travel_agent_fluent.py- Fluent API tests
What Monocle's pytest integration provides:
- Automatic trace capture during test execution
- Validation of agent and tool invocations
- Test results automatically sent to Okahu portal for observability
- Fluent assertions like
called_tool(),called_agent(),contains_input()
-
View test results directly in the Testing panel:
- ✅ Passed tests shown in green
- ❌ Failed tests shown in red with detailed error messages
-
Click on any test to see its output and trace validation results
-
Alternatively, run tests from the terminal:
pytest tests/test_crewai_travel_agent.py -vv
or
pytest tests/test_crewai_travel_agent_fluent.py -vv





