examples/openai_agents_sdk/email_data_extraction_agent/README.md
This example demonstrates how to use the OpenAI Agents SDK with RagaAI Catalyst to extract structured information from emails.
The application uses OpenAI's Agents SDK to parse unstructured email text and extract key information such as:
The extracted data is structured using Pydantic models for easy manipulation and validation.
pip install -r requirements.txt
cp sample.env .env
Configure the following environment variables in your .env file:
OPENAI_API_KEY: Your OpenAI API keyCATALYST_ACCESS_KEY: Your RagaAI Catalyst access keyCATALYST_SECRET_KEY: Your RagaAI Catalyst secret keyCATALYST_BASE_URL: RagaAI Catalyst base URLPROJECT_NAME: Name for your project in RagaAI Catalyst (default: 'email-extraction')DATASET_NAME: Name for your dataset in RagaAI Catalyst (default: 'email-data')Run the example script:
python data_extraction_email.py
The script will:
You can modify the sample_email variable in the script to process different emails, or adapt the code to read emails from files or an API.
The Pydantic models (Person, Meeting, Task, EmailData) can be extended to capture additional information as needed.
This example integrates with RagaAI Catalyst for tracing and monitoring agent interactions. The integration helps with: