OpenDsStar 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- opendsstar-1.0.0/LICENSE +201 -0
- opendsstar-1.0.0/PKG-INFO +267 -0
- opendsstar-1.0.0/README.md +200 -0
- opendsstar-1.0.0/pyproject.toml +134 -0
- opendsstar-1.0.0/setup.cfg +4 -0
- opendsstar-1.0.0/src/OpenDsStar.egg-info/PKG-INFO +267 -0
- opendsstar-1.0.0/src/OpenDsStar.egg-info/SOURCES.txt +125 -0
- opendsstar-1.0.0/src/OpenDsStar.egg-info/dependency_links.txt +1 -0
- opendsstar-1.0.0/src/OpenDsStar.egg-info/requires.txt +47 -0
- opendsstar-1.0.0/src/OpenDsStar.egg-info/top_level.txt +5 -0
- opendsstar-1.0.0/src/agents/__init__.py +21 -0
- opendsstar-1.0.0/src/agents/analyzer/__init__.py +1 -0
- opendsstar-1.0.0/src/agents/analyzer/analyzer_execute_env.py +9 -0
- opendsstar-1.0.0/src/agents/analyzer/analyzer_graph.py +162 -0
- opendsstar-1.0.0/src/agents/analyzer/analyzer_state.py +38 -0
- opendsstar-1.0.0/src/agents/analyzer/nodes/__init__.py +0 -0
- opendsstar-1.0.0/src/agents/analyzer/nodes/coder.py +100 -0
- opendsstar-1.0.0/src/agents/analyzer/nodes/debugger.py +131 -0
- opendsstar-1.0.0/src/agents/analyzer/nodes/executer.py +83 -0
- opendsstar-1.0.0/src/agents/analyzer/nodes/finalizer.py +37 -0
- opendsstar-1.0.0/src/agents/base_agent.py +117 -0
- opendsstar-1.0.0/src/agents/ds_star/__init__.py +0 -0
- opendsstar-1.0.0/src/agents/ds_star/ds_star_execute_env.py +975 -0
- opendsstar-1.0.0/src/agents/ds_star/ds_star_graph.py +270 -0
- opendsstar-1.0.0/src/agents/ds_star/ds_star_results_prep.py +264 -0
- opendsstar-1.0.0/src/agents/ds_star/ds_star_state.py +86 -0
- opendsstar-1.0.0/src/agents/ds_star/ds_star_utils.py +646 -0
- opendsstar-1.0.0/src/agents/ds_star/nodes/__init__.py +0 -0
- opendsstar-1.0.0/src/agents/ds_star/nodes/base_node.py +44 -0
- opendsstar-1.0.0/src/agents/ds_star/nodes/coder.py +268 -0
- opendsstar-1.0.0/src/agents/ds_star/nodes/debugger.py +267 -0
- opendsstar-1.0.0/src/agents/ds_star/nodes/executer.py +64 -0
- opendsstar-1.0.0/src/agents/ds_star/nodes/finalizer.py +267 -0
- opendsstar-1.0.0/src/agents/ds_star/nodes/planner.py +315 -0
- opendsstar-1.0.0/src/agents/ds_star/nodes/router.py +282 -0
- opendsstar-1.0.0/src/agents/ds_star/nodes/verifier.py +275 -0
- opendsstar-1.0.0/src/agents/ds_star/open_ds_star_agent.py +338 -0
- opendsstar-1.0.0/src/experiments/__init__.py +67 -0
- opendsstar-1.0.0/src/experiments/base/__init__.py +5 -0
- opendsstar-1.0.0/src/experiments/base/base_experiment.py +389 -0
- opendsstar-1.0.0/src/experiments/benchmarks/__init__.py +14 -0
- opendsstar-1.0.0/src/experiments/benchmarks/databench/__init__.py +11 -0
- opendsstar-1.0.0/src/experiments/benchmarks/databench/data_reader.py +258 -0
- opendsstar-1.0.0/src/experiments/benchmarks/databench/databench_main.py +360 -0
- opendsstar-1.0.0/src/experiments/benchmarks/databench/tools_builder.py +159 -0
- opendsstar-1.0.0/src/experiments/benchmarks/demo/__init__.py +17 -0
- opendsstar-1.0.0/src/experiments/benchmarks/demo/agent_builder.py +64 -0
- opendsstar-1.0.0/src/experiments/benchmarks/demo/agent_runner.py +59 -0
- opendsstar-1.0.0/src/experiments/benchmarks/demo/data_reader.py +79 -0
- opendsstar-1.0.0/src/experiments/benchmarks/demo/evaluators.py +101 -0
- opendsstar-1.0.0/src/experiments/benchmarks/demo/evaluators_builder.py +31 -0
- opendsstar-1.0.0/src/experiments/benchmarks/demo/experiment_main.py +183 -0
- opendsstar-1.0.0/src/experiments/benchmarks/demo/tool_builder.py +64 -0
- opendsstar-1.0.0/src/experiments/benchmarks/hotpotqa/__init__.py +5 -0
- opendsstar-1.0.0/src/experiments/benchmarks/hotpotqa/data_reader.py +52 -0
- opendsstar-1.0.0/src/experiments/benchmarks/hotpotqa/hotpotqa_main.py +358 -0
- opendsstar-1.0.0/src/experiments/benchmarks/hotpotqa/tools_builder.py +109 -0
- opendsstar-1.0.0/src/experiments/benchmarks/kramabench/__init__.py +11 -0
- opendsstar-1.0.0/src/experiments/benchmarks/kramabench/data_reader.py +51 -0
- opendsstar-1.0.0/src/experiments/benchmarks/kramabench/kramabench_main.py +320 -0
- opendsstar-1.0.0/src/experiments/benchmarks/kramabench/tools_builder.py +158 -0
- opendsstar-1.0.0/src/experiments/benchmarks/shared_tools.py +433 -0
- opendsstar-1.0.0/src/experiments/core/__init__.py +25 -0
- opendsstar-1.0.0/src/experiments/core/config.py +150 -0
- opendsstar-1.0.0/src/experiments/core/context.py +37 -0
- opendsstar-1.0.0/src/experiments/core/types.py +65 -0
- opendsstar-1.0.0/src/experiments/demo/__init__.py +3 -0
- opendsstar-1.0.0/src/experiments/demo/create_mcp_tools.py +432 -0
- opendsstar-1.0.0/src/experiments/demo/data_reader.py +261 -0
- opendsstar-1.0.0/src/experiments/demo/databench_loader.py +369 -0
- opendsstar-1.0.0/src/experiments/demo/mcp_multi_agent_example.py +217 -0
- opendsstar-1.0.0/src/experiments/evaluators/__init__.py +5 -0
- opendsstar-1.0.0/src/experiments/evaluators/ragbench_llm_judge.py +117 -0
- opendsstar-1.0.0/src/experiments/example.py +102 -0
- opendsstar-1.0.0/src/experiments/implementations/__init__.py +34 -0
- opendsstar-1.0.0/src/experiments/implementations/agent_factory.py +388 -0
- opendsstar-1.0.0/src/experiments/implementations/flexible_agent_builder.py +13 -0
- opendsstar-1.0.0/src/experiments/implementations/invoke_agent_runner.py +126 -0
- opendsstar-1.0.0/src/experiments/implementations/ragbench_converters.py +100 -0
- opendsstar-1.0.0/src/experiments/implementations/ragbench_data_reader.py +192 -0
- opendsstar-1.0.0/src/experiments/interfaces/__init__.py +15 -0
- opendsstar-1.0.0/src/experiments/interfaces/agent_builder.py +162 -0
- opendsstar-1.0.0/src/experiments/interfaces/agent_runner.py +33 -0
- opendsstar-1.0.0/src/experiments/interfaces/data_reader.py +68 -0
- opendsstar-1.0.0/src/experiments/interfaces/evaluator.py +32 -0
- opendsstar-1.0.0/src/experiments/interfaces/ragbench_data_reader.py +181 -0
- opendsstar-1.0.0/src/experiments/interfaces/tool_builder.py +41 -0
- opendsstar-1.0.0/src/experiments/pipeline.py +689 -0
- opendsstar-1.0.0/src/experiments/utils/__init__.py +23 -0
- opendsstar-1.0.0/src/experiments/utils/cache.py +81 -0
- opendsstar-1.0.0/src/experiments/utils/data_reader_cache.py +218 -0
- opendsstar-1.0.0/src/experiments/utils/evaluation_cache.py +212 -0
- opendsstar-1.0.0/src/experiments/utils/logging.py +113 -0
- opendsstar-1.0.0/src/experiments/utils/model_provider_setup.py +40 -0
- opendsstar-1.0.0/src/experiments/utils/recreatable.py +184 -0
- opendsstar-1.0.0/src/experiments/utils/run_experiment_by_params_file.py +175 -0
- opendsstar-1.0.0/src/experiments/utils/tool_registry.py +62 -0
- opendsstar-1.0.0/src/experiments/utils/validation.py +52 -0
- opendsstar-1.0.0/src/ingestion/__init__.py +0 -0
- opendsstar-1.0.0/src/ingestion/analyzer.py +217 -0
- opendsstar-1.0.0/src/ingestion/docling_based_ingestion/__init__.py +19 -0
- opendsstar-1.0.0/src/ingestion/docling_based_ingestion/batching.py +20 -0
- opendsstar-1.0.0/src/ingestion/docling_based_ingestion/docling_converter.py +331 -0
- opendsstar-1.0.0/src/ingestion/docling_based_ingestion/docling_description_builder.py +733 -0
- opendsstar-1.0.0/src/ingestion/docling_based_ingestion/file_description_generator.py +285 -0
- opendsstar-1.0.0/src/ingestion/docling_based_ingestion/markdown_shortener.py +331 -0
- opendsstar-1.0.0/src/ingestion/docling_based_ingestion/milvus_manager.py +272 -0
- opendsstar-1.0.0/src/ingestion/docling_based_ingestion/prompts.py +63 -0
- opendsstar-1.0.0/src/ingestion/docling_based_ingestion/sources.py +56 -0
- opendsstar-1.0.0/src/ingestion/docling_cache.py +414 -0
- opendsstar-1.0.0/src/ingestion/document_description_builder.py +55 -0
- opendsstar-1.0.0/src/ingestion/utils.py +60 -0
- opendsstar-1.0.0/src/runner/__init__.py +0 -0
- opendsstar-1.0.0/src/runner/agent_class.py +64 -0
- opendsstar-1.0.0/src/runner/simple_qa_loop.py +245 -0
- opendsstar-1.0.0/src/tools/__init__.py +26 -0
- opendsstar-1.0.0/src/tools/analyzer_retriever.py +135 -0
- opendsstar-1.0.0/src/tools/file_retriever_tool.py +115 -0
- opendsstar-1.0.0/src/tools/mcp_client_standalone.py +293 -0
- opendsstar-1.0.0/src/tools/mcp_integration_standalone.py +397 -0
- opendsstar-1.0.0/src/tools/string_to_stream_tool.py +123 -0
- opendsstar-1.0.0/src/tools/vector_store_tool.py +432 -0
- opendsstar-1.0.0/tests/test_cache_integration.py +73 -0
- opendsstar-1.0.0/tests/test_cache_required.py +30 -0
- opendsstar-1.0.0/tests/test_data_reader_cache.py +145 -0
- opendsstar-1.0.0/tests/test_docling_cache.py +52 -0
- opendsstar-1.0.0/tests/test_trajectory_fix.py +77 -0
opendsstar-1.0.0/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: OpenDsStar
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: A tool-based DS-Star agent implementation using LangGraph
|
|
5
|
+
Author-email: Yoav Kantor <yoavka@il.ibm.com>, Assaf Toledo <assaf.toledo@ibm.com>, Gal Bloch <gal.bloch@ibm.com>
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Project-URL: Repository, https://github.com/IBM/OpenDsStar
|
|
8
|
+
Project-URL: Documentation, https://github.com/IBM/OpenDsStar#readme
|
|
9
|
+
Project-URL: Issues, https://github.com/IBM/OpenDsStar/issues
|
|
10
|
+
Keywords: agent,llm,langgraph,data-science,ds-star
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
15
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
16
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Requires-Python: <3.14,>=3.11
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Requires-Dist: langgraph==1.0.1
|
|
24
|
+
Requires-Dist: langchain==0.3.28
|
|
25
|
+
Requires-Dist: langchain-core==0.3.83
|
|
26
|
+
Requires-Dist: langchain-community==0.3.31
|
|
27
|
+
Requires-Dist: langchain-litellm==0.3.5
|
|
28
|
+
Requires-Dist: langchain-milvus==0.1.7
|
|
29
|
+
Requires-Dist: langchain-huggingface==0.3.1
|
|
30
|
+
Requires-Dist: pymilvus==2.6.7
|
|
31
|
+
Requires-Dist: milvus-lite==2.5.1
|
|
32
|
+
Requires-Dist: scipy==1.17.0
|
|
33
|
+
Requires-Dist: pydantic==2.12.5
|
|
34
|
+
Requires-Dist: numpy==2.4.1
|
|
35
|
+
Requires-Dist: pandas==2.3.3
|
|
36
|
+
Requires-Dist: python-dotenv==1.2.1
|
|
37
|
+
Requires-Dist: litellm==1.81.4
|
|
38
|
+
Requires-Dist: docling==2.68.0
|
|
39
|
+
Requires-Dist: sentence-transformers==5.2.0
|
|
40
|
+
Requires-Dist: diskcache==5.6.3
|
|
41
|
+
Requires-Dist: tqdm==4.67.1
|
|
42
|
+
Requires-Dist: smolagents==1.24.0
|
|
43
|
+
Requires-Dist: matplotlib==3.10.8
|
|
44
|
+
Requires-Dist: plotly==6.6.0
|
|
45
|
+
Requires-Dist: kaleido==1.2.0
|
|
46
|
+
Requires-Dist: datasets==4.0.0
|
|
47
|
+
Requires-Dist: huggingface-hub==0.36.0
|
|
48
|
+
Requires-Dist: ragworkbench
|
|
49
|
+
Provides-Extra: mcp
|
|
50
|
+
Requires-Dist: mcp<2.0.0,>=1.26.0; extra == "mcp"
|
|
51
|
+
Requires-Dist: fastmcp<4.0.0,>=3.1.1; extra == "mcp"
|
|
52
|
+
Provides-Extra: dev
|
|
53
|
+
Requires-Dist: pytest==9.0.2; extra == "dev"
|
|
54
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
|
|
55
|
+
Requires-Dist: black==25.1.0; extra == "dev"
|
|
56
|
+
Requires-Dist: ruff==0.11.13; extra == "dev"
|
|
57
|
+
Requires-Dist: mypy<2.0.0,>=1.19.1; extra == "dev"
|
|
58
|
+
Requires-Dist: pre-commit==4.5.1; extra == "dev"
|
|
59
|
+
Provides-Extra: test
|
|
60
|
+
Requires-Dist: pytest==9.0.2; extra == "test"
|
|
61
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == "test"
|
|
62
|
+
Requires-Dist: ragworkbench; extra == "test"
|
|
63
|
+
Provides-Extra: ui
|
|
64
|
+
Requires-Dist: streamlit<2.0.0,>=1.55.0; extra == "ui"
|
|
65
|
+
Requires-Dist: pandas==2.3.3; extra == "ui"
|
|
66
|
+
Dynamic: license-file
|
|
67
|
+
|
|
68
|
+
# OpenDsStar
|
|
69
|
+
|
|
70
|
+
**OpenDsStar** is an open-source implementation of the **[DS-Star agent](https://arxiv.org/abs/2509.21825)** (Nam et al., 2025), with several deliberate design enhancements that improve modularity, extensibility, and execution efficiency.
|
|
71
|
+
|
|
72
|
+
The original DS-Star agent is primarily built around **file-based artifacts**: reasoning, planning, and execution revolve around reading, writing, and modifying files that represent intermediate and final results. OpenDsStar preserves the core planning-and-coding philosophy of DS-Star, but redefines the execution model around a **tool-centric abstraction**.
|
|
73
|
+
|
|
74
|
+
DS-Star is a **Programmatic Tool Calling (PTC)** agent. Rather than reasoning directly over files, OpenDsStar plans and executes workflows by composing **explicit tool invocations**, drawing inspiration from the **ReAct** and **CodeAct** paradigms. Tools can encapsulate file access, database queries, API calls, external services, computation engines, or arbitrary custom functions. This decouples the agent’s reasoning logic from the underlying execution environment and storage format.
|
|
75
|
+
|
|
76
|
+
This design generalizes the DS-Star approach beyond data-science-specific workflows. Any task that can be expressed as a sequence of tool calls—whether it involves data processing, information retrieval, programmatic reasoning, or system interaction—can be handled without changing the agent’s core structure.
|
|
77
|
+
|
|
78
|
+
OpenDsStar also introduces more flexible execution control than the original DS-Star.
|
|
79
|
+
|
|
80
|
+
In the original design, the agent typically **re-executes the entire planned workflow from the beginning** whenever the plan is revised, even if earlier steps have already completed successfully. This can be wasteful when early steps involve expensive computation, slow external calls, or large-scale data processing.
|
|
81
|
+
|
|
82
|
+
OpenDsStar explicitly separates planning from execution and supports **incremental, stepwise execution**. In this mode, completed steps produce persistent intermediate results and are **not re-run**. When the plan is extended or refined, only the **newly introduced step** is executed, while previous outputs are reused. This significantly reduces redundant computation and makes the agent more practical for workflows in which individual steps are costly, long-running, or stateful.
|
|
83
|
+
|
|
84
|
+
## Summary of Design Enhancements
|
|
85
|
+
|
|
86
|
+
| Aspect | Original DS-Star | OpenDsStar |
|
|
87
|
+
|--------|------------------|------------|
|
|
88
|
+
| Core abstraction | Files | Tools |
|
|
89
|
+
| Planning representation | File/code actions | Tool-call sequences |
|
|
90
|
+
| Scope | Data-science focused | General purpose |
|
|
91
|
+
| Execution strategy | Re-run full plan | Incremental execution |
|
|
92
|
+
| Intermediate results | Recomputed | Persisted and reused |
|
|
93
|
+
| Planning vs. execution | Coupled | Explicitly separated |
|
|
94
|
+
| Extensibility | File-centric | Tool-based |
|
|
95
|
+
|
|
96
|
+
## Features
|
|
97
|
+
|
|
98
|
+
- **Programmatic Tool Calling (PTC)**: Plans are represented as sequences of tool invocations rather than direct file manipulation
|
|
99
|
+
- **Explicit multi-step reasoning**: Complex tasks are decomposed into structured, inspectable plans
|
|
100
|
+
- **Code generation and execution**: Generates and runs code when needed
|
|
101
|
+
- **Stepwise execution mode**: Executes plans incrementally while reusing intermediate outputs
|
|
102
|
+
- **Full execution mode**: Runs the entire plan end-to-end, mirroring the original DS-Star behavior
|
|
103
|
+
- **Error handling and recovery**: Failed steps are debugged and retried automatically
|
|
104
|
+
- **Result verification**: Outputs are validated before returning final answers
|
|
105
|
+
- **LLM-agnostic**: Works with OpenAI, Anthropic, Azure, WatsonX, Ollama, and more through LiteLLM
|
|
106
|
+
|
|
107
|
+
## Execution Modes
|
|
108
|
+
|
|
109
|
+
OpenDsStar supports two execution modes:
|
|
110
|
+
|
|
111
|
+
- **Full mode**
|
|
112
|
+
Plans and executes the entire workflow end-to-end, closely matching the original DS-Star execution model.
|
|
113
|
+
|
|
114
|
+
- **Stepwise mode**
|
|
115
|
+
Produces plans incrementally and executes only the newest step while reusing outputs from previous steps. This mode is more efficient when steps are expensive or computationally heavy.
|
|
116
|
+
|
|
117
|
+
## Installation
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
git clone https://github.com/IBM/OpenDsStar.git
|
|
121
|
+
cd OpenDsStar
|
|
122
|
+
uv sync
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Configuration
|
|
126
|
+
|
|
127
|
+
Create a `.env` file with your API keys (only include keys for providers you'll use):
|
|
128
|
+
```bash
|
|
129
|
+
OPENAI_API_KEY=your_key_here
|
|
130
|
+
# Add other provider keys as needed
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
See [Installation Guide](docs/INSTALLATION.md) for detailed setup instructions, environment variables, and troubleshooting.
|
|
134
|
+
|
|
135
|
+
## Quick Start
|
|
136
|
+
|
|
137
|
+
### OpenDsStarAgent (DS-Star Implementation)
|
|
138
|
+
|
|
139
|
+
```python
|
|
140
|
+
from dotenv import load_dotenv
|
|
141
|
+
from agents import OpenDsStarAgent
|
|
142
|
+
|
|
143
|
+
load_dotenv()
|
|
144
|
+
|
|
145
|
+
agent = OpenDsStarAgent(model="gpt-4o-mini")
|
|
146
|
+
|
|
147
|
+
result = agent.invoke("What is 15 * 23 + 42?")
|
|
148
|
+
print(result["answer"])
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
For detailed usage, see [DS-Star Agent Documentation](docs/DS_STAR_AGENT.md).
|
|
152
|
+
|
|
153
|
+
### ReactAgent (LangChain ReAct Agent)
|
|
154
|
+
|
|
155
|
+
```python
|
|
156
|
+
from dotenv import load_dotenv
|
|
157
|
+
from agents import ReactAgent
|
|
158
|
+
|
|
159
|
+
load_dotenv()
|
|
160
|
+
|
|
161
|
+
agent = ReactAgent()
|
|
162
|
+
|
|
163
|
+
result = agent.invoke("What is the capital of France?")
|
|
164
|
+
print(result["answer"])
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
See [ReactAgent Documentation](docs/REACT_AGENT_WRAPPER.md) for more details.
|
|
168
|
+
|
|
169
|
+
## Running Experiments
|
|
170
|
+
|
|
171
|
+
### Quick Start - DataBench with 5 Questions
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
.venv/bin/python -m src.experiments.benchmarks.databench.databench_main \
|
|
175
|
+
--question-limit 5 \
|
|
176
|
+
--agent-type ds_star \
|
|
177
|
+
--model-agent gpt-4o-mini
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### Other Benchmarks
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
# HotpotQA
|
|
184
|
+
.venv/bin/python -m src.experiments.benchmarks.hotpotqa.hotpotqa_main \
|
|
185
|
+
--question-limit 20 --agent-type ds_star --model gpt-4o-mini
|
|
186
|
+
|
|
187
|
+
# KramaBench
|
|
188
|
+
.venv/bin/python -m src.experiments.benchmarks.kramabench.kramabench_main \
|
|
189
|
+
--agent-type ds_star --model-agent gpt-4o-mini
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
See [Installation Guide](docs/INSTALLATION.md) for detailed command options, model aliases, and parameter explanations.
|
|
193
|
+
|
|
194
|
+
See [EXPERIMENTS.md](docs/EXPERIMENTS.md) for comprehensive experiment documentation.
|
|
195
|
+
|
|
196
|
+
## Agent Implementations
|
|
197
|
+
|
|
198
|
+
OpenDsStar includes multiple agent implementations for comparison and benchmarking:
|
|
199
|
+
|
|
200
|
+
- **OpenDsStarAgent**: Main DS-Star implementation — a Programmatic Tool Calling (PTC) agent with planning, coding, execution, debugging, and verification ([Documentation](docs/DS_STAR_AGENT.md))
|
|
201
|
+
- **ReactAgentLangchain**: Lightweight wrapper around the LangChain ReAct agent ([Documentation](docs/REACT_AGENT_WRAPPER.md))
|
|
202
|
+
- **ReactAgentSmolagents**: Smolagents-based ReAct implementation
|
|
203
|
+
- **CodeActAgentSmolagents**: Smolagents-based CodeAct implementation
|
|
204
|
+
|
|
205
|
+
All agents share a common interface, making it easy to compare different agent paradigms on the same tasks.
|
|
206
|
+
|
|
207
|
+
## Experiments Framework
|
|
208
|
+
|
|
209
|
+
OpenDsStar includes a comprehensive **experiments framework** for reproducible benchmarking and evaluation. It provides modular experiment design, automatic caching, multi-agent support, and built-in evaluation.
|
|
210
|
+
|
|
211
|
+
The framework includes:
|
|
212
|
+
|
|
213
|
+
- **Modular experiment design**: Each experiment is self-contained, with its own data reader, tools builder, agent configuration, and evaluators
|
|
214
|
+
- **Easy extensibility**: New experiments can be added by implementing a small set of simple interfaces, without modifying core framework code
|
|
215
|
+
- **Automatic caching**: Intermediate results are cached to avoid redundant computation
|
|
216
|
+
- **Reproducibility**: Experiment parameters are automatically saved, enabling exact reruns
|
|
217
|
+
- **Multiple agent support**: The same experiment can be run with different agents (e.g., DS-Star, ReAct, CodeAct) for direct comparison
|
|
218
|
+
- **Built-in evaluation**: Integrated evaluation metrics and result tracking
|
|
219
|
+
|
|
220
|
+
See [EXPERIMENTS.md](docs/EXPERIMENTS.md) for more details.
|
|
221
|
+
|
|
222
|
+
## Benchmark Results
|
|
223
|
+
|
|
224
|
+
### Kramabench Dataset Evaluation
|
|
225
|
+
|
|
226
|
+
Comparison of DS-Star and CodeAct agents on the Kramabench dataset (31 questions) across multiple LLM providers:
|
|
227
|
+
|
|
228
|
+
| Agent | Model | Total Tokens | LLM Calls | LLM Judge Score |
|
|
229
|
+
|-------|-------|--------------|-----------|-----------------|
|
|
230
|
+
| **CodeAct** | Llama Maverick | 3.3M | 271 | 0.224 |
|
|
231
|
+
| **DS-Star** | Llama Maverick | 2.5M | 548 | **0.248** |
|
|
232
|
+
| **CodeAct** | Gemini 2.5 Flash | 4.0M | 275 | 0.297 |
|
|
233
|
+
| **DS-Star** | Gemini 2.5 Flash | 6.1M | 664 | **0.303** |
|
|
234
|
+
| **CodeAct** | Gemini 2.5 Pro | 1.6M | 235 | 0.312 |
|
|
235
|
+
| **DS-Star** | Gemini 2.5 Pro | 1.1M | 701 | **0.387** |
|
|
236
|
+
|
|
237
|
+
**Experimental setup**
|
|
238
|
+
|
|
239
|
+
- Both agents use identical tools and data access methods
|
|
240
|
+
- Both use the same data-ingestion pipeline and file descriptions
|
|
241
|
+
- File descriptions were generated using WatsonX Llama Maverick for all configurations
|
|
242
|
+
- Observed performance differences are therefore attributable primarily to the agent architecture and reasoning strategy
|
|
243
|
+
|
|
244
|
+
**Key findings**
|
|
245
|
+
|
|
246
|
+
- DS-Star consistently outperforms CodeAct across all tested models in answer quality
|
|
247
|
+
- DS-Star achieves better results with fewer total tokens on Llama Maverick and Gemini 2.5 Pro
|
|
248
|
+
- The planning, debugging, and verification cycle improves answer accuracy, even when it requires more LLM calls
|
|
249
|
+
- Best overall result: **DS-Star with Gemini 2.5 Pro** (0.387 judge score, with the lowest token usage among the Gemini Pro runs)
|
|
250
|
+
|
|
251
|
+
## Project Structure
|
|
252
|
+
|
|
253
|
+
```text
|
|
254
|
+
src/
|
|
255
|
+
├── agents/
|
|
256
|
+
├── tools/
|
|
257
|
+
└── experiments/
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
## Documentation
|
|
261
|
+
|
|
262
|
+
- [ARCHITECTURE.md](docs/ARCHITECTURE.md)
|
|
263
|
+
- [EXPERIMENTS.md](docs/EXPERIMENTS.md)
|
|
264
|
+
|
|
265
|
+
## License
|
|
266
|
+
|
|
267
|
+
Apache License 2.0
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
# OpenDsStar
|
|
2
|
+
|
|
3
|
+
**OpenDsStar** is an open-source implementation of the **[DS-Star agent](https://arxiv.org/abs/2509.21825)** (Nam et al., 2025), with several deliberate design enhancements that improve modularity, extensibility, and execution efficiency.
|
|
4
|
+
|
|
5
|
+
The original DS-Star agent is primarily built around **file-based artifacts**: reasoning, planning, and execution revolve around reading, writing, and modifying files that represent intermediate and final results. OpenDsStar preserves the core planning-and-coding philosophy of DS-Star, but redefines the execution model around a **tool-centric abstraction**.
|
|
6
|
+
|
|
7
|
+
DS-Star is a **Programmatic Tool Calling (PTC)** agent. Rather than reasoning directly over files, OpenDsStar plans and executes workflows by composing **explicit tool invocations**, drawing inspiration from the **ReAct** and **CodeAct** paradigms. Tools can encapsulate file access, database queries, API calls, external services, computation engines, or arbitrary custom functions. This decouples the agent’s reasoning logic from the underlying execution environment and storage format.
|
|
8
|
+
|
|
9
|
+
This design generalizes the DS-Star approach beyond data-science-specific workflows. Any task that can be expressed as a sequence of tool calls—whether it involves data processing, information retrieval, programmatic reasoning, or system interaction—can be handled without changing the agent’s core structure.
|
|
10
|
+
|
|
11
|
+
OpenDsStar also introduces more flexible execution control than the original DS-Star.
|
|
12
|
+
|
|
13
|
+
In the original design, the agent typically **re-executes the entire planned workflow from the beginning** whenever the plan is revised, even if earlier steps have already completed successfully. This can be wasteful when early steps involve expensive computation, slow external calls, or large-scale data processing.
|
|
14
|
+
|
|
15
|
+
OpenDsStar explicitly separates planning from execution and supports **incremental, stepwise execution**. In this mode, completed steps produce persistent intermediate results and are **not re-run**. When the plan is extended or refined, only the **newly introduced step** is executed, while previous outputs are reused. This significantly reduces redundant computation and makes the agent more practical for workflows in which individual steps are costly, long-running, or stateful.
|
|
16
|
+
|
|
17
|
+
## Summary of Design Enhancements
|
|
18
|
+
|
|
19
|
+
| Aspect | Original DS-Star | OpenDsStar |
|
|
20
|
+
|--------|------------------|------------|
|
|
21
|
+
| Core abstraction | Files | Tools |
|
|
22
|
+
| Planning representation | File/code actions | Tool-call sequences |
|
|
23
|
+
| Scope | Data-science focused | General purpose |
|
|
24
|
+
| Execution strategy | Re-run full plan | Incremental execution |
|
|
25
|
+
| Intermediate results | Recomputed | Persisted and reused |
|
|
26
|
+
| Planning vs. execution | Coupled | Explicitly separated |
|
|
27
|
+
| Extensibility | File-centric | Tool-based |
|
|
28
|
+
|
|
29
|
+
## Features
|
|
30
|
+
|
|
31
|
+
- **Programmatic Tool Calling (PTC)**: Plans are represented as sequences of tool invocations rather than direct file manipulation
|
|
32
|
+
- **Explicit multi-step reasoning**: Complex tasks are decomposed into structured, inspectable plans
|
|
33
|
+
- **Code generation and execution**: Generates and runs code when needed
|
|
34
|
+
- **Stepwise execution mode**: Executes plans incrementally while reusing intermediate outputs
|
|
35
|
+
- **Full execution mode**: Runs the entire plan end-to-end, mirroring the original DS-Star behavior
|
|
36
|
+
- **Error handling and recovery**: Failed steps are debugged and retried automatically
|
|
37
|
+
- **Result verification**: Outputs are validated before returning final answers
|
|
38
|
+
- **LLM-agnostic**: Works with OpenAI, Anthropic, Azure, WatsonX, Ollama, and more through LiteLLM
|
|
39
|
+
|
|
40
|
+
## Execution Modes
|
|
41
|
+
|
|
42
|
+
OpenDsStar supports two execution modes:
|
|
43
|
+
|
|
44
|
+
- **Full mode**
|
|
45
|
+
Plans and executes the entire workflow end-to-end, closely matching the original DS-Star execution model.
|
|
46
|
+
|
|
47
|
+
- **Stepwise mode**
|
|
48
|
+
Produces plans incrementally and executes only the newest step while reusing outputs from previous steps. This mode is more efficient when steps are expensive or computationally heavy.
|
|
49
|
+
|
|
50
|
+
## Installation
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
git clone https://github.com/IBM/OpenDsStar.git
|
|
54
|
+
cd OpenDsStar
|
|
55
|
+
uv sync
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Configuration
|
|
59
|
+
|
|
60
|
+
Create a `.env` file with your API keys (only include keys for providers you'll use):
|
|
61
|
+
```bash
|
|
62
|
+
OPENAI_API_KEY=your_key_here
|
|
63
|
+
# Add other provider keys as needed
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
See [Installation Guide](docs/INSTALLATION.md) for detailed setup instructions, environment variables, and troubleshooting.
|
|
67
|
+
|
|
68
|
+
## Quick Start
|
|
69
|
+
|
|
70
|
+
### OpenDsStarAgent (DS-Star Implementation)
|
|
71
|
+
|
|
72
|
+
```python
|
|
73
|
+
from dotenv import load_dotenv
|
|
74
|
+
from agents import OpenDsStarAgent
|
|
75
|
+
|
|
76
|
+
load_dotenv()
|
|
77
|
+
|
|
78
|
+
agent = OpenDsStarAgent(model="gpt-4o-mini")
|
|
79
|
+
|
|
80
|
+
result = agent.invoke("What is 15 * 23 + 42?")
|
|
81
|
+
print(result["answer"])
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
For detailed usage, see [DS-Star Agent Documentation](docs/DS_STAR_AGENT.md).
|
|
85
|
+
|
|
86
|
+
### ReactAgent (LangChain ReAct Agent)
|
|
87
|
+
|
|
88
|
+
```python
|
|
89
|
+
from dotenv import load_dotenv
|
|
90
|
+
from agents import ReactAgent
|
|
91
|
+
|
|
92
|
+
load_dotenv()
|
|
93
|
+
|
|
94
|
+
agent = ReactAgent()
|
|
95
|
+
|
|
96
|
+
result = agent.invoke("What is the capital of France?")
|
|
97
|
+
print(result["answer"])
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
See [ReactAgent Documentation](docs/REACT_AGENT_WRAPPER.md) for more details.
|
|
101
|
+
|
|
102
|
+
## Running Experiments
|
|
103
|
+
|
|
104
|
+
### Quick Start - DataBench with 5 Questions
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
.venv/bin/python -m src.experiments.benchmarks.databench.databench_main \
|
|
108
|
+
--question-limit 5 \
|
|
109
|
+
--agent-type ds_star \
|
|
110
|
+
--model-agent gpt-4o-mini
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Other Benchmarks
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
# HotpotQA
|
|
117
|
+
.venv/bin/python -m src.experiments.benchmarks.hotpotqa.hotpotqa_main \
|
|
118
|
+
--question-limit 20 --agent-type ds_star --model gpt-4o-mini
|
|
119
|
+
|
|
120
|
+
# KramaBench
|
|
121
|
+
.venv/bin/python -m src.experiments.benchmarks.kramabench.kramabench_main \
|
|
122
|
+
--agent-type ds_star --model-agent gpt-4o-mini
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
See [Installation Guide](docs/INSTALLATION.md) for detailed command options, model aliases, and parameter explanations.
|
|
126
|
+
|
|
127
|
+
See [EXPERIMENTS.md](docs/EXPERIMENTS.md) for comprehensive experiment documentation.
|
|
128
|
+
|
|
129
|
+
## Agent Implementations
|
|
130
|
+
|
|
131
|
+
OpenDsStar includes multiple agent implementations for comparison and benchmarking:
|
|
132
|
+
|
|
133
|
+
- **OpenDsStarAgent**: Main DS-Star implementation — a Programmatic Tool Calling (PTC) agent with planning, coding, execution, debugging, and verification ([Documentation](docs/DS_STAR_AGENT.md))
|
|
134
|
+
- **ReactAgentLangchain**: Lightweight wrapper around the LangChain ReAct agent ([Documentation](docs/REACT_AGENT_WRAPPER.md))
|
|
135
|
+
- **ReactAgentSmolagents**: Smolagents-based ReAct implementation
|
|
136
|
+
- **CodeActAgentSmolagents**: Smolagents-based CodeAct implementation
|
|
137
|
+
|
|
138
|
+
All agents share a common interface, making it easy to compare different agent paradigms on the same tasks.
|
|
139
|
+
|
|
140
|
+
## Experiments Framework
|
|
141
|
+
|
|
142
|
+
OpenDsStar includes a comprehensive **experiments framework** for reproducible benchmarking and evaluation. It provides modular experiment design, automatic caching, multi-agent support, and built-in evaluation.
|
|
143
|
+
|
|
144
|
+
The framework includes:
|
|
145
|
+
|
|
146
|
+
- **Modular experiment design**: Each experiment is self-contained, with its own data reader, tools builder, agent configuration, and evaluators
|
|
147
|
+
- **Easy extensibility**: New experiments can be added by implementing a small set of simple interfaces, without modifying core framework code
|
|
148
|
+
- **Automatic caching**: Intermediate results are cached to avoid redundant computation
|
|
149
|
+
- **Reproducibility**: Experiment parameters are automatically saved, enabling exact reruns
|
|
150
|
+
- **Multiple agent support**: The same experiment can be run with different agents (e.g., DS-Star, ReAct, CodeAct) for direct comparison
|
|
151
|
+
- **Built-in evaluation**: Integrated evaluation metrics and result tracking
|
|
152
|
+
|
|
153
|
+
See [EXPERIMENTS.md](docs/EXPERIMENTS.md) for more details.
|
|
154
|
+
|
|
155
|
+
## Benchmark Results
|
|
156
|
+
|
|
157
|
+
### Kramabench Dataset Evaluation
|
|
158
|
+
|
|
159
|
+
Comparison of DS-Star and CodeAct agents on the Kramabench dataset (31 questions) across multiple LLM providers:
|
|
160
|
+
|
|
161
|
+
| Agent | Model | Total Tokens | LLM Calls | LLM Judge Score |
|
|
162
|
+
|-------|-------|--------------|-----------|-----------------|
|
|
163
|
+
| **CodeAct** | Llama Maverick | 3.3M | 271 | 0.224 |
|
|
164
|
+
| **DS-Star** | Llama Maverick | 2.5M | 548 | **0.248** |
|
|
165
|
+
| **CodeAct** | Gemini 2.5 Flash | 4.0M | 275 | 0.297 |
|
|
166
|
+
| **DS-Star** | Gemini 2.5 Flash | 6.1M | 664 | **0.303** |
|
|
167
|
+
| **CodeAct** | Gemini 2.5 Pro | 1.6M | 235 | 0.312 |
|
|
168
|
+
| **DS-Star** | Gemini 2.5 Pro | 1.1M | 701 | **0.387** |
|
|
169
|
+
|
|
170
|
+
**Experimental setup**
|
|
171
|
+
|
|
172
|
+
- Both agents use identical tools and data access methods
|
|
173
|
+
- Both use the same data-ingestion pipeline and file descriptions
|
|
174
|
+
- File descriptions were generated using WatsonX Llama Maverick for all configurations
|
|
175
|
+
- Observed performance differences are therefore attributable primarily to the agent architecture and reasoning strategy
|
|
176
|
+
|
|
177
|
+
**Key findings**
|
|
178
|
+
|
|
179
|
+
- DS-Star consistently outperforms CodeAct across all tested models in answer quality
|
|
180
|
+
- DS-Star achieves better results with fewer total tokens on Llama Maverick and Gemini 2.5 Pro
|
|
181
|
+
- The planning, debugging, and verification cycle improves answer accuracy, even when it requires more LLM calls
|
|
182
|
+
- Best overall result: **DS-Star with Gemini 2.5 Pro** (0.387 judge score, with the lowest token usage among the Gemini Pro runs)
|
|
183
|
+
|
|
184
|
+
## Project Structure
|
|
185
|
+
|
|
186
|
+
```text
|
|
187
|
+
src/
|
|
188
|
+
├── agents/
|
|
189
|
+
├── tools/
|
|
190
|
+
└── experiments/
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## Documentation
|
|
194
|
+
|
|
195
|
+
- [ARCHITECTURE.md](docs/ARCHITECTURE.md)
|
|
196
|
+
- [EXPERIMENTS.md](docs/EXPERIMENTS.md)
|
|
197
|
+
|
|
198
|
+
## License
|
|
199
|
+
|
|
200
|
+
Apache License 2.0
|