feat(hack16): agentic search - #17544
Conversation
| {typeof artwork.priceUsd === "number" ? ( | ||
| <Text variant="xs" color="mono100"> | ||
| {formatPriceUsd(artwork.priceUsd)} | ||
| </Text> | ||
| ) : null} |
There was a problem hiding this comment.
this can't be handled by the MP Money type?
There was a problem hiding this comment.
Eventually it should. This demo simply mocks the artwork search results and does not really query MP for data.
| const response = await fetch("/api/advisor-agent/chat", { | ||
| method: "POST", | ||
| headers: { "Content-Type": "application/json" }, | ||
| body: JSON.stringify({ messages: nextWire }), | ||
| }) | ||
|
|
||
| if (!response.ok) { | ||
| throw new Error(`Request failed: ${response.status}`) | ||
| } | ||
|
|
||
| const payload = await response.json() |
There was a problem hiding this comment.
so the force backend handles this rather than mp - do we have a library like swr that can give us an easy loading state?
There was a problem hiding this comment.
It seems we are interested in building this on Eigen. If that's the case, the agentic loop will probably be moved elsewhere to be shared.
| import { type NextFunction, Router } from "express" | ||
|
|
||
| const ANTHROPIC_API_URL = "https://api.anthropic.com/v1/messages" | ||
| const MODEL = "claude-opus-4-8" |
There was a problem hiding this comment.
curious if sonnet can do this just as well - maybe good to make this configurable via the ENV.
There was a problem hiding this comment.
good idea! I probably won't add this to another env var, but it'd be helpful to evaluate.
#9574 Bundle Size — 9.03MiB (+0.06%).df560be(current) vs b83648c main#9569(baseline) Warning Bundle contains 29 duplicate packages – View duplicate packages Bundle metrics
Bundle size by type
Bundle analysis report Branch starsirius/agentic-commerce-poc Project dashboard Generated by RelativeCI Documentation Report issue |
- Keep a turn inside the app's 29s production timeout: cap the agentic loop at 4 steps and run the model at medium effort. - Require a signed-in user and bound the client-supplied transcript, so the endpoint isn't an open proxy to Artsy's Anthropic account. - Raise max_tokens to 16000 (thinking shares the budget) and pass the stop reason through so truncated, refused, and step-exhausted replies say so instead of rendering as finished answers. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The chat endpoint requires a signed-in user, but the UI only gated on the feature flag — logged-out visitors could open the panel and type, and only learn they needed an account once the request came back 403. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
| return | ||
| } | ||
|
|
||
| const messages: AgentMessage[] = [...incomingMessages] |
There was a problem hiding this comment.
The client-supplied messages array is forwarded verbatim to Anthropic with no per-user or per-session rate limiting. Any signed-in user (once the flag is on) can supply arbitrary role/content blocks — including fabricated system-style instructions — and get a general-purpose Claude Opus proxy billed to Artsy's account. The per-request size bounds cap one turn, but nothing caps requests per user. Since the PR notes this "spends against Artsy's Anthropic account," consider a simple per-user rate limit before this graduates from the flag. Not blocking given it's flag-gated and login-gated.
Code ReviewSummaryAdds a flag-gated ( Issues FoundReviewed against the hackathon-behind-a-flag framing, so nothing here is blocking. 🟡 Important — no per-user rate limiting on a metered endpoint ( 🟢 Suggestion — failed turn desyncs transcript from wire state ( 🟢 Suggestion — substring title match produces false previews ( 🟢 Suggestion — demo catalog links/images point to staging ( Areas Reviewed
Questions for Author
|
|
@rquartararo do you think we can merge this as is, to play around on staging? |
rquartararo
left a comment
There was a problem hiding this comment.
Excited to test this out!
The type of this PR is: Feat
Description
This PR includes the agentic search experience from the hackathon (with the commerce portion removed).
emerald_agentic-searchfeature flag, and if we want to, it's safe to merge and iterate.Agentic loop considerations
Migration
-[x] Set the
ANTHROPIC_API_KEYsecret