Building an AI Sales Assistant with Claude API: Tutorial with Real Results
How we built and integrated an AI sales chatbot into the NWTsoft website using Anthropic's Claude API, streaming responses, system prompt design, and React integration.
Why Claude API?
As an enterprise software company, we wanted to integrate an AI-powered sales assistant into our website. Our reasons for choosing Claude:
- Long context window (200K tokens): Enables comprehensive answers based on technical questions and project history
- Instruction following quality: Strictly adheres to the identity and constraints defined in the system prompt
- Streaming support: Real-time text flow while users wait for responses
- Turkish language performance: Noticeable advantage in Turkish technical content vs. alternatives
Architecture Overview
User Browser (React)
│
│ POST /api/v1/chat/message { message, sessionId }
▼
.NET 8 API (ChatController)
│
│ Anthropic Messages API — streaming
▼
Claude Sonnet 4.6
│
│ Server-Sent Events (SSE) → text/event-stream
▼
React AiChatWidget (ReadableStream)
System Prompt Design
This is the most critical step. A poor system prompt causes the model to drift from the corporate identity.
The prompt defines: company identity, task scope (understand needs, share case studies, direct to contact), constraints (no price quotes, no competitor comments, max 3 paragraphs), and includes specific company context data.
Key Learnings
- Add company data to the system prompt. For a question like "what does NWTsoft do?", the model needs specific content to respond in brand voice rather than as a generic AI.
- Streaming dramatically improves UX. Users find real-time streaming text much more natural than a single 2-second response.
- Monitor token costs. Session management to clear context windows is critical — long conversations increase API costs exponentially.
- Fallback mechanism is essential. When the API is down, show users a meaningful error message and email redirect.