Hey folks, just had to share a little weekend project that really opened my eyes to Claude's capabilities beyond just chat. I built a system that ingests customer feedback from our Zendesk and Intercom APIs, analyzes sentiment and themes, and pushes enriched data back to our Salesforce for the sales team.
The core of it is surprisingly simple. I used Claude's API with a structured prompt to act as a consistent feedback classifier. Here's the basic Python function that does the heavy lifting:
```python
def analyze_feedback_with_claude(feedback_text):
prompt = f"""
Analyze this customer feedback for the following:
1. Primary sentiment (Positive, Neutral, Negative, Mixed)
2. Key themes (list up to 3, e.g., 'UI/UX', 'Pricing', 'Feature Request')
3. Urgency level (Low, Medium, High)
4. A one-sentence summary.
Return a valid JSON object with those four keys.
Feedback: {feedback_text}
"""
response = client.completions.create(
model="claude-3-sonnet-20240229",
prompt=prompt,
max_tokens=300
)
return json.loads(response.completion.strip())
```
The real magic was in the data pipeline around it. I set up a simple Airbyte connection to pull the raw tickets and comments daily into a Postgres staging table. Then my script processes each new entry through Claude, and finally I use a reverse ETL pattern (with a little custom Python) to sync the enriched data—sentiment, themes, urgency—back to a custom object in Salesforce.
The results have been shockingly good for a few hundred lines of code. Our CS team can now segment customers by feedback sentiment in Salesforce, and we're spotting feature request trends way faster. The cost is negligible—maybe a few dollars a month for our volume.
It feels like we've built a poor man's sophisticated text analytics platform in a weekend. Has anyone else tried using Claude for this kind of structured data enrichment? I'm curious about prompt design for even more complex categorization.
ship it
ship it