- Introduction
- Features
- Prerequisites
- Installation
- Configuration
- Running the Application
- Usage
- Project Structure
- Disclaimer
The Chartwell Insurance AI Assistant is a Streamlit application designed to assist the customer service team of Chartwell Insurance. It leverages OpenAI's GPT-4 model to provide accurate and professional answers to customer queries and emails. The assistant can ingest company documents to enhance its knowledge base, ensuring responses are based on the most recent and relevant information.
- Document Upload: Upload TXT, PDF, or DOCX files to enrich the assistant's knowledge base.
- Intelligent Chatbot: Interact with the AI assistant to get detailed and professional responses to customer queries.
- Contextual Understanding: The assistant retrieves relevant information from uploaded documents using Pinecone vector embeddings.
- Email Formatting: Responses are formatted as customer service emails, including subject lines and personalized greetings.
- Session Management: Clear conversation history and manage your chat sessions.
- FAQ Section: Access frequently asked questions for quick guidance.
- Python 3.8 or higher
- An OpenAI API key
- A Pinecone API key
- LlamaParser for PDF parsing
- Spacy for natural language processing
-
Clone the Repository
git clone https://github.com/yourusername/chartwell-insurance-ai-assistant.git cd chartwell-insurance-ai-assistant -
Create a Virtual Environment
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install Dependencies
pip install -r requirements.txt
-
Set Up Environment Variables
Create a
.envfile in the project root directory and add your API keys:OPENAI_API_KEY=your_openai_api_key PINECONE_API_KEY=your_pinecone_api_key
-
Configure Pinecone
Initialize Pinecone in your code or as part of your environment setup:
import pinecone pinecone.init(api_key=os.getenv("PINECONE_API_KEY"))
-
Download Spacy Model
python -m spacy download en_core_web_sm
-
Set Up LlamaParser
Follow the instructions on the LlamaParser GitHub page to install and configure.
streamlit run app.pyReplace app.py with the name of your main Python script if different.
- Navigate to the Document Upload page.
- Click on "Choose TXT or PDF files" and select your documents.
- Click "Upload and Index Documents" to add them to the AI assistant's knowledge base.
- Note: Currently supports up to 1,000 pages per day (1,200 pages per file max).
- Navigate to the Chatbot page.
- Fill in the email details in the sidebar:
- Email Subject
- Recipient Name
- Your Name
- Enter your question in the chat input box.
- The assistant will provide a response formatted as an email.
- Use the Copy button to copy the response to your clipboard.
- Clear the conversation using the 🗑️ Clear Conversation button in the sidebar if needed.
Access the FAQ page to find answers to common questions about using the application.
chartwell-insurance-ai-assistant/
├── app.py
├── requirements.txt
├── README.md
├── .env
└── src/
├── utils/
│ ├── document_processing.py
│ ├── embeddings.py
│ └── chatbot_functions.py
└──
- app.py: Main application script.
- requirements.txt: Python dependencies.
- .env: Environment variables (not committed to version control).
- assets/: Images and media for the README and application.
- src/: Source code directory.
- utils/: Utility modules for document processing, embeddings, and chatbot functions.
- templates/: Template files such as the system prompt primer.
© 2024 Chartwell Insurance. All rights reserved.
Disclaimer: Chartwell Insurance AI is a tool and may provide inaccurate information. Always verify important details.
