A FastAPI + vanilla JS chat app fronting an Anthropic Claude agent for order status, returns, and policy questions. Architecture: - agent.py: system prompt, runtime reminder injection, output validation, agentic tool-use loop with prompt caching on the system prompt block - tools.py: four tools (lookup_order, check_return_eligibility, initiate_return, lookup_policy) with per-session SessionGuardState enforcing protocol ordering on the tool side - mock_data.py: orders, return policy, and FAQ entries used as the single source of truth by both the prompt and the tools - server.py: FastAPI app exposing /api/chat, /health, and the static UI - static/: vanilla HTML/CSS/JS chat UI, no build step - tests/: 30 tests covering tool-side enforcement, the privacy boundary, output validation, and the agent loop with a mocked Anthropic client - deploy/: systemd unit and nginx site config for production
19 lines
374 B
Desktop File
19 lines
374 B
Desktop File
[Unit]
|
|
Description=Bookly customer support agent
|
|
After=network.target
|
|
|
|
[Service]
|
|
Type=simple
|
|
User=bookly
|
|
Group=bookly
|
|
WorkingDirectory=/opt/bookly
|
|
EnvironmentFile=/opt/bookly/.env
|
|
ExecStart=/opt/bookly/venv/bin/uvicorn server:app --host 127.0.0.1 --port 8014
|
|
Restart=on-failure
|
|
RestartSec=3
|
|
StandardOutput=journal
|
|
StandardError=journal
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|