Repository navigation
feat(example): add ask endpoint with code memory retrieval - #5
Merged
Merged
Conversation
POST /agents/:name/ask runs a Workers AI tool-calling loop over the Code Mode runtime, shows other agents' answer-producing runs as unverified examples, records them in Codemode-Examples trailers, and indexes its own answer-producing run. Adds AI and EXAMPLES bindings, GET /agents/:name/examples, and scripts/walkthrough.mjs for the michelle/matthew demo.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #3.
POST /agents/:name/ask({"question": "...", "useExamples"?: false}): retrieves up to 3 other agents' answer-producing runs (Vectorize, scopelamps), runs a@cf/zai-org/glm-5.3-flashtool-calling loop (codemode+final_answer, 10 steps), records shown examples inCodemode-Examplestrailers with the question as commit subject, flushes, and indexes the answer-producing run. Loop trimmed frombenchmarks/dabstep/src/solver.tsintoexamples/agent/src/ask.ts.GET /agents/:name/examples?question=...: whataskwould retrieve (one embedding, no chat model). Used by the walkthrough to wait out Vectorize lag.AIandEXAMPLESbindings incloudflare.config.tsandwrangler.jsonc, with descriptions inpackage.json.scripts/walkthrough.mjs: michelle (all flowing lamps, 67), wait until retrievable, matthew (red flowing lamps, 10), side-by-side summary.askand walkthrough.Verified:
npm run typecheck,npm test,cf build --mode production,cf deploy --prebuilt --mode production --dry-run,wrangler deploy --dry-run(both list AI and EXAMPLES),node --check, walkthrough against a local mock server. Not run live.