Data Collection Workflow Update#74
Conversation
Introduces the "Clear & Populate" flow: an AI agent (Claude Sonnet 4.6 via OpenRouter) searches the web using TinyFish APIs, fetches page content, and inserts real data into datasets row by row. Backend: - Mastra populate workflow (clear rows → build prompt → run agent) - Populate agent with 7 tools: 5 database CRUD (insert, list, get, update, delete) + 2 web (search_web via TinyFish Search API, fetch_page via TinyFish Fetch API) - All tools return structured errors so the agent can self-correct - Data keys are sanitized to strip stray quotes/backticks from LLM output - Fetch responses capped at 15K chars to protect agent context window - Convex client uses anyApi to avoid cross-project imports in Docker - POST /populate route with Clerk JWT auth Frontend: - "Clear & Populate" button on dataset detail page - API client function in lib/backend.ts - Rows appear in realtime via Convex reactive queries Convex: - New internal functions: datasetRows.get (query) and datasetRows.remove (mutation) for single-row read/delete Infra: - TINYFISH_API_KEY wired through docker-compose.dev.yml to backend and mastra services Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Enforce dataset ownership on POST /populate by querying Convex for the dataset and comparing ownerId to req.auth.userId before running the workflow (fixes authz gap) - Remove raw row payloads from insert_row/update_row logs, log column count instead to avoid PII leakage - Add 30s AbortController timeouts to both TinyFish fetch calls in web-tools.ts so they can't hang indefinitely - Align PopulateResult type (rows → result) to match actual backend response shape Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Convex query for dataset lookup can throw on invalid IDs — wrapping it in the existing try/catch ensures controlled 400 responses instead of unhandled 500s. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Integrate #26 populate agent foundation while keeping the self-healing HTTP path, source-backed Mastra agent instructions, and populate tools. Co-authored-by: Cursor <cursoragent@cursor.com>
Branched from codex/collection-official-website-sources at the merge commit that integrated main (PR #26). Co-authored-by: Cursor <cursoragent@cursor.com>
…rioritization, parallelism, and option to run search with tinyfish agent.
|
Important Review skippedToo many files! This PR contains 167 files, which is 17 over the limit of 150. To get a review, narrow the scope: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (167)
You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Make performance improvement for the agent by adding in sourceUrl prioritization, extraction agent parallelism, enabling routes for tinyfish agent and playwright agent, and a centralized memory to handle data that should go into the playwright agent. Also made some other changes on benchmark testing to include open ended user prompts that could produce rows capped at 100, or close to it. Made some changes to make sure that the data collection agent can receive input from and make output to the frontend. See the documentation for details.