- Automated weekly data updates from Zendesk and README documentation
- AI-powered response generation using Anthropic's model
- Integration with Forge (https://forge-ml.com/) for efficient data storage and retrieval
- RESTful API endpoint for generating response suggestions
- Scheduled jobs for maintaining up-to-date support data
- PostgreSQL database for storing ticket and user information
-
Clone the repository:
git clone [your-repository-url] cd rotabull-customer-response-suggester
-
Install dependencies:
bun install
-
Set up environment variables in a
.env
file:ANTHROPIC_API_KEY=your_anthropic_api_key README_API_TOKEN=your_readme_api_token ZENDESK_API_TOKEN=your_zendesk_api_token ZENDESK_USER_EMAIL=your_zendesk_email ZENDESK_SUBDOMAIN=your_zendesk_subdomain FORGE_KEY=your_forge_key DATABASE_URL=your_database_url
To start the application:
bash bun run checkZendeskFirst.ts
POST /suggest
Request body:
{ "subject": "My subject", "requester": "[email protected]", "text_body": "I'm having an issue with XYZ...", "html_body": "
I'm having an issue with XYZ...
" }Response: { "suggested_articles": [ "https://support.rotabull.com/docs/article-slug-1", "https://support.rotabull.com/docs/article-slug-2" ], "suggested_response": "AI-generated response text" }
GET /triggerManualJob
Manually triggers the data update job.
The project uses TypeScript and is structured as follows:
src/
: Contains the main application logiccheckZendeskFirst.ts
: Main Express application setupfetchReadme.ts
: Fetches and processes README documentationfetchTickets.ts
: Fetches and processes Zendesk ticketsfetchUsers.ts
: Fetches and stores Zendesk user datascheduledJobs.ts
: Defines scheduled jobs for data updateshandler.ts
: Serverless handler for the APIscheduledJobHandler.ts
: Serverless handler for scheduled jobs
prisma/
: Database schema and migrationsscripts/
: Utility scripts for database operationsforge/
: Configuration for Forge ML integration
- Express Application: The main API is built using Express.js.
- Prisma ORM: Used for database operations and schema management.
- Forge ML: Integrated for efficient data storage and retrieval.
- Serverless Framework: Used for deploying the application to AWS.
- Cron Jobs: Implemented for regular data updates.
The application is configured for deployment on AWS using Serverless Framework. To deploy:
- Ensure you have the Serverless Framework installed and configured with your AWS credentials.
- Run the deployment command:
serverless deploy
The PostgreSQL database includes the following main tables:
ForgeTicketCollection
: Stores a reference to Forge collections for ticketsForgeDocsCollection
: Stores a reference to Forge collections for documentationSupportDoc
: Stores README documentationZendeskTicket
: Stores Zendesk ticket informationZendeskTicketComment
: Stores comments associated with Zendesk ticketsZendeskUser
: Stores Zendesk user information