versionhq 1.2.1.1__tar.gz → 1.2.1.3__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.
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/.github/workflows/deploy_docs.yml +2 -2
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/.gitignore +6 -2
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/PKG-INFO +66 -58
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/README.md +65 -57
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/docs/core/Agent.md +2 -4
- versionhq-1.2.1.3/docs/core/task/evaluation.md +8 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/docs/core/task/response-field.md +14 -8
- versionhq-1.2.1.3/docs/core/task/task-output.md +79 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/docs/core/task-graph.md +2 -4
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/docs/core/task.md +76 -25
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/docs/core/tool.md +2 -4
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/docs/index.md +45 -51
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/docs/quickstart.md +0 -7
- versionhq-1.2.1.3/docs/tags.md +4 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/mkdocs.yml +7 -3
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/pyproject.toml +2 -2
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/requirements.txt +2 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/__init__.py +1 -1
- versionhq-1.2.1.3/src/versionhq/_utils/logger.py +97 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/agent/model.py +7 -8
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/memory/contextual_memory.py +2 -5
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/task/formation.py +14 -3
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/task/model.py +68 -108
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq.egg-info/PKG-INFO +66 -58
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq.egg-info/SOURCES.txt +3 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/tests/agent/agent_test.py +0 -1
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/tests/agent/doc_test.py +1 -1
- versionhq-1.2.1.3/tests/task/doc_taskoutput_test.py +36 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/tests/task/doc_test.py +32 -4
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/tests/task/task_test.py +73 -108
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/uv.lock +46 -46
- versionhq-1.2.1.1/docs/core/task/task-output.md +0 -14
- versionhq-1.2.1.1/src/versionhq/_utils/logger.py +0 -50
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/.github/workflows/publish.yml +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/.github/workflows/publish_testpypi.yml +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/.github/workflows/run_tests.yml +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/.github/workflows/security_check.yml +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/.pre-commit-config.yaml +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/.python-version +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/LICENSE +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/SECURITY.md +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/db/preprocess.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/docs/CNAME +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/docs/_logos/favicon.ico +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/docs/_logos/logo192.png +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/docs/stylesheets/main.css +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/requirements-dev.txt +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/runtime.txt +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/setup.cfg +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/_utils/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/_utils/i18n.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/_utils/process_config.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/_utils/usage_metrics.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/_utils/vars.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/agent/TEMPLATES/Backstory.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/agent/TEMPLATES/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/agent/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/agent/inhouse_agents.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/agent/parser.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/agent/rpm_controller.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/agent_network/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/agent_network/model.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/cli/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/clients/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/clients/customer/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/clients/customer/model.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/clients/product/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/clients/product/model.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/clients/workflow/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/clients/workflow/model.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/knowledge/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/knowledge/_utils.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/knowledge/embedding.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/knowledge/model.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/knowledge/source.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/knowledge/source_docling.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/knowledge/storage.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/llm/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/llm/llm_vars.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/llm/model.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/memory/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/memory/model.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/storage/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/storage/base.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/storage/ltm_sqlite_storage.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/storage/mem0_storage.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/storage/rag_storage.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/storage/task_output_storage.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/storage/utils.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/task/TEMPLATES/Description.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/task/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/task/evaluate.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/task/formatter.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/task/log_handler.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/task/structured_response.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/task_graph/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/task_graph/model.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/tool/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/tool/cache_handler.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/tool/composio_tool.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/tool/composio_tool_vars.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/tool/decorator.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/tool/model.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq/tool/tool_handler.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq.egg-info/dependency_links.txt +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq.egg-info/requires.txt +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/src/versionhq.egg-info/top_level.txt +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/tests/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/tests/agent/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/tests/agent_network/Prompts/Demo_test.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/tests/agent_network/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/tests/agent_network/agent_network_test.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/tests/cli/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/tests/clients/customer_test.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/tests/clients/product_test.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/tests/clients/workflow_test.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/tests/conftest.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/tests/doc_test.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/tests/formation_test.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/tests/knowledge/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/tests/knowledge/knowledge_test.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/tests/knowledge/mock_report_compressed.pdf +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/tests/llm/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/tests/llm/llm_test.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/tests/memory/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/tests/memory/memory_test.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/tests/task/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/tests/task/llm_connection_test.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/tests/task_graph/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/tests/task_graph/doc_test.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/tests/task_graph/task_graph_test.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/tests/tool/__init__.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/tests/tool/composio_test.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/tests/tool/doc_test.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/tests/tool/tool_test.py +0 -0
- {versionhq-1.2.1.1 → versionhq-1.2.1.3}/tests/usecase_test.py +0 -0
@@ -7,24 +7,28 @@ _memo
|
|
7
7
|
_idea.py
|
8
8
|
|
9
9
|
|
10
|
-
|
11
10
|
dist/
|
12
11
|
lib/
|
13
12
|
build/
|
14
13
|
.pypirc
|
14
|
+
*egg-info/
|
15
|
+
|
15
16
|
uploads/
|
16
17
|
sample_dataset/
|
17
18
|
chroma.sqlite3
|
18
|
-
|
19
|
+
|
19
20
|
test/
|
20
21
|
db/
|
21
22
|
rc-tests/*
|
22
23
|
temp/*
|
23
24
|
.vscode/*
|
24
25
|
assets/*
|
26
|
+
|
25
27
|
memo.txt
|
26
28
|
site/
|
27
29
|
|
30
|
+
_logs/
|
31
|
+
.cache
|
28
32
|
__pycache__
|
29
33
|
.ruff_cache/
|
30
34
|
.pytest_cache/
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: versionhq
|
3
|
-
Version: 1.2.1.
|
3
|
+
Version: 1.2.1.3
|
4
4
|
Summary: An agentic orchestration framework for building agent networks that handle task automation.
|
5
5
|
Author-email: Kuriko Iwai <kuriko@versi0n.io>
|
6
6
|
License: MIT License
|
@@ -89,7 +89,7 @@ Requires-Dist: pygraphviz>=1.14; extra == "pygraphviz"
|
|
89
89
|

|
90
90
|
|
91
91
|
|
92
|
-
|
92
|
+
Agentic orchestration framework for multi-agent networks and task graph for complex task automation.
|
93
93
|
|
94
94
|
**Visit:**
|
95
95
|
|
@@ -115,13 +115,12 @@ A Python framework for agentic orchestration that handles complex task automatio
|
|
115
115
|
- [Forming a agent network](#forming-a-agent-network)
|
116
116
|
- [Executing tasks](#executing-tasks)
|
117
117
|
- [Supervising](#supervising)
|
118
|
-
- [Supervising](#supervising-1)
|
119
118
|
- [Technologies Used](#technologies-used)
|
120
119
|
- [Project Structure](#project-structure)
|
121
|
-
- [Setting Up
|
122
|
-
- [
|
123
|
-
- [
|
124
|
-
- [
|
120
|
+
- [Setting Up Your Project](#setting-up-your-project)
|
121
|
+
- [Installing package manager](#installing-package-manager)
|
122
|
+
- [Installing dependencies](#installing-dependencies)
|
123
|
+
- [Adding env secrets to .env file](#adding-env-secrets-to-env-file)
|
125
124
|
- [Contributing](#contributing)
|
126
125
|
- [Steps](#steps)
|
127
126
|
- [Package Management with uv](#package-management-with-uv)
|
@@ -189,7 +188,14 @@ task_graph.add_dependency(
|
|
189
188
|
type=vhq.DependencyType.FINISH_TO_FINISH, lag=1, required=False, weight=3
|
190
189
|
)
|
191
190
|
|
191
|
+
# To visualize the graph:
|
192
192
|
task_graph.visualize()
|
193
|
+
|
194
|
+
# To start executing nodes:
|
195
|
+
latest_output, outputs = task_graph.activate()
|
196
|
+
|
197
|
+
assert isinstance(last_task_output, vhq.TaskOutput)
|
198
|
+
assert [k in task_graph.nodes.keys() and v and isinstance(v, vhq.TaskOutput) for k, v in outputs.items()]
|
193
199
|
```
|
194
200
|
|
195
201
|
<hr />
|
@@ -257,7 +263,7 @@ agent.update(
|
|
257
263
|
res = network.launch()
|
258
264
|
```
|
259
265
|
|
260
|
-
|
266
|
+
This will form a network with multiple agents on `Formation` and return `TaskOutput` object with output in JSON, plane text, Pydantic model format with evaluation.
|
261
267
|
|
262
268
|
|
263
269
|
### Executing tasks
|
@@ -267,47 +273,45 @@ You can simply build an agent using `Agent` model and execute the task using `Ta
|
|
267
273
|
By default, agents prioritize JSON over plane text outputs.
|
268
274
|
|
269
275
|
|
270
|
-
|
271
|
-
|
272
|
-
|
276
|
+
```python
|
277
|
+
import versionhq as vhq
|
278
|
+
from pydantic import BaseModel
|
273
279
|
|
274
|
-
|
275
|
-
|
276
|
-
|
280
|
+
class CustomOutput(BaseModel):
|
281
|
+
test1: str
|
282
|
+
test2: list[str]
|
277
283
|
|
278
|
-
|
279
|
-
|
284
|
+
def dummy_func(message: str, test1: str, test2: list[str]) -> str:
|
285
|
+
return f"""{message}: {test1}, {", ".join(test2)}"""
|
280
286
|
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
+
task = vhq.Task(
|
288
|
+
description="Amazing task",
|
289
|
+
pydantic_output=CustomOutput,
|
290
|
+
callback=dummy_func,
|
291
|
+
callback_kwargs=dict(message="Hi! Here is the result: ")
|
292
|
+
)
|
287
293
|
|
288
|
-
|
289
|
-
|
290
|
-
|
294
|
+
res = task.execute(context="amazing context to consider.")
|
295
|
+
print(res)
|
296
|
+
```
|
291
297
|
|
292
298
|
|
293
299
|
This will return a `TaskOutput` object that stores response in plane text, JSON, and Pydantic model: `CustomOutput` formats with a callback result, tool output (if given), and evaluation results (if given).
|
294
300
|
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
301
|
+
```python
|
302
|
+
res == TaskOutput(
|
303
|
+
task_id=UUID('<TASK UUID>'),
|
304
|
+
raw='{\"test1\":\"random str\", \"test2\":[\"str item 1\", \"str item 2\", \"str item 3\"]}',
|
305
|
+
json_dict={'test1': 'random str', 'test2': ['str item 1', 'str item 2', 'str item 3']},
|
306
|
+
pydantic=<class '__main__.CustomOutput'>,
|
307
|
+
tool_output=None,
|
308
|
+
callback_output='Hi! Here is the result: random str, str item 1, str item 2, str item 3', # returned a plain text summary
|
309
|
+
evaluation=None
|
310
|
+
)
|
311
|
+
```
|
306
312
|
|
307
313
|
### Supervising
|
308
314
|
|
309
|
-
## Supervising
|
310
|
-
|
311
315
|
To create an agent network with one or more manager agents, designate members using the `is_manager` tag.
|
312
316
|
|
313
317
|
```python
|
@@ -349,34 +353,34 @@ Tasks can be delegated to a manager, peers within the agent network, or a comple
|
|
349
353
|
|
350
354
|
## Technologies Used
|
351
355
|
|
352
|
-
**Task Graph**
|
353
|
-
|
354
|
-
* [NetworkX](https://networkx.org/documentation/stable/reference/introduction.html): A Python package to analyze, create, and manipulate complex graph networks.
|
355
|
-
* [Matplotlib](https://matplotlib.org/stable/index.html): Visualization library
|
356
|
-
* [Graphviz](https://graphviz.org/about/): Graph visualization software
|
357
|
-
|
358
|
-
|
359
356
|
**Schema, Data Validation**
|
360
357
|
|
361
358
|
* [Pydantic](https://docs.pydantic.dev/latest/): Data validation and serialization library for Python.
|
362
359
|
* [Upstage](https://console.upstage.ai/docs/getting-started/overview): Document processer for ML tasks. (Use `Document Parser API` to extract data from documents)
|
363
360
|
* [Docling](https://ds4sd.github.io/docling/): Document parsing
|
364
361
|
|
362
|
+
**Workflow, Task Graph**
|
365
363
|
|
366
|
-
|
367
|
-
|
368
|
-
* [
|
369
|
-
* [Chroma DB](https://docs.trychroma.com/): Vector database for storing and querying usage data.
|
370
|
-
* [SQLite](https://www.sqlite.org/docs.html): C-language library to implements a small SQL database engine.
|
364
|
+
* [NetworkX](https://networkx.org/documentation/stable/reference/introduction.html): A Python package to analyze, create, and manipulate complex graph networks.
|
365
|
+
* [Matplotlib](https://matplotlib.org/stable/index.html): For graph visualization.
|
366
|
+
* [Graphviz](https://graphviz.org/about/): For graph visualization.
|
371
367
|
|
372
|
-
**LLM
|
368
|
+
**LLM Curation**
|
373
369
|
|
374
|
-
* [LiteLLM](https://docs.litellm.ai/docs/providers):
|
370
|
+
* [LiteLLM](https://docs.litellm.ai/docs/providers): LLM orchestration platform
|
375
371
|
|
376
372
|
**Tools**
|
377
373
|
|
378
374
|
* [Composio](https://composio.dev/): Conect RAG agents with external tools, Apps, and APIs to perform actions and receive triggers. We use [tools](https://composio.dev/tools) and [RAG tools](https://app.composio.dev/app/ragtool) from Composio toolset.
|
379
375
|
|
376
|
+
|
377
|
+
**Storage**
|
378
|
+
|
379
|
+
* [mem0ai](https://docs.mem0.ai/quickstart#install-package): Agents' memory storage and management.
|
380
|
+
* [Chroma DB](https://docs.trychroma.com/): Vector database for storing and querying usage data.
|
381
|
+
* [SQLite](https://www.sqlite.org/docs.html): C-language library to implements a small SQL database engine.
|
382
|
+
|
383
|
+
|
380
384
|
**Deployment**
|
381
385
|
|
382
386
|
* **Python**: Primary programming language. v3.12.x is recommended
|
@@ -410,16 +414,19 @@ src/
|
|
410
414
|
│ └── ...
|
411
415
|
│
|
412
416
|
└── uploads/ [.gitignore] # Local directory to store uploaded files such as graphviz diagrams generatd by `Network` class
|
413
|
-
|
417
|
+
│
|
418
|
+
└── _logs/ [.gitignore] # Local directory to store error/warning logs for debugging
|
419
|
+
│
|
420
|
+
│
|
414
421
|
pyproject.toml # Project config
|
415
422
|
|
416
423
|
```
|
417
424
|
|
418
425
|
<hr />
|
419
426
|
|
420
|
-
## Setting Up
|
427
|
+
## Setting Up Your Project
|
421
428
|
|
422
|
-
###
|
429
|
+
### Installing package manager
|
423
430
|
|
424
431
|
For MacOS:
|
425
432
|
|
@@ -433,7 +440,7 @@ pyproject.toml # Project config
|
|
433
440
|
```
|
434
441
|
|
435
442
|
|
436
|
-
###
|
443
|
+
### Installing dependencies
|
437
444
|
|
438
445
|
```
|
439
446
|
uv venv
|
@@ -466,7 +473,7 @@ pyproject.toml # Project config
|
|
466
473
|
|
467
474
|
- `torch`/`Docling` related errors: Set up default Python version either `3.11.x` or `3.12.x` (same as AssertionError)
|
468
475
|
|
469
|
-
###
|
476
|
+
### Adding env secrets to .env file
|
470
477
|
|
471
478
|
Create `.env` file in the project root and add following:
|
472
479
|
|
@@ -479,6 +486,7 @@ Create `.env` file in the project root and add following:
|
|
479
486
|
[OTHER_LLM_INTERFACE_PROVIDER_OF_YOUR_CHOICE]_API_KEY=your-api-key
|
480
487
|
```
|
481
488
|
|
489
|
+
|
482
490
|
<hr />
|
483
491
|
|
484
492
|
## Contributing
|
@@ -583,7 +591,7 @@ Common issues and solutions:
|
|
583
591
|
|
584
592
|
* Issues related to dependencies: `rm -rf uv.lock`, `uv cache clean`, `uv venv`, and run `uv pip install -r requirements.txt -v`.
|
585
593
|
|
586
|
-
* Issues related to
|
594
|
+
* Issues related to agents and other systems: Check `_logs` directory for detailed error messages and stack traces.
|
587
595
|
|
588
596
|
* Issues related to `Python quit unexpectedly`: Check [this stackoverflow article](https://stackoverflow.com/questions/59888499/macos-catalina-python-quit-unexpectedly-error).
|
589
597
|
|
@@ -8,7 +8,7 @@
|
|
8
8
|

|
9
9
|
|
10
10
|
|
11
|
-
|
11
|
+
Agentic orchestration framework for multi-agent networks and task graph for complex task automation.
|
12
12
|
|
13
13
|
**Visit:**
|
14
14
|
|
@@ -34,13 +34,12 @@ A Python framework for agentic orchestration that handles complex task automatio
|
|
34
34
|
- [Forming a agent network](#forming-a-agent-network)
|
35
35
|
- [Executing tasks](#executing-tasks)
|
36
36
|
- [Supervising](#supervising)
|
37
|
-
- [Supervising](#supervising-1)
|
38
37
|
- [Technologies Used](#technologies-used)
|
39
38
|
- [Project Structure](#project-structure)
|
40
|
-
- [Setting Up
|
41
|
-
- [
|
42
|
-
- [
|
43
|
-
- [
|
39
|
+
- [Setting Up Your Project](#setting-up-your-project)
|
40
|
+
- [Installing package manager](#installing-package-manager)
|
41
|
+
- [Installing dependencies](#installing-dependencies)
|
42
|
+
- [Adding env secrets to .env file](#adding-env-secrets-to-env-file)
|
44
43
|
- [Contributing](#contributing)
|
45
44
|
- [Steps](#steps)
|
46
45
|
- [Package Management with uv](#package-management-with-uv)
|
@@ -108,7 +107,14 @@ task_graph.add_dependency(
|
|
108
107
|
type=vhq.DependencyType.FINISH_TO_FINISH, lag=1, required=False, weight=3
|
109
108
|
)
|
110
109
|
|
110
|
+
# To visualize the graph:
|
111
111
|
task_graph.visualize()
|
112
|
+
|
113
|
+
# To start executing nodes:
|
114
|
+
latest_output, outputs = task_graph.activate()
|
115
|
+
|
116
|
+
assert isinstance(last_task_output, vhq.TaskOutput)
|
117
|
+
assert [k in task_graph.nodes.keys() and v and isinstance(v, vhq.TaskOutput) for k, v in outputs.items()]
|
112
118
|
```
|
113
119
|
|
114
120
|
<hr />
|
@@ -176,7 +182,7 @@ agent.update(
|
|
176
182
|
res = network.launch()
|
177
183
|
```
|
178
184
|
|
179
|
-
|
185
|
+
This will form a network with multiple agents on `Formation` and return `TaskOutput` object with output in JSON, plane text, Pydantic model format with evaluation.
|
180
186
|
|
181
187
|
|
182
188
|
### Executing tasks
|
@@ -186,47 +192,45 @@ You can simply build an agent using `Agent` model and execute the task using `Ta
|
|
186
192
|
By default, agents prioritize JSON over plane text outputs.
|
187
193
|
|
188
194
|
|
189
|
-
|
190
|
-
|
191
|
-
|
195
|
+
```python
|
196
|
+
import versionhq as vhq
|
197
|
+
from pydantic import BaseModel
|
192
198
|
|
193
|
-
|
194
|
-
|
195
|
-
|
199
|
+
class CustomOutput(BaseModel):
|
200
|
+
test1: str
|
201
|
+
test2: list[str]
|
196
202
|
|
197
|
-
|
198
|
-
|
203
|
+
def dummy_func(message: str, test1: str, test2: list[str]) -> str:
|
204
|
+
return f"""{message}: {test1}, {", ".join(test2)}"""
|
199
205
|
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
+
task = vhq.Task(
|
207
|
+
description="Amazing task",
|
208
|
+
pydantic_output=CustomOutput,
|
209
|
+
callback=dummy_func,
|
210
|
+
callback_kwargs=dict(message="Hi! Here is the result: ")
|
211
|
+
)
|
206
212
|
|
207
|
-
|
208
|
-
|
209
|
-
|
213
|
+
res = task.execute(context="amazing context to consider.")
|
214
|
+
print(res)
|
215
|
+
```
|
210
216
|
|
211
217
|
|
212
218
|
This will return a `TaskOutput` object that stores response in plane text, JSON, and Pydantic model: `CustomOutput` formats with a callback result, tool output (if given), and evaluation results (if given).
|
213
219
|
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
220
|
+
```python
|
221
|
+
res == TaskOutput(
|
222
|
+
task_id=UUID('<TASK UUID>'),
|
223
|
+
raw='{\"test1\":\"random str\", \"test2\":[\"str item 1\", \"str item 2\", \"str item 3\"]}',
|
224
|
+
json_dict={'test1': 'random str', 'test2': ['str item 1', 'str item 2', 'str item 3']},
|
225
|
+
pydantic=<class '__main__.CustomOutput'>,
|
226
|
+
tool_output=None,
|
227
|
+
callback_output='Hi! Here is the result: random str, str item 1, str item 2, str item 3', # returned a plain text summary
|
228
|
+
evaluation=None
|
229
|
+
)
|
230
|
+
```
|
225
231
|
|
226
232
|
### Supervising
|
227
233
|
|
228
|
-
## Supervising
|
229
|
-
|
230
234
|
To create an agent network with one or more manager agents, designate members using the `is_manager` tag.
|
231
235
|
|
232
236
|
```python
|
@@ -268,34 +272,34 @@ Tasks can be delegated to a manager, peers within the agent network, or a comple
|
|
268
272
|
|
269
273
|
## Technologies Used
|
270
274
|
|
271
|
-
**Task Graph**
|
272
|
-
|
273
|
-
* [NetworkX](https://networkx.org/documentation/stable/reference/introduction.html): A Python package to analyze, create, and manipulate complex graph networks.
|
274
|
-
* [Matplotlib](https://matplotlib.org/stable/index.html): Visualization library
|
275
|
-
* [Graphviz](https://graphviz.org/about/): Graph visualization software
|
276
|
-
|
277
|
-
|
278
275
|
**Schema, Data Validation**
|
279
276
|
|
280
277
|
* [Pydantic](https://docs.pydantic.dev/latest/): Data validation and serialization library for Python.
|
281
278
|
* [Upstage](https://console.upstage.ai/docs/getting-started/overview): Document processer for ML tasks. (Use `Document Parser API` to extract data from documents)
|
282
279
|
* [Docling](https://ds4sd.github.io/docling/): Document parsing
|
283
280
|
|
281
|
+
**Workflow, Task Graph**
|
284
282
|
|
285
|
-
|
286
|
-
|
287
|
-
* [
|
288
|
-
* [Chroma DB](https://docs.trychroma.com/): Vector database for storing and querying usage data.
|
289
|
-
* [SQLite](https://www.sqlite.org/docs.html): C-language library to implements a small SQL database engine.
|
283
|
+
* [NetworkX](https://networkx.org/documentation/stable/reference/introduction.html): A Python package to analyze, create, and manipulate complex graph networks.
|
284
|
+
* [Matplotlib](https://matplotlib.org/stable/index.html): For graph visualization.
|
285
|
+
* [Graphviz](https://graphviz.org/about/): For graph visualization.
|
290
286
|
|
291
|
-
**LLM
|
287
|
+
**LLM Curation**
|
292
288
|
|
293
|
-
* [LiteLLM](https://docs.litellm.ai/docs/providers):
|
289
|
+
* [LiteLLM](https://docs.litellm.ai/docs/providers): LLM orchestration platform
|
294
290
|
|
295
291
|
**Tools**
|
296
292
|
|
297
293
|
* [Composio](https://composio.dev/): Conect RAG agents with external tools, Apps, and APIs to perform actions and receive triggers. We use [tools](https://composio.dev/tools) and [RAG tools](https://app.composio.dev/app/ragtool) from Composio toolset.
|
298
294
|
|
295
|
+
|
296
|
+
**Storage**
|
297
|
+
|
298
|
+
* [mem0ai](https://docs.mem0.ai/quickstart#install-package): Agents' memory storage and management.
|
299
|
+
* [Chroma DB](https://docs.trychroma.com/): Vector database for storing and querying usage data.
|
300
|
+
* [SQLite](https://www.sqlite.org/docs.html): C-language library to implements a small SQL database engine.
|
301
|
+
|
302
|
+
|
299
303
|
**Deployment**
|
300
304
|
|
301
305
|
* **Python**: Primary programming language. v3.12.x is recommended
|
@@ -329,16 +333,19 @@ src/
|
|
329
333
|
│ └── ...
|
330
334
|
│
|
331
335
|
└── uploads/ [.gitignore] # Local directory to store uploaded files such as graphviz diagrams generatd by `Network` class
|
332
|
-
|
336
|
+
│
|
337
|
+
└── _logs/ [.gitignore] # Local directory to store error/warning logs for debugging
|
338
|
+
│
|
339
|
+
│
|
333
340
|
pyproject.toml # Project config
|
334
341
|
|
335
342
|
```
|
336
343
|
|
337
344
|
<hr />
|
338
345
|
|
339
|
-
## Setting Up
|
346
|
+
## Setting Up Your Project
|
340
347
|
|
341
|
-
###
|
348
|
+
### Installing package manager
|
342
349
|
|
343
350
|
For MacOS:
|
344
351
|
|
@@ -352,7 +359,7 @@ pyproject.toml # Project config
|
|
352
359
|
```
|
353
360
|
|
354
361
|
|
355
|
-
###
|
362
|
+
### Installing dependencies
|
356
363
|
|
357
364
|
```
|
358
365
|
uv venv
|
@@ -385,7 +392,7 @@ pyproject.toml # Project config
|
|
385
392
|
|
386
393
|
- `torch`/`Docling` related errors: Set up default Python version either `3.11.x` or `3.12.x` (same as AssertionError)
|
387
394
|
|
388
|
-
###
|
395
|
+
### Adding env secrets to .env file
|
389
396
|
|
390
397
|
Create `.env` file in the project root and add following:
|
391
398
|
|
@@ -398,6 +405,7 @@ Create `.env` file in the project root and add following:
|
|
398
405
|
[OTHER_LLM_INTERFACE_PROVIDER_OF_YOUR_CHOICE]_API_KEY=your-api-key
|
399
406
|
```
|
400
407
|
|
408
|
+
|
401
409
|
<hr />
|
402
410
|
|
403
411
|
## Contributing
|
@@ -502,7 +510,7 @@ Common issues and solutions:
|
|
502
510
|
|
503
511
|
* Issues related to dependencies: `rm -rf uv.lock`, `uv cache clean`, `uv venv`, and run `uv pip install -r requirements.txt -v`.
|
504
512
|
|
505
|
-
* Issues related to
|
513
|
+
* Issues related to agents and other systems: Check `_logs` directory for detailed error messages and stack traces.
|
506
514
|
|
507
515
|
* Issues related to `Python quit unexpectedly`: Check [this stackoverflow article](https://stackoverflow.com/questions/59888499/macos-catalina-python-quit-unexpectedly-error).
|
508
516
|
|
@@ -1,8 +1,6 @@
|
|
1
1
|
---
|
2
2
|
tags:
|
3
|
-
-
|
4
|
-
- JavaScript
|
5
|
-
- CSS
|
3
|
+
- Agent Network
|
6
4
|
---
|
7
5
|
|
8
6
|
# Agent
|
@@ -14,7 +12,7 @@ Each agent has its unique knowledge and memory on the past task.
|
|
14
12
|
You can create one and assign the task or reassign another task to the existing agent after fine-tuning.
|
15
13
|
|
16
14
|
|
17
|
-
##
|
15
|
+
## Quick Start
|
18
16
|
|
19
17
|
By defining its role and goal in a simple sentence, the AI agent will be set up to run on <bold>`gpt-4o`</bold> by default.
|
20
18
|
|
@@ -1,23 +1,29 @@
|
|
1
1
|
---
|
2
2
|
tags:
|
3
|
-
-
|
4
|
-
- JavaScript
|
5
|
-
- CSS
|
3
|
+
- Task Graph
|
6
4
|
---
|
7
5
|
|
8
|
-
#
|
6
|
+
# Response Field
|
9
7
|
|
10
8
|
<class>`class` versionhq.task.model.<bold>ResponseField<bold></class>
|
11
9
|
|
12
|
-
A class to store response formats to create JSON response schema.
|
10
|
+
A Pydantic class to store response formats to create JSON response schema.
|
13
11
|
|
14
12
|
<hr/>
|
15
13
|
|
16
|
-
##
|
14
|
+
## Variables
|
17
15
|
|
18
|
-
|
16
|
+
| <div style="width:120px">**Variable**</div> | **Data Type** | **Default** | **Nullable** | **Description** |
|
17
|
+
| :--- | :--- | :--- | :--- | :--- |
|
18
|
+
| **`title`** | str | None | False | Stores a field title. |
|
19
|
+
| **`data_type`** | Type | None | False | Stores data type of the response. |
|
20
|
+
| **`items`** | Type | None | True | Stores data type of items in the list. Can leave it None when `data_type` is not list. |
|
21
|
+
| **`properties`** | List[`ResponseField`] | None | True | Stores properties as a list of `ResponseFormat` objects when the `data_type` is dict. |
|
22
|
+
| **`nullable`** | bool | False | False | If the field is nullable. |
|
23
|
+
| **`config`** | Dict[str, Any] | None | True | Stores other configs passed to response schema. |
|
19
24
|
|
20
|
-
|
25
|
+
|
26
|
+
**Quick Start**
|
21
27
|
|
22
28
|
Define a response format with field titles and data types.
|
23
29
|
|
@@ -0,0 +1,79 @@
|
|
1
|
+
---
|
2
|
+
tags:
|
3
|
+
- Task Graph
|
4
|
+
---
|
5
|
+
|
6
|
+
# Task Output
|
7
|
+
|
8
|
+
<class>`class` versionhq.task.model.<bold>TaskOutput<bold></class>
|
9
|
+
|
10
|
+
A Pydantic class to store and manage response from the `Task` object.
|
11
|
+
|
12
|
+
<hr />
|
13
|
+
|
14
|
+
## Variables
|
15
|
+
|
16
|
+
| <div style="width:120px">**Variable**</div> | **Data Type** | **Default** | **Nullable** | **Description** |
|
17
|
+
| :--- | :--- | :--- | :--- | :--- |
|
18
|
+
| **`task_id`** | UUID | uuid.uuid4() | False | Stores task `id` as an identifier. |
|
19
|
+
| **`raw`** | str | None | False | Stores response in plane text format. `None` or `""` when the model returned errors.|
|
20
|
+
| **`json_dict`** | Dict[str, Any] | None | False | Stores response in JSON serializable dictionary. When the system failed formatting or executing tasks without response_fields, `{ output: <res.raw> }` will be returned. |
|
21
|
+
| **`pydantic`** | Type[`BaseModel`] | None | True | Populates and stores Pydantic class defined in the `pydantic_output` field. `None` if `pydantic_output` is NOT given. |
|
22
|
+
| **`tool_output`** | Optional[Any] | None | True | Stores results from the tools of the task or agents ONLY when `tool_res_as_final` set as `True`. |
|
23
|
+
| **`callback_output`** | Optional[Any] | None | True | Stores results from callback functions if any. |
|
24
|
+
| **`evaluation`** | Optional[InstanceOf[`Evaluation`]] | None | True | Stores overall evaluations and usage of the task output. |
|
25
|
+
|
26
|
+
|
27
|
+
The following snippet demonstrates the `TaskOutput` object when the task is all-in with Pydantic response format, callbacks, tools, and evaluation.
|
28
|
+
|
29
|
+
```python
|
30
|
+
import versionhq as vhq
|
31
|
+
from pydantic import BaseModel
|
32
|
+
|
33
|
+
class CustomOutput(BaseModel):
|
34
|
+
test1: str
|
35
|
+
test2: list[str]
|
36
|
+
|
37
|
+
def dummy_tool():
|
38
|
+
return "dummy"
|
39
|
+
|
40
|
+
def summarize_response(message: str, test1: str, test2: list[str]) -> str:
|
41
|
+
return f"""{message}: {test1}, {", ".join(test2)}"""
|
42
|
+
|
43
|
+
task = vhq.Task(
|
44
|
+
description="Research a topic to teach a kid aged 6 about math.",
|
45
|
+
pydantic_output=CustomOutput,
|
46
|
+
tools=[dummy_tool],
|
47
|
+
callback=summarize_response,
|
48
|
+
callback_kwargs=dict(message="Hi! Here is the result: "),
|
49
|
+
should_evaluate=True, # triggers evaluation
|
50
|
+
eval_criteria=["Uniquness", "Fit to audience",],
|
51
|
+
|
52
|
+
)
|
53
|
+
res = task.execute()
|
54
|
+
|
55
|
+
assert res.task_id == task.id
|
56
|
+
assert res.raw
|
57
|
+
assert res.json_dict
|
58
|
+
assert res.pydantic.test1 and res.pydantic.test2
|
59
|
+
assert "Hi! Here is the result: " in res.callback_output
|
60
|
+
assert res.pydantic.test1 in res.callback_output and ", ".join(res.pydantic.test2) in res.callback_output
|
61
|
+
assert res.tool_output is None
|
62
|
+
assert res.evaluation and isinstance(res.evaluation, vhq.Evaluation)
|
63
|
+
```
|
64
|
+
|
65
|
+
|
66
|
+
## Class Methods
|
67
|
+
|
68
|
+
| <div style="width:120px">**Method**</div> | **Params** | **Returns** | **Description** |
|
69
|
+
| :--- | :--- | :--- | :--- |
|
70
|
+
| **`evaluate`** | task: InstanceOf[`Task`] | InstanceOf[`Evaluation`] | Evaluates task output based on the criteria |
|
71
|
+
|
72
|
+
Ref. <a href="/core/task/evaluation">Evaluation</a> class
|
73
|
+
|
74
|
+
## Property
|
75
|
+
|
76
|
+
| <div style="width:120px">**Property**</div> | **Returns** | **Description** |
|
77
|
+
| :--- | :--- | :--- |
|
78
|
+
| **`aggregate_score`** | float | Calucurates weighted average eval scores of the task output. |
|
79
|
+
| **`json_string`** | str | Returns `json_dict` in string format. |
|