go build ./...
go vet ./...go run cmd/ingest/main.goExpected output:
- 11 documents loaded
- ~158 chunks created
- ~1485 unique TF-IDF terms
- 158 non-zero embeddings
go run cmd/server/main.goExpected startup logs:
Starting Customer Support RAG Server...
Loaded 11 documents
Created 158 chunks
Built TF-IDF vocabulary: 1485 terms
Indexed 158 chunks in vector store
Server starting on port 8080
curl http://localhost:8080/api/healthExpected:
{"status":"healthy","active_sessions":0,"documents":158}curl -s -X POST http://localhost:8080/api/chat \
-H "Content-Type: application/json" \
-d '{"query": "How do I reset my password?"}' | jq .Verify: response has session_id, answer, and sources array.
# First message
curl -s -X POST http://localhost:8080/api/chat \
-H "Content-Type: application/json" \
-d '{"query": "What pricing plans do you offer?"}' | jq .
# Copy the session_id from the response, then:
curl -s -X POST http://localhost:8080/api/chat \
-H "Content-Type: application/json" \
-d '{"query": "Which plan has the best value?", "session_id": "SESSION_ID_HERE"}' | jq .Verify: second response references context from the first turn.
# Billing
curl -s -X POST http://localhost:8080/api/chat \
-H "Content-Type: application/json" \
-d '{"query": "Do you offer a free trial?"}' | jq .answer
# Technical
curl -s -X POST http://localhost:8080/api/chat \
-H "Content-Type: application/json" \
-d '{"query": "How do I install the chat widget on my website?"}' | jq .answer
# Integrations
curl -s -X POST http://localhost:8080/api/chat \
-H "Content-Type: application/json" \
-d '{"query": "Can I connect Salesforce to CloudSupport Pro?"}' | jq .answer
# Troubleshooting
curl -s -X POST http://localhost:8080/api/chat \
-H "Content-Type: application/json" \
-d '{"query": "The chat widget is not showing on my site"}' | jq .answer
# Out-of-scope (should gracefully decline)
curl -s -X POST http://localhost:8080/api/chat \
-H "Content-Type: application/json" \
-d '{"query": "What is the weather today?"}' | jq .answercurl -s -X POST http://localhost:8080/api/chat \
-H "Content-Type: application/json" \
-d '{"query": ""}' -w "\n%{http_code}"Expected: 400 Bad Request
curl -s -X GET http://localhost:8080/api/chat -w "\n%{http_code}"Expected: 405 Method Not Allowed
curl -s -X POST http://localhost:8080/api/chat \
-H "Content-Type: application/json" \
-d 'not json' -w "\n%{http_code}"Expected: 400 Bad Request
With the server running, press Ctrl+C. Expected logs:
Shutting down server...
Shutdown complete