- Node (Express)
- Python (FastAPI)
- Return
no_answeras a200, not a404. A404is a failure and gets logged as one. - Keep the whole handler under a couple of seconds. The 8-second timeout includes network time in both directions.
- Use a dedicated secret for Anagram so you can rotate it without touching anything else. Paste the full header value (
Bearer abc123) into Studio; Anagram sends it verbatim.
Testing before you enable
Work through this with the source saved but disabled. Nothing reaches shoppers until you flip the switch.1
Send a request from your own machine
200 and a body that matches one of the two shapes.2
Test from Studio
Open the card in Brain → Knowledge and use Test a question with a few questions your system should answer and one it should not. You will see the outcome, elapsed time, and for failures the reason and HTTP status. An expected question should come back as an answer well under 8 seconds; the off-topic one should come back as no answer.
3
Break it on purpose
Temporarily change the secret in Studio to something wrong and test again. You should see
http error (HTTP 401). Change it back. This confirms your endpoint actually checks auth.4
Check product references
If you return
products, confirm the handles or GIDs belong to the store connected to this project. A reference to another store resolves to nothing and is dropped silently, so a wrong-store bug is invisible unless you check.5
Enable and watch a real conversation
Flip the switch on, open the agent preview in Studio, and ask a shopper-style question your description covers. The agent should cite your source by name and show product cards from the catalog.