datorum 0.1.0a1__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.
- datorum-0.1.0a1/LICENSE +202 -0
- datorum-0.1.0a1/PKG-INFO +288 -0
- datorum-0.1.0a1/README.md +244 -0
- datorum-0.1.0a1/pyproject.toml +77 -0
- datorum-0.1.0a1/setup.cfg +4 -0
- datorum-0.1.0a1/src/datorum/__init__.py +264 -0
- datorum-0.1.0a1/src/datorum/agency/__init__.py +0 -0
- datorum-0.1.0a1/src/datorum/agency/exceptions.py +4 -0
- datorum-0.1.0a1/src/datorum/agency/settings.py +49 -0
- datorum-0.1.0a1/src/datorum/agency/worker.py +433 -0
- datorum-0.1.0a1/src/datorum/binding/__init__.py +0 -0
- datorum-0.1.0a1/src/datorum/binding/binder.py +184 -0
- datorum-0.1.0a1/src/datorum/binding/credentials.py +42 -0
- datorum-0.1.0a1/src/datorum/binding/exceptions.py +22 -0
- datorum-0.1.0a1/src/datorum/binding/registry.py +105 -0
- datorum-0.1.0a1/src/datorum/binding/settings.py +61 -0
- datorum-0.1.0a1/src/datorum/cli/__init__.py +26 -0
- datorum-0.1.0a1/src/datorum/cli/commands/__init__.py +0 -0
- datorum-0.1.0a1/src/datorum/cli/commands/base.py +59 -0
- datorum-0.1.0a1/src/datorum/cli/commands/config.py +280 -0
- datorum-0.1.0a1/src/datorum/cli/commands/run.py +174 -0
- datorum-0.1.0a1/src/datorum/cli/context.py +214 -0
- datorum-0.1.0a1/src/datorum/cli/settings.py +33 -0
- datorum-0.1.0a1/src/datorum/context/__init__.py +0 -0
- datorum-0.1.0a1/src/datorum/context/commons/__init__.py +0 -0
- datorum-0.1.0a1/src/datorum/context/commons/chat.py +133 -0
- datorum-0.1.0a1/src/datorum/context/commons/markdown.py +106 -0
- datorum-0.1.0a1/src/datorum/context/exceptions.py +19 -0
- datorum-0.1.0a1/src/datorum/context/registry.py +320 -0
- datorum-0.1.0a1/src/datorum/context/settings.py +217 -0
- datorum-0.1.0a1/src/datorum/core/__init__.py +0 -0
- datorum-0.1.0a1/src/datorum/core/exceptions.py +10 -0
- datorum-0.1.0a1/src/datorum/core/settings.py +186 -0
- datorum-0.1.0a1/src/datorum/plumbing/__init__.py +0 -0
- datorum-0.1.0a1/src/datorum/plumbing/exceptions.py +4 -0
- datorum-0.1.0a1/src/datorum/plumbing/settings.py +102 -0
- datorum-0.1.0a1/src/datorum/plumbing/worker.py +390 -0
- datorum-0.1.0a1/src/datorum/tooling/__init__.py +0 -0
- datorum-0.1.0a1/src/datorum/tooling/exceptions.py +8 -0
- datorum-0.1.0a1/src/datorum/tooling/registry.py +417 -0
- datorum-0.1.0a1/src/datorum/tooling/settings.py +20 -0
- datorum-0.1.0a1/src/datorum/tooling/worker.py +232 -0
- datorum-0.1.0a1/src/datorum/work/__init__.py +0 -0
- datorum-0.1.0a1/src/datorum/work/exceptions.py +13 -0
- datorum-0.1.0a1/src/datorum/work/job.py +147 -0
- datorum-0.1.0a1/src/datorum/work/worker.py +83 -0
- datorum-0.1.0a1/src/datorum.egg-info/PKG-INFO +288 -0
- datorum-0.1.0a1/src/datorum.egg-info/SOURCES.txt +68 -0
- datorum-0.1.0a1/src/datorum.egg-info/dependency_links.txt +1 -0
- datorum-0.1.0a1/src/datorum.egg-info/entry_points.txt +2 -0
- datorum-0.1.0a1/src/datorum.egg-info/requires.txt +25 -0
- datorum-0.1.0a1/src/datorum.egg-info/top_level.txt +1 -0
- datorum-0.1.0a1/tests/test_agency_worker.py +1013 -0
- datorum-0.1.0a1/tests/test_binding_binder.py +293 -0
- datorum-0.1.0a1/tests/test_binding_credentials.py +150 -0
- datorum-0.1.0a1/tests/test_binding_settings.py +135 -0
- datorum-0.1.0a1/tests/test_cli_base.py +22 -0
- datorum-0.1.0a1/tests/test_cli_config.py +308 -0
- datorum-0.1.0a1/tests/test_cli_context.py +232 -0
- datorum-0.1.0a1/tests/test_cli_run.py +203 -0
- datorum-0.1.0a1/tests/test_context_registry.py +291 -0
- datorum-0.1.0a1/tests/test_context_settings.py +225 -0
- datorum-0.1.0a1/tests/test_core_settings.py +180 -0
- datorum-0.1.0a1/tests/test_plumbing_settings.py +214 -0
- datorum-0.1.0a1/tests/test_plumbing_worker.py +828 -0
- datorum-0.1.0a1/tests/test_tooling_registry.py +412 -0
- datorum-0.1.0a1/tests/test_tooling_worker.py +778 -0
- datorum-0.1.0a1/tests/test_work_job.py +235 -0
- datorum-0.1.0a1/tests/test_work_worker.py +135 -0
- datorum-0.1.0a1/tests/test_worker_hitl.py +165 -0
datorum-0.1.0a1/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
datorum-0.1.0a1/PKG-INFO
ADDED
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: datorum
|
|
3
|
+
Version: 0.1.0a1
|
|
4
|
+
Summary: A settings-based framework for creating AI agents and pipelines, focusing on the high specialization of smaller models using context engineering.
|
|
5
|
+
Author-email: Alice Bonafé <alicebonafe@riseup.net>
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://codeberg.org/alicebonafe/datorum
|
|
8
|
+
Project-URL: Repository, https://github.com/alicecbonafe/datorum
|
|
9
|
+
Project-URL: Issues, https://codeberg.org/alicebonafe/datorum/issues
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
16
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
17
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
18
|
+
Requires-Python: >=3.14
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
Requires-Dist: pydantic>=2.13
|
|
22
|
+
Requires-Dist: httpx>=0.28
|
|
23
|
+
Requires-Dist: python-dotenv>=1.2
|
|
24
|
+
Requires-Dist: beautifulsoup4>=4.15
|
|
25
|
+
Requires-Dist: pyyaml>=6.0
|
|
26
|
+
Requires-Dist: requests>=2.34
|
|
27
|
+
Requires-Dist: tomli_w>=1.2
|
|
28
|
+
Requires-Dist: RestrictedPython>=8.4
|
|
29
|
+
Requires-Dist: click>=8.4
|
|
30
|
+
Provides-Extra: test
|
|
31
|
+
Requires-Dist: pytest>=9.1; extra == "test"
|
|
32
|
+
Requires-Dist: pytest_httpserver>=1.1; extra == "test"
|
|
33
|
+
Requires-Dist: pytest-cov>=7.1; extra == "test"
|
|
34
|
+
Requires-Dist: pytest-mock>=3.15; extra == "test"
|
|
35
|
+
Requires-Dist: pytest-depends>=1.0; extra == "test"
|
|
36
|
+
Requires-Dist: pytest-asyncio>=1.4; extra == "test"
|
|
37
|
+
Provides-Extra: lint
|
|
38
|
+
Requires-Dist: datorum[test]; extra == "lint"
|
|
39
|
+
Requires-Dist: ruff>=0.16; extra == "lint"
|
|
40
|
+
Requires-Dist: mypy>=2.3; extra == "lint"
|
|
41
|
+
Provides-Extra: dev
|
|
42
|
+
Requires-Dist: datorum[lint]; extra == "dev"
|
|
43
|
+
Dynamic: license-file
|
|
44
|
+
|
|
45
|
+
# Datorum
|
|
46
|
+
|
|
47
|
+
A settings-based framework for creating AI agents and pipelines, focusing on the high specialization of language models using context engineering.
|
|
48
|
+
|
|
49
|
+
## Goal
|
|
50
|
+
|
|
51
|
+
Datorum aims to provide a consistent context engineering framework to prepare LLMs for highly specialized tasks. The working premise is that careful context structuring can reduce the required number of input and reasoning tokens, making smaller or quantized models a practical substitute for larger, context-naive models in specific domains.
|
|
52
|
+
|
|
53
|
+
This is currently as much an investigative effort as an engineering one. The field of context engineering is still formative. Effective combinations of techniques are not well understood, and many assumptions remain unverified. Datorum is therefore also being built as an experimental laboratory, intended to support the combination, iteration, and evaluation of different context strategies.
|
|
54
|
+
|
|
55
|
+
Once the core features stabilize, it will be possible to run controlled benchmarks to establish the efficiency and quality of different techniques in specific contexts.
|
|
56
|
+
|
|
57
|
+
## About the name
|
|
58
|
+
|
|
59
|
+
> "Contextus est subiectum; Datorum est obiectum."
|
|
60
|
+
> (Context is the subject; Datorum is the object.)
|
|
61
|
+
|
|
62
|
+
Datorum derives from the Latin genitive plural datōrum, meaning "of the data".
|
|
63
|
+
|
|
64
|
+
In Latin syntax, the Subject takes the nominative case, while the direct Object takes the accusative. There's a deliberate philosophical stance in naming this framework Datorum (genitive): the Context is the active subject that drives the LLM interaction, and Datorum is the framework that exists in relation to the data. It is not the protagonist; it is the grammatical object that belongs intrinsically to the information it processes. Datorum bends to the data, serving as the oblique tool through which the subject (context) transforms raw information into intelligence.
|
|
65
|
+
|
|
66
|
+
It's pronounced /da.ˈtoː.rũː/ in Classical Latin — in practice, say da-TOH-rum (rhymes with 'serum' in English, or simply 'Datôrum' as in Brazilian Portuguese). For Mandarin speakers, a natural rendering is 达-托-鲁-姆 (Dā-tuō-lǔ-mǔ), with a slight pitch emphasis on the second syllable "tuō" to preserve the Latin stress.
|
|
67
|
+
|
|
68
|
+
## Current state (as of 0.1.0a1)
|
|
69
|
+
|
|
70
|
+
The core context‑engineering machinery is in place and fully tested.
|
|
71
|
+
|
|
72
|
+
- **Document handling**
|
|
73
|
+
Within a context, document settings specify a file type (as stored on disk) and a model type (the corresponding Python representation). The most basic example is a plain text (`doc_type = "text/plain"`) file loaded into a string (`doc_model = "str"`). The framework currently maps 3 file types for structured data: YAML (`doc_type = "applictiona/yaml"`), JSON (`"applictiona/json"`), and TOML (`"applictiona/toml"`). These three file formats can be natively mapped as dictionaries (`doc_mode = "dict"`), and the `@datorum.doc_model` decorator allows transforming any `pydantic.BaseModel` model into a representation valid for these formats. This is demonstrated, for instance, by `datorum.ChatHistory` (`doc_model = "chat-history"`), a comprehensive data structure designed for seamless interaction with inference endpoints, which can be stored in any of these three structured data doc types. The framework also provides the `datorum.Markdown` model (`doc_model = "markdown"`) out of the box, separating the handling of Markdown content from the structured data found in the frontmatter of Markdown files (`doc_type = "text/markdown"`), a feature particularly useful for working with indexed and categorized semantic contexts.
|
|
74
|
+
|
|
75
|
+
- **Execution layers**
|
|
76
|
+
Three worker types are provided, each with a distinct responsibility:
|
|
77
|
+
- *Tools*: built programmatically and configured through context documents; can be invoked directly by the user, by an LLM using tooling, or as a pipeline step. The standard toolset is still to be implemented.
|
|
78
|
+
- *Agents*: defined via separate providers and roles, with pluggable API‑key resolution to interface with existing security backends. Agents can be forced to execute only tool calls for a fixed number of iterations; the resulting chat history can then be bound to a different role, enabling a clean separation between the model that gathers data and the model that performs inference.
|
|
79
|
+
- *Pipelines*: organised as steps of four types (tool, agent, human‑in‑the‑loop, and decision). Every step points to the next one by ID, except decision steps, which run a user‑supplied script (defined in settings) to determine the following step at runtime. The pipeline state is stored on disk whenever a step completes, allowing for recovery between executions.
|
|
80
|
+
|
|
81
|
+
Workers run jobs - asynchronous runtime instances that can be monitored, paused, and resumed - relying on broadcasters for chunks (in the case of provider response streaming), logs, and state updates.
|
|
82
|
+
|
|
83
|
+
- **CLI**
|
|
84
|
+
Basic configuration operations are available, though most files are still expected to be edited manually. The CLI can invoke all three workers. Pipelines can be invoked in interactive mode (pauses execution at HITL steps and waits for user to choose between resuming or stopping the worker) or non‑interactive mode (terminates on HITL, with the possibility of resuming later).
|
|
85
|
+
|
|
86
|
+
- **Quality assurance**
|
|
87
|
+
The codebase has 100% test coverage, passes linting checks, and is continuously integrated on both CodeBerg and GitHub. The forthcoming release (0.1.0a1) will be the first published on PyPI.
|
|
88
|
+
|
|
89
|
+
## Roadmap
|
|
90
|
+
|
|
91
|
+
The project is being developed in incremental, observable milestones:
|
|
92
|
+
|
|
93
|
+
- **v0.1.0a2** - documentation
|
|
94
|
+
API reference and usage guides will be written in reStructuredText and published to Read the Docs via CI. A context-management tool will be added to handle auto-discovery and organization of context documents.
|
|
95
|
+
|
|
96
|
+
- **v0.1.0b1** - core toolset
|
|
97
|
+
In addition to resolving issues encountered in the initial use cases, the version will enter the beta stage once a basic set of tools is implemented out-of-the-box. At that point, the framework must be capable of gathering documents from different sources, normalizing them, and preparing them for search via selector, pattern, or semantics. Also, this basic set of tools must enable context and chat history customizing.
|
|
98
|
+
|
|
99
|
+
- **v0.1.0** - the workbench
|
|
100
|
+
Starting with the beta version, the focus shifts to developing a web interface capable of handling various file types - such as forms, chat histories, and a syntax - highlighting editor as a fallback for non-binary files. It must also allow users to start, pause, and resume all workers, customize pipeline executions, and monitor all broadcasters. When the workbench is ready for general use, the framework will exit the beta stage, entering version **v0.1.0**, and begin moving toward a stable, production-ready version - namely, **v1.0.0**.
|
|
101
|
+
|
|
102
|
+
In the long term, the project remains an open laboratory for context engineering, allowing the comparison of different context engineering techniques in different language models, including benchmarks that enable comparison with larger and context-naive models.
|
|
103
|
+
|
|
104
|
+
## How to use
|
|
105
|
+
|
|
106
|
+
### Installing
|
|
107
|
+
|
|
108
|
+
Ensure you have Python 3.14 or later installed. If you want an isolated install, use Python's venv module.
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
python -m venv venv-datorum
|
|
112
|
+
source ./venv-datorum/bin/activate
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
For a quick installation via pip, you can point directly to the repository.
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
pip install git+https://github.com/alicecbonafe/datorum.git
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
For a complete dev install, clone the repository and install the package in development mode.
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
git clone https://github.com/alicecbonafe/datorum.git
|
|
125
|
+
cd datorum
|
|
126
|
+
pip install -e .
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
This will install all the dependencies and link the executable.
|
|
130
|
+
|
|
131
|
+
### Setting up
|
|
132
|
+
|
|
133
|
+
Before using Datorum, initialize the configuration file and directory structure.
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
datorum config init
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
This creates a .datorum.yml configuration file in the current directory with default settings. The following options are available:
|
|
140
|
+
|
|
141
|
+
- `-c`, `--contexts`: Specify the path for document contexts (default: `contexts`)
|
|
142
|
+
- `-f`, `--flows`: Specify the path for pipeline flows (default: `flows`)
|
|
143
|
+
- `-t`, `--flow-id-template`: Set the template for flow IDs (default: `flow_{index}`)
|
|
144
|
+
- `-d`, `--sample-data`: Include sample configurations for toolkits, agents, and pipelines
|
|
145
|
+
|
|
146
|
+
To create a document context for managing files:
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
datorum config context create my_context
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Link existing files to a context:
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
datorum config context link my_context data/my_context/path/to/document.yaml --doc-type application/yaml --doc-model dict
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
The command merely creates the reference in the settings; the file does not actually need to exist, as it can be created by tools.
|
|
159
|
+
|
|
160
|
+
The folder structure is converted into a domain structure separated by `"."`. In this case, `my_context/path/to/document.yaml` will generate a `document_id` of `"path.to.document.yaml"`. To omit the extension, change the document settings by defining the `extension` field. In the following example, the two documents refer to the same file.
|
|
161
|
+
|
|
162
|
+
```yaml
|
|
163
|
+
contexts_path: data
|
|
164
|
+
flows_path: flows
|
|
165
|
+
flow_id_template: flow_{index}
|
|
166
|
+
toolkit:
|
|
167
|
+
toolboxes: ...
|
|
168
|
+
agencykit:
|
|
169
|
+
providers: ...
|
|
170
|
+
roles: ...
|
|
171
|
+
plumbingkit:
|
|
172
|
+
pipelines: ...
|
|
173
|
+
contexts:
|
|
174
|
+
my_context:
|
|
175
|
+
id: my_context
|
|
176
|
+
documents:
|
|
177
|
+
path.to.document.yaml:
|
|
178
|
+
id: path.to.document.yaml
|
|
179
|
+
doc_type: application/yaml
|
|
180
|
+
doc_model: dict
|
|
181
|
+
extension: null
|
|
182
|
+
metadata: {}
|
|
183
|
+
path.to.document:
|
|
184
|
+
id: path.to.document
|
|
185
|
+
doc_type: application/yaml
|
|
186
|
+
doc_model: dict
|
|
187
|
+
extension: yaml
|
|
188
|
+
metadata: {}
|
|
189
|
+
domain_metadata: {}
|
|
190
|
+
api_keys: null
|
|
191
|
+
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
### Invoking workers
|
|
195
|
+
|
|
196
|
+
Datorum provides three worker types, each invoked through the datorum run command group.
|
|
197
|
+
|
|
198
|
+
#### Running tools
|
|
199
|
+
|
|
200
|
+
Execute a registered tool with input and output documents:
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
datorum run tool TOOL_SELECTOR [CONTEXT:]INPUT_DOC [CONTEXT:]OUTPUT_DOC
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
Example:
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
datorum run tool my_toolbox.my_tool my_context:path.to.document.yaml my_context:path.to.other.document.yaml
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
Additional context or resource bindings can be specified with -c and -r options respectively.
|
|
213
|
+
|
|
214
|
+
#### Running agents
|
|
215
|
+
|
|
216
|
+
Start an agent interaction with a chat history:
|
|
217
|
+
|
|
218
|
+
```bash
|
|
219
|
+
datorum run agent ROLE_ID [CONTEXT:]CHAT_HISTORY_DOC
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
Example:
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
datorum run agent my_role my_context:chat_history.json
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
To specify a particular inference provider (otherwise determined from the role's preferred models):
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
datorum run agent my_role my_context:chat_history.json --provider my_provider
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
#### Running pipelines
|
|
235
|
+
|
|
236
|
+
Start a new pipeline flow:
|
|
237
|
+
|
|
238
|
+
```bash
|
|
239
|
+
datorum run pipeline --pipeline PIPELINE_ID
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
Resume an existing flow:
|
|
243
|
+
|
|
244
|
+
```bash
|
|
245
|
+
datorum run pipeline FLOW_ID
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
For non-interactive execution (will terminate at human-in-the-loop steps):
|
|
249
|
+
|
|
250
|
+
```bash
|
|
251
|
+
datorum run pipeline FLOW_ID --non-interactive
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
To create a flow file without executing it:
|
|
255
|
+
|
|
256
|
+
```bash
|
|
257
|
+
datorum run pipeline --pipeline PIPELINE_ID --create-only
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
Pipelines support four step types: tool, agent, human-in-the-loop, and decision. The pipeline state is automatically saved after each step, allowing for recovery between executions.
|
|
261
|
+
|
|
262
|
+
### Configuration management
|
|
263
|
+
|
|
264
|
+
Export and import configuration kits for reuse across projects:
|
|
265
|
+
|
|
266
|
+
```bash
|
|
267
|
+
# Export toolkit configuration
|
|
268
|
+
datorum config export toolkit tools_config.yml
|
|
269
|
+
|
|
270
|
+
# Import agency configuration
|
|
271
|
+
datorum config import agents agency_config.yml
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
Supported kit types: `toolkit` (or `tools`, `t`), `agencykit` (or `agents`, `a`), `plumbingkit` (or `pipelines`, `pipes`, `p`).
|
|
275
|
+
|
|
276
|
+
### API keys setup
|
|
277
|
+
|
|
278
|
+
For quick use of the framework, you can define API keys using environment variables.
|
|
279
|
+
|
|
280
|
+
```bash
|
|
281
|
+
export PROVIDER_ID_API_KEY=your_api_key_value
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
It is also possible to define them directly in the settings file, in plain text. However, for use in a production environment—and to keep your keys secure in general—you can programmatically configure a security backend.
|
|
285
|
+
|
|
286
|
+
## License
|
|
287
|
+
|
|
288
|
+
This software may be used, including commercially, under the terms of the [Apache 2.0](LICENSE) license.
|