feat(deepagent): datastores= parity for create_research_workflow#207
Merged
Conversation
Brings the workflow factory to feature parity with create_deepagent:
both now accept datastores={name: {retriever, description, top_k,
threshold}} and produce an identical auto-wired search_<name> tool
surface plus per-store system-prompt routing block.
- factory.py: extract the auto-wiring logic into wire_datastores() so
both call sites use the same path. create_deepagent now calls into
it (semantics unchanged from b11).
- workflow.py: add datastores= + datastore_top_k= kwargs to
create_research_workflow; the execute node sees the merged tools and
the prepended routing block.
- docs/concepts/deepagent.md: add the workflow datastores= example +
cross-reference under 'When to use each'.
- tests/unit/test_research_workflow_datastores.py: 8 cases covering
None/empty, bare-retriever vs dict form, multi-store routing,
TypeError on bad values, and workflow construction with a
datastore configured.
Signed-off-by: Federico Kamelhar <federico.kamelhar@oracle.com>
3 tasks
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.
Follow-up to #203 / v0.2.0b11. Closes the only remaining surface gap between
create_deepagentandcreate_research_workflow: the workflow factory now accepts the samedatastores=mapping.Why
create_deepagent(datastores={...})shipped in v0.2.0b11 with auto-wiredsearch_<name>tools + a per-store routing block prepended to the system prompt.create_research_workflow— the StateGraph variant with the post-hoc grounding loop — exposed onlytools=, so users had to hand-wire the retrieval tools vialocus.rag.tools.create_rag_tooland write the routing block themselves.After this change, the two factories are surface-identical for the datastore path:
Implementation
factory.py: extracted the auto-wiring logic into a new publicwire_datastores(datastores, datastore_top_k) -> (tools, routing_block)helper.create_deepagentnow calls it (semantics unchanged from b11 — same tools, same prompt block, same TypeError on bad values).workflow.py: addeddatastores=+datastore_top_k=kwargs tocreate_research_workflow; the execute node seestools + ds_toolsand the prepended routing block.docs/concepts/deepagent.md: workflowdatastores=example + cross-ref under "When to use each".tests/unit/test_research_workflow_datastores.py: 8 cases covering None/empty input, bare-retriever vs dict form, multi-store routing,TypeErroron bad value types, and workflow construction with a configured datastore.Test plan
wire_datastoressmoke-tested in isolationcreate_deepagentsemantics unchanged (regression via existing tests + smoke test)create_research_workflowcompiles withdatastores=configuredGoes into the next release cut (b12 or 1.0-rc, depending on the call).