feat(third_party): add Dewey managed RAG pipeline example#500
feat(third_party): add Dewey managed RAG pipeline example#500lambdabaa wants to merge 4 commits intoanthropics:mainfrom
Conversation
|
Orb Code Review (powered by GLM 5.1 on Orb Cloud) New third-party cookbook: Production Document Q&A with Dewey's Managed RAG Backend. Observations1. Well-structured RAG pipeline walkthrough (Positive) 2. Section-aware retrieval is a good pattern (Positive) 3. API key handling (Low) DEWEY_API_KEY = os.environ.get("DEWEY_API_KEY", "dwy_live_...")The fallback value is clearly a placeholder, but using 4. Polling loop has no timeout (Medium) def wait_for_ready(collection_id, doc_ids, poll_interval=5.0):
pending = set(doc_ids)
while pending:
...This loop will run indefinitely if documents are stuck in processing. Consider adding a deadline = time.time() + max_wait
while pending and time.time() < deadline:SummaryWell-structured RAG cookbook with a clear progression. The missing timeout in the polling loop is worth addressing before merge. Assessment: approve (with suggestion to add polling timeout) |
- Use os.environ[] instead of os.environ.get() with placeholder defaults for DEWEY_API_KEY and ANTHROPIC_API_KEY, so missing keys fail fast with a clear KeyError rather than silently using a broken placeholder - Add max_wait parameter (default 300s) and deadline to wait_for_ready(), raising TimeoutError if documents are stuck in processing indefinitely Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary
Adds a notebook demonstrating how to build production document Q&A using Dewey as a managed RAG backend alongside the Anthropic Python SDK.
Dewey handles the full ingestion pipeline (PDF conversion, section extraction, chunking, embedding) behind a single API, letting developers focus on the application layer rather than infrastructure assembly.
The notebook covers:
claude-sonnet-4-6with tool-call trace and source attributionclaude-haiku-4-5-20251001) generationNotebook location
third_party/Dewey/dewey_rag_pipeline.ipynbDependencies
meetdewey— Dewey Python SDKanthropic— Anthropic Python SDKrequests— for downloading ArXiv PDFsAll installed via
%pip installat the top of the notebook.