versionhq 1.1.13.0__tar.gz → 1.2.0.1__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.1.13.0 → versionhq-1.2.0.1}/.github/workflows/run_tests.yml +1 -1
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/PKG-INFO +149 -35
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/README.md +142 -34
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/docs/core/Agent.md +58 -5
- versionhq-1.2.0.1/docs/core/task/response-field.md +14 -0
- versionhq-1.2.0.1/docs/core/task/task-output.md +14 -0
- versionhq-1.2.0.1/docs/core/task.md +282 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/docs/core/tool.md +4 -4
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/docs/index.md +179 -104
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/docs/quickstart.md +14 -50
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/mkdocs.yml +10 -19
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/pyproject.toml +12 -6
- versionhq-1.2.0.1/requirements-dev.txt +14 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/requirements.txt +0 -6
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/__init__.py +18 -3
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/agent/model.py +91 -39
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/llm/llm_vars.py +0 -1
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/llm/model.py +1 -1
- {versionhq-1.1.13.0/src/versionhq/storage → versionhq-1.2.0.1/src/versionhq/network}/__init__.py +0 -0
- versionhq-1.2.0.1/src/versionhq/network/model.py +500 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/task/evaluate.py +1 -1
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/task/formation.py +1 -1
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/task/model.py +120 -86
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/task/structured_response.py +16 -14
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/team/model.py +11 -10
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/team/team_planner.py +2 -4
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq.egg-info/PKG-INFO +149 -35
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq.egg-info/SOURCES.txt +12 -1
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq.egg-info/requires.txt +9 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/tests/agent/agent_test.py +20 -6
- versionhq-1.2.0.1/tests/agent/doc_test.py +227 -0
- {versionhq-1.1.13.0/tests/knowledge → versionhq-1.2.0.1/tests/cli}/__init__.py +0 -0
- versionhq-1.2.0.1/tests/doc_test.py +39 -0
- {versionhq-1.1.13.0/tests/llm → versionhq-1.2.0.1/tests/knowledge}/__init__.py +0 -0
- {versionhq-1.1.13.0/tests/memory → versionhq-1.2.0.1/tests/llm}/__init__.py +0 -0
- {versionhq-1.1.13.0/tests/team → versionhq-1.2.0.1/tests/memory}/__init__.py +0 -0
- {versionhq-1.1.13.0/tests/tool → versionhq-1.2.0.1/tests/network}/__init__.py +0 -0
- versionhq-1.2.0.1/tests/network/doc_test.py +29 -0
- versionhq-1.2.0.1/tests/network/network_test.py +0 -0
- versionhq-1.2.0.1/tests/task/__init__.py +0 -0
- versionhq-1.2.0.1/tests/task/doc_test.py +136 -0
- versionhq-1.2.0.1/tests/task/llm_connection_test.py +106 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/tests/task/task_test.py +50 -86
- versionhq-1.2.0.1/tests/team/__init__.py +0 -0
- versionhq-1.2.0.1/tests/tool/__init__.py +0 -0
- versionhq-1.2.0.1/tests/tool/doc_test.py +244 -0
- versionhq-1.2.0.1/tests/usecase_test.py +52 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/uv.lock +104 -87
- versionhq-1.1.13.0/CNAME +0 -1
- versionhq-1.1.13.0/requirements-dev.txt +0 -9
- versionhq-1.1.13.0/tests/doc_test.py +0 -492
- versionhq-1.1.13.0/tests/task/__init__.py +0 -59
- versionhq-1.1.13.0/tests/task/llm_connection_test.py +0 -69
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/.github/workflows/deploy_docs.yml +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/.github/workflows/publish.yml +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/.github/workflows/publish_testpypi.yml +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/.github/workflows/security_check.yml +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/.gitignore +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/.pre-commit-config.yaml +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/.python-version +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/LICENSE +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/SECURITY.md +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/db/preprocess.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/docs/CNAME +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/docs/_logos/favicon.ico +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/docs/_logos/logo192.png +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/docs/stylesheets/main.css +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/runtime.txt +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/setup.cfg +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/_utils/__init__.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/_utils/i18n.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/_utils/logger.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/_utils/process_config.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/_utils/usage_metrics.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/_utils/vars.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/agent/TEMPLATES/Backstory.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/agent/TEMPLATES/__init__.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/agent/__init__.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/agent/inhouse_agents.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/agent/parser.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/agent/rpm_controller.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/cli/__init__.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/clients/__init__.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/clients/customer/__init__.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/clients/customer/model.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/clients/product/__init__.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/clients/product/model.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/clients/workflow/__init__.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/clients/workflow/model.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/knowledge/__init__.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/knowledge/_utils.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/knowledge/embedding.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/knowledge/model.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/knowledge/source.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/knowledge/source_docling.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/knowledge/storage.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/llm/__init__.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/memory/__init__.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/memory/contextual_memory.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/memory/model.py +0 -0
- {versionhq-1.1.13.0/src/versionhq/task → versionhq-1.2.0.1/src/versionhq/storage}/__init__.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/storage/base.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/storage/ltm_sqlite_storage.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/storage/mem0_storage.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/storage/rag_storage.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/storage/task_output_storage.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/storage/utils.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/task/TEMPLATES/Description.py +0 -0
- {versionhq-1.1.13.0/src/versionhq/team → versionhq-1.2.0.1/src/versionhq/task}/__init__.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/task/formatter.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/task/log_handler.py +0 -0
- {versionhq-1.1.13.0/src/versionhq/tool → versionhq-1.2.0.1/src/versionhq/team}/__init__.py +0 -0
- {versionhq-1.1.13.0/tests → versionhq-1.2.0.1/src/versionhq/tool}/__init__.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/tool/cache_handler.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/tool/composio_tool.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/tool/composio_tool_vars.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/tool/decorator.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/tool/model.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq/tool/tool_handler.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq.egg-info/dependency_links.txt +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/src/versionhq.egg-info/top_level.txt +0 -0
- {versionhq-1.1.13.0/tests/agent → versionhq-1.2.0.1/tests}/__init__.py +0 -0
- {versionhq-1.1.13.0/tests/cli → versionhq-1.2.0.1/tests/agent}/__init__.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/tests/clients/customer_test.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/tests/clients/product_test.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/tests/clients/workflow_test.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/tests/conftest.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/tests/formation_test.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/tests/knowledge/knowledge_test.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/tests/knowledge/mock_report_compressed.pdf +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/tests/llm/llm_test.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/tests/memory/memory_test.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/tests/team/Prompts/Demo_test.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/tests/team/team_test.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/tests/tool/composio_test.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.2.0.1}/tests/tool/tool_test.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: versionhq
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.2.0.1
|
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
|
@@ -74,13 +74,19 @@ Provides-Extra: pandas
|
|
74
74
|
Requires-Dist: pandas>=2.2.3; extra == "pandas"
|
75
75
|
Provides-Extra: numpy
|
76
76
|
Requires-Dist: numpy>=1.26.4; extra == "numpy"
|
77
|
+
Provides-Extra: pygraphviz
|
78
|
+
Requires-Dist: pygraphviz>=1.14; extra == "pygraphviz"
|
79
|
+
Provides-Extra: networkx
|
80
|
+
Requires-Dist: networkx>=3.4.2; extra == "networkx"
|
81
|
+
Provides-Extra: matplotlib
|
82
|
+
Requires-Dist: matplotlib>=3.10.0; extra == "matplotlib"
|
77
83
|
|
78
84
|
# Overview
|
79
85
|
|
80
86
|
[](https://clickpy.clickhouse.com/dashboard/versionhq)
|
81
87
|

|
82
88
|
[](https://github.com/versionHQ/multi-agent-system/actions/workflows/publish.yml)
|
83
|
-

|
84
90
|

|
85
91
|

|
86
92
|
|
@@ -103,15 +109,21 @@ A Python framework for agentic orchestration that handles complex task automatio
|
|
103
109
|
|
104
110
|
- [Key Features](#key-features)
|
105
111
|
- [Agent formation](#agent-formation)
|
112
|
+
- [Graph Theory Concept](#graph-theory-concept)
|
113
|
+
- [Agent optimization](#agent-optimization)
|
106
114
|
- [Quick Start](#quick-start)
|
107
115
|
- [Package installation](#package-installation)
|
108
116
|
- [Forming a agent network](#forming-a-agent-network)
|
109
|
-
- [
|
117
|
+
- [Executing tasks](#executing-tasks)
|
110
118
|
- [Supervising](#supervising)
|
111
119
|
- [Technologies Used](#technologies-used)
|
112
120
|
- [Project Structure](#project-structure)
|
113
|
-
- [Setting Up](#setting-up)
|
121
|
+
- [Setting Up a Project](#setting-up-a-project)
|
122
|
+
- [1. Installing package manager](#1-installing-package-manager)
|
123
|
+
- [2. Installing dependencies](#2-installing-dependencies)
|
124
|
+
- [3. Adding env secrets to .env file](#3-adding-env-secrets-to-env-file)
|
114
125
|
- [Contributing](#contributing)
|
126
|
+
- [Steps](#steps)
|
115
127
|
- [Package Management with uv](#package-management-with-uv)
|
116
128
|
- [Pre-Commit Hooks](#pre-commit-hooks)
|
117
129
|
- [Documentation](#documentation)
|
@@ -144,6 +156,73 @@ You can specify a desired formation or allow the agents to determine it autonomo
|
|
144
156
|
|
145
157
|
<hr />
|
146
158
|
|
159
|
+
### Graph Theory Concept
|
160
|
+
|
161
|
+
To completely automate task workflows, agents will build a `task-oriented network` by generating `nodes` that represent tasks and connecting them with dependency-defining `edges`.
|
162
|
+
|
163
|
+
Each node is triggered by specific events and executed by an assigned agent once all dependencies are met.
|
164
|
+
|
165
|
+
While the network automatically reconfigures itself, you retain the ability to direct the agents using `should_reform` variable.
|
166
|
+
|
167
|
+
|
168
|
+
The following code snippet demonstrates the `TaskGraph` and its visualization, saving the diagram to the `uploads` directory.
|
169
|
+
|
170
|
+
```python
|
171
|
+
import versionhq as vhq
|
172
|
+
|
173
|
+
task_graph = vhq.TaskGraph(directed=False, should_reform=True) # triggering auto formation
|
174
|
+
|
175
|
+
task_a = vhq.Task(description="Research Topic")
|
176
|
+
task_b = vhq.Task(description="Outline Post")
|
177
|
+
task_c = vhq.Task(description="Write First Draft")
|
178
|
+
|
179
|
+
node_a = task_graph.add_task(task=task_a)
|
180
|
+
node_b = task_graph.add_task(task=task_b)
|
181
|
+
node_c = task_graph.add_task(task=task_c)
|
182
|
+
|
183
|
+
task_graph.add_dependency(
|
184
|
+
node_a.identifier, node_b.identifier,
|
185
|
+
type=vhq.DependencyType.FINISH_TO_START, weight=5, description="B depends on A"
|
186
|
+
)
|
187
|
+
task_graph.add_dependency(
|
188
|
+
node_a.identifier, node_c.identifier,
|
189
|
+
type=vhq.DependencyType.FINISH_TO_FINISH, lag=1, required=False, weight=3
|
190
|
+
)
|
191
|
+
|
192
|
+
task_graph.visualize()
|
193
|
+
```
|
194
|
+
|
195
|
+
<hr />
|
196
|
+
|
197
|
+
### Agent optimization
|
198
|
+
|
199
|
+
Agents are model-agnostic and can handle multiple tasks, leveraging their own and their peers' knowledge sources, memories, and tools.
|
200
|
+
|
201
|
+
Agents are optimized during network formation, but customization is possible before or after.
|
202
|
+
|
203
|
+
The following code snippet demonstrates agent customization:
|
204
|
+
|
205
|
+
```python
|
206
|
+
import versionhq as vhq
|
207
|
+
|
208
|
+
agent = vhq.Agent(
|
209
|
+
role="Marketing Analyst",
|
210
|
+
goal="my amazing goal"
|
211
|
+
) # assuming this agent was created during the network formation
|
212
|
+
|
213
|
+
# update the agent
|
214
|
+
agent.update(
|
215
|
+
llm="gemini-2.0", # updating LLM (Valid llm_config will be inherited to the new LLM.)
|
216
|
+
tools=[vhq.Tool(func=lambda x: x)], # adding tools
|
217
|
+
max_rpm=3,
|
218
|
+
knowledge_sources=["<KC1>", "<KS2>"], # adding knowledge sources. This will trigger the storage creation.
|
219
|
+
memory_config={"user_id": "0001"}, # adding memories
|
220
|
+
dummy="I am dummy" # <- invalid field will be automatically ignored
|
221
|
+
)
|
222
|
+
```
|
223
|
+
|
224
|
+
<hr />
|
225
|
+
|
147
226
|
## Quick Start
|
148
227
|
|
149
228
|
### Package installation
|
@@ -169,11 +248,11 @@ You can specify a desired formation or allow the agents to determine it autonomo
|
|
169
248
|
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.
|
170
249
|
|
171
250
|
|
172
|
-
###
|
251
|
+
### Executing tasks
|
173
252
|
|
174
|
-
You can simply build an agent using `Agent` model.
|
253
|
+
You can simply build an agent using `Agent` model and execute the task using `Task` class.
|
175
254
|
|
176
|
-
By default,
|
255
|
+
By default, agents prioritize JSON over plane text outputs.
|
177
256
|
|
178
257
|
|
179
258
|
```python
|
@@ -189,7 +268,6 @@ By default, the agent prioritize JSON serializable outputs over plane texts.
|
|
189
268
|
|
190
269
|
|
191
270
|
agent = vhq.Agent(role="demo", goal="amazing project goal")
|
192
|
-
|
193
271
|
task = vhq.Task(
|
194
272
|
description="Amazing task",
|
195
273
|
pydantic_output=CustomOutput,
|
@@ -197,7 +275,7 @@ By default, the agent prioritize JSON serializable outputs over plane texts.
|
|
197
275
|
callback_kwargs=dict(message="Hi! Here is the result: ")
|
198
276
|
)
|
199
277
|
|
200
|
-
res = task.
|
278
|
+
res = task.execute(agent=agent, context="amazing context to consider.")
|
201
279
|
print(res)
|
202
280
|
```
|
203
281
|
|
@@ -253,21 +331,29 @@ Tasks can be delegated to a team manager, peers in the team, or completely new a
|
|
253
331
|
|
254
332
|
## Technologies Used
|
255
333
|
|
334
|
+
**Graph Theory (Analysis and Visualization)**
|
335
|
+
|
336
|
+
* [NetworkX](https://networkx.org/documentation/stable/reference/introduction.html): A Python package to analyze, create, and manipulate complex graph networks.
|
337
|
+
* [Matplotlib](https://matplotlib.org/stable/index.html): Visualization library
|
338
|
+
* [Graphviz](https://graphviz.org/about/): Graph visualization software
|
339
|
+
|
340
|
+
|
256
341
|
**Schema, Data Validation**
|
257
342
|
|
258
343
|
* [Pydantic](https://docs.pydantic.dev/latest/): Data validation and serialization library for Python.
|
259
344
|
* [Upstage](https://console.upstage.ai/docs/getting-started/overview): Document processer for ML tasks. (Use `Document Parser API` to extract data from documents)
|
260
345
|
* [Docling](https://ds4sd.github.io/docling/): Document parsing
|
261
346
|
|
347
|
+
|
262
348
|
**Storage**
|
263
349
|
|
264
350
|
* [mem0ai](https://docs.mem0.ai/quickstart#install-package): Agents' memory storage and management.
|
265
351
|
* [Chroma DB](https://docs.trychroma.com/): Vector database for storing and querying usage data.
|
266
352
|
* [SQLite](https://www.sqlite.org/docs.html): C-language library to implements a small SQL database engine.
|
267
353
|
|
268
|
-
**LLM
|
354
|
+
**LLM Integration**
|
269
355
|
|
270
|
-
* [LiteLLM](https://docs.litellm.ai/docs/providers):
|
356
|
+
* [LiteLLM](https://docs.litellm.ai/docs/providers): Integration to diverse LLMs
|
271
357
|
|
272
358
|
**Tools**
|
273
359
|
|
@@ -290,6 +376,7 @@ Tasks can be delegated to a team manager, peers in the team, or completely new a
|
|
290
376
|
└── workflows/ # Github actions
|
291
377
|
│
|
292
378
|
docs/ # Documentation built by MkDocs
|
379
|
+
mkdocs.yml # MkDocs config
|
293
380
|
│
|
294
381
|
src/
|
295
382
|
└── versionhq/ # Orchestration framework package
|
@@ -304,30 +391,32 @@ src/
|
|
304
391
|
│ └── llm/
|
305
392
|
│ └── ...
|
306
393
|
│
|
307
|
-
└── uploads/
|
394
|
+
└── uploads/ [.gitignore] # Local directory to store uploaded files such as graphviz diagrams generatd by `Network` class
|
395
|
+
|
|
396
|
+
pyproject.toml # Project config
|
308
397
|
|
309
398
|
```
|
310
399
|
|
311
400
|
<hr />
|
312
401
|
|
313
|
-
## Setting Up
|
402
|
+
## Setting Up a Project
|
314
403
|
|
315
|
-
1.
|
404
|
+
### 1. Installing package manager
|
316
405
|
|
317
|
-
|
406
|
+
For MacOS:
|
318
407
|
|
319
|
-
|
320
|
-
|
321
|
-
|
408
|
+
```
|
409
|
+
brew install uv
|
410
|
+
```
|
322
411
|
|
323
|
-
|
412
|
+
For Ubuntu/Debian:
|
413
|
+
```
|
414
|
+
sudo apt-get install uv
|
415
|
+
```
|
324
416
|
|
325
|
-
```
|
326
|
-
sudo apt-get install uv
|
327
|
-
```
|
328
417
|
|
418
|
+
### 2. Installing dependencies
|
329
419
|
|
330
|
-
2. Install dependencies:
|
331
420
|
```
|
332
421
|
uv venv
|
333
422
|
source .venv/bin/activate
|
@@ -335,29 +424,51 @@ src/
|
|
335
424
|
uv sync --all-extras
|
336
425
|
```
|
337
426
|
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
427
|
+
- AssertionError/module mismatch errors: Set up default Python version using `.pyenv`
|
428
|
+
```
|
429
|
+
pyenv install 3.12.8
|
430
|
+
pyenv global 3.12.8 (optional: `pyenv global system` to get back to the system default ver.)
|
431
|
+
uv python pin 3.12.8
|
432
|
+
echo 3.12.8 >> .python-version
|
433
|
+
```
|
345
434
|
|
435
|
+
- `pygraphviz` related errors: Run the following commands:
|
436
|
+
```
|
437
|
+
brew install graphviz
|
438
|
+
uv pip install --config-settings="--global-option=build_ext" \
|
439
|
+
--config-settings="--global-option=-I$(brew --prefix graphviz)/include/" \
|
440
|
+
--config-settings="--global-option=-L$(brew --prefix graphviz)/lib/" \
|
441
|
+
pygraphviz
|
442
|
+
```
|
443
|
+
|
444
|
+
* If the error continues, skip pygraphviz installation by:
|
445
|
+
```
|
446
|
+
uv sync --all-extras --no-extra pygraphviz
|
447
|
+
```
|
448
|
+
|
449
|
+
- `torch`/`Docling` related errors: Set up default Python version either `3.11.x` or `3.12.x` (same as AssertionError)
|
450
|
+
|
451
|
+
### 3. Adding env secrets to .env file
|
346
452
|
|
347
|
-
|
453
|
+
Create `.env` file in the project root and add following:
|
348
454
|
|
349
455
|
```
|
350
|
-
LITELLM_API_KEY=your-litellm-api-key
|
351
456
|
OPENAI_API_KEY=your-openai-api-key
|
457
|
+
GEMINI_API_KEY=your-gemini-api-key
|
458
|
+
LITELLM_API_KEY=your-litellm-api-key
|
352
459
|
COMPOSIO_API_KEY=your-composio-api-key
|
353
460
|
COMPOSIO_CLI_KEY=your-composio-cli-key
|
354
|
-
[
|
461
|
+
[OTHER_LLM_INTERFACE_PROVIDER_OF_YOUR_CHOICE]_API_KEY=your-api-key
|
355
462
|
```
|
356
463
|
|
357
464
|
<hr />
|
358
465
|
|
359
466
|
## Contributing
|
360
467
|
|
468
|
+
`versionhq` is a open source project.
|
469
|
+
|
470
|
+
### Steps
|
471
|
+
|
361
472
|
1. Create your feature branch (`git checkout -b feature/your-amazing-feature`)
|
362
473
|
|
363
474
|
2. Create amazing features
|
@@ -365,6 +476,7 @@ src/
|
|
365
476
|
3. Add a test funcition to the `tests` directory and run **pytest**.
|
366
477
|
|
367
478
|
- Add secret values defined in `.github/workflows/run_test.yml` to your Github `repository secrets` located at settings > secrets & variables > Actions.
|
479
|
+
|
368
480
|
- Run a following command:
|
369
481
|
```
|
370
482
|
uv run pytest tests -vv --cache-clear
|
@@ -376,6 +488,8 @@ src/
|
|
376
488
|
|
377
489
|
* Test functions within the files must begin with `test_`.
|
378
490
|
|
491
|
+
* Pytest priorities are `1. playground demo > 2. docs use cases > 3. other features`
|
492
|
+
|
379
493
|
|
380
494
|
4. Update `docs` accordingly.
|
381
495
|
|
@@ -418,7 +532,7 @@ src/
|
|
418
532
|
|
419
533
|
Pre-commit hooks help maintain code quality by running checks for formatting, linting, and other issues before each commit.
|
420
534
|
|
421
|
-
* To skip pre-commit hooks
|
535
|
+
* To skip pre-commit hooks
|
422
536
|
```
|
423
537
|
git commit --no-verify -m "your-commit-message"
|
424
538
|
```
|
@@ -427,7 +541,7 @@ Pre-commit hooks help maintain code quality by running checks for formatting, li
|
|
427
541
|
|
428
542
|
* To edit the documentation, see `docs` repository and edit the respective component.
|
429
543
|
|
430
|
-
* We use `mkdocs` to update the docs. You can run the
|
544
|
+
* We use `mkdocs` to update the docs. You can run the docs locally at http://127.0.0.1:8000/.
|
431
545
|
|
432
546
|
```
|
433
547
|
uv run python3 -m mkdocs serve --clean
|
@@ -3,7 +3,7 @@
|
|
3
3
|
[](https://clickpy.clickhouse.com/dashboard/versionhq)
|
4
4
|

|
5
5
|
[](https://github.com/versionHQ/multi-agent-system/actions/workflows/publish.yml)
|
6
|
-

|
7
7
|

|
8
8
|

|
9
9
|
|
@@ -26,15 +26,21 @@ A Python framework for agentic orchestration that handles complex task automatio
|
|
26
26
|
|
27
27
|
- [Key Features](#key-features)
|
28
28
|
- [Agent formation](#agent-formation)
|
29
|
+
- [Graph Theory Concept](#graph-theory-concept)
|
30
|
+
- [Agent optimization](#agent-optimization)
|
29
31
|
- [Quick Start](#quick-start)
|
30
32
|
- [Package installation](#package-installation)
|
31
33
|
- [Forming a agent network](#forming-a-agent-network)
|
32
|
-
- [
|
34
|
+
- [Executing tasks](#executing-tasks)
|
33
35
|
- [Supervising](#supervising)
|
34
36
|
- [Technologies Used](#technologies-used)
|
35
37
|
- [Project Structure](#project-structure)
|
36
|
-
- [Setting Up](#setting-up)
|
38
|
+
- [Setting Up a Project](#setting-up-a-project)
|
39
|
+
- [1. Installing package manager](#1-installing-package-manager)
|
40
|
+
- [2. Installing dependencies](#2-installing-dependencies)
|
41
|
+
- [3. Adding env secrets to .env file](#3-adding-env-secrets-to-env-file)
|
37
42
|
- [Contributing](#contributing)
|
43
|
+
- [Steps](#steps)
|
38
44
|
- [Package Management with uv](#package-management-with-uv)
|
39
45
|
- [Pre-Commit Hooks](#pre-commit-hooks)
|
40
46
|
- [Documentation](#documentation)
|
@@ -67,6 +73,73 @@ You can specify a desired formation or allow the agents to determine it autonomo
|
|
67
73
|
|
68
74
|
<hr />
|
69
75
|
|
76
|
+
### Graph Theory Concept
|
77
|
+
|
78
|
+
To completely automate task workflows, agents will build a `task-oriented network` by generating `nodes` that represent tasks and connecting them with dependency-defining `edges`.
|
79
|
+
|
80
|
+
Each node is triggered by specific events and executed by an assigned agent once all dependencies are met.
|
81
|
+
|
82
|
+
While the network automatically reconfigures itself, you retain the ability to direct the agents using `should_reform` variable.
|
83
|
+
|
84
|
+
|
85
|
+
The following code snippet demonstrates the `TaskGraph` and its visualization, saving the diagram to the `uploads` directory.
|
86
|
+
|
87
|
+
```python
|
88
|
+
import versionhq as vhq
|
89
|
+
|
90
|
+
task_graph = vhq.TaskGraph(directed=False, should_reform=True) # triggering auto formation
|
91
|
+
|
92
|
+
task_a = vhq.Task(description="Research Topic")
|
93
|
+
task_b = vhq.Task(description="Outline Post")
|
94
|
+
task_c = vhq.Task(description="Write First Draft")
|
95
|
+
|
96
|
+
node_a = task_graph.add_task(task=task_a)
|
97
|
+
node_b = task_graph.add_task(task=task_b)
|
98
|
+
node_c = task_graph.add_task(task=task_c)
|
99
|
+
|
100
|
+
task_graph.add_dependency(
|
101
|
+
node_a.identifier, node_b.identifier,
|
102
|
+
type=vhq.DependencyType.FINISH_TO_START, weight=5, description="B depends on A"
|
103
|
+
)
|
104
|
+
task_graph.add_dependency(
|
105
|
+
node_a.identifier, node_c.identifier,
|
106
|
+
type=vhq.DependencyType.FINISH_TO_FINISH, lag=1, required=False, weight=3
|
107
|
+
)
|
108
|
+
|
109
|
+
task_graph.visualize()
|
110
|
+
```
|
111
|
+
|
112
|
+
<hr />
|
113
|
+
|
114
|
+
### Agent optimization
|
115
|
+
|
116
|
+
Agents are model-agnostic and can handle multiple tasks, leveraging their own and their peers' knowledge sources, memories, and tools.
|
117
|
+
|
118
|
+
Agents are optimized during network formation, but customization is possible before or after.
|
119
|
+
|
120
|
+
The following code snippet demonstrates agent customization:
|
121
|
+
|
122
|
+
```python
|
123
|
+
import versionhq as vhq
|
124
|
+
|
125
|
+
agent = vhq.Agent(
|
126
|
+
role="Marketing Analyst",
|
127
|
+
goal="my amazing goal"
|
128
|
+
) # assuming this agent was created during the network formation
|
129
|
+
|
130
|
+
# update the agent
|
131
|
+
agent.update(
|
132
|
+
llm="gemini-2.0", # updating LLM (Valid llm_config will be inherited to the new LLM.)
|
133
|
+
tools=[vhq.Tool(func=lambda x: x)], # adding tools
|
134
|
+
max_rpm=3,
|
135
|
+
knowledge_sources=["<KC1>", "<KS2>"], # adding knowledge sources. This will trigger the storage creation.
|
136
|
+
memory_config={"user_id": "0001"}, # adding memories
|
137
|
+
dummy="I am dummy" # <- invalid field will be automatically ignored
|
138
|
+
)
|
139
|
+
```
|
140
|
+
|
141
|
+
<hr />
|
142
|
+
|
70
143
|
## Quick Start
|
71
144
|
|
72
145
|
### Package installation
|
@@ -92,11 +165,11 @@ You can specify a desired formation or allow the agents to determine it autonomo
|
|
92
165
|
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.
|
93
166
|
|
94
167
|
|
95
|
-
###
|
168
|
+
### Executing tasks
|
96
169
|
|
97
|
-
You can simply build an agent using `Agent` model.
|
170
|
+
You can simply build an agent using `Agent` model and execute the task using `Task` class.
|
98
171
|
|
99
|
-
By default,
|
172
|
+
By default, agents prioritize JSON over plane text outputs.
|
100
173
|
|
101
174
|
|
102
175
|
```python
|
@@ -112,7 +185,6 @@ By default, the agent prioritize JSON serializable outputs over plane texts.
|
|
112
185
|
|
113
186
|
|
114
187
|
agent = vhq.Agent(role="demo", goal="amazing project goal")
|
115
|
-
|
116
188
|
task = vhq.Task(
|
117
189
|
description="Amazing task",
|
118
190
|
pydantic_output=CustomOutput,
|
@@ -120,7 +192,7 @@ By default, the agent prioritize JSON serializable outputs over plane texts.
|
|
120
192
|
callback_kwargs=dict(message="Hi! Here is the result: ")
|
121
193
|
)
|
122
194
|
|
123
|
-
res = task.
|
195
|
+
res = task.execute(agent=agent, context="amazing context to consider.")
|
124
196
|
print(res)
|
125
197
|
```
|
126
198
|
|
@@ -176,21 +248,29 @@ Tasks can be delegated to a team manager, peers in the team, or completely new a
|
|
176
248
|
|
177
249
|
## Technologies Used
|
178
250
|
|
251
|
+
**Graph Theory (Analysis and Visualization)**
|
252
|
+
|
253
|
+
* [NetworkX](https://networkx.org/documentation/stable/reference/introduction.html): A Python package to analyze, create, and manipulate complex graph networks.
|
254
|
+
* [Matplotlib](https://matplotlib.org/stable/index.html): Visualization library
|
255
|
+
* [Graphviz](https://graphviz.org/about/): Graph visualization software
|
256
|
+
|
257
|
+
|
179
258
|
**Schema, Data Validation**
|
180
259
|
|
181
260
|
* [Pydantic](https://docs.pydantic.dev/latest/): Data validation and serialization library for Python.
|
182
261
|
* [Upstage](https://console.upstage.ai/docs/getting-started/overview): Document processer for ML tasks. (Use `Document Parser API` to extract data from documents)
|
183
262
|
* [Docling](https://ds4sd.github.io/docling/): Document parsing
|
184
263
|
|
264
|
+
|
185
265
|
**Storage**
|
186
266
|
|
187
267
|
* [mem0ai](https://docs.mem0.ai/quickstart#install-package): Agents' memory storage and management.
|
188
268
|
* [Chroma DB](https://docs.trychroma.com/): Vector database for storing and querying usage data.
|
189
269
|
* [SQLite](https://www.sqlite.org/docs.html): C-language library to implements a small SQL database engine.
|
190
270
|
|
191
|
-
**LLM
|
271
|
+
**LLM Integration**
|
192
272
|
|
193
|
-
* [LiteLLM](https://docs.litellm.ai/docs/providers):
|
273
|
+
* [LiteLLM](https://docs.litellm.ai/docs/providers): Integration to diverse LLMs
|
194
274
|
|
195
275
|
**Tools**
|
196
276
|
|
@@ -213,6 +293,7 @@ Tasks can be delegated to a team manager, peers in the team, or completely new a
|
|
213
293
|
└── workflows/ # Github actions
|
214
294
|
│
|
215
295
|
docs/ # Documentation built by MkDocs
|
296
|
+
mkdocs.yml # MkDocs config
|
216
297
|
│
|
217
298
|
src/
|
218
299
|
└── versionhq/ # Orchestration framework package
|
@@ -227,30 +308,32 @@ src/
|
|
227
308
|
│ └── llm/
|
228
309
|
│ └── ...
|
229
310
|
│
|
230
|
-
└── uploads/
|
311
|
+
└── uploads/ [.gitignore] # Local directory to store uploaded files such as graphviz diagrams generatd by `Network` class
|
312
|
+
|
|
313
|
+
pyproject.toml # Project config
|
231
314
|
|
232
315
|
```
|
233
316
|
|
234
317
|
<hr />
|
235
318
|
|
236
|
-
## Setting Up
|
319
|
+
## Setting Up a Project
|
237
320
|
|
238
|
-
1.
|
321
|
+
### 1. Installing package manager
|
239
322
|
|
240
|
-
|
323
|
+
For MacOS:
|
241
324
|
|
242
|
-
|
243
|
-
|
244
|
-
|
325
|
+
```
|
326
|
+
brew install uv
|
327
|
+
```
|
245
328
|
|
246
|
-
|
329
|
+
For Ubuntu/Debian:
|
330
|
+
```
|
331
|
+
sudo apt-get install uv
|
332
|
+
```
|
247
333
|
|
248
|
-
```
|
249
|
-
sudo apt-get install uv
|
250
|
-
```
|
251
334
|
|
335
|
+
### 2. Installing dependencies
|
252
336
|
|
253
|
-
2. Install dependencies:
|
254
337
|
```
|
255
338
|
uv venv
|
256
339
|
source .venv/bin/activate
|
@@ -258,29 +341,51 @@ src/
|
|
258
341
|
uv sync --all-extras
|
259
342
|
```
|
260
343
|
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
344
|
+
- AssertionError/module mismatch errors: Set up default Python version using `.pyenv`
|
345
|
+
```
|
346
|
+
pyenv install 3.12.8
|
347
|
+
pyenv global 3.12.8 (optional: `pyenv global system` to get back to the system default ver.)
|
348
|
+
uv python pin 3.12.8
|
349
|
+
echo 3.12.8 >> .python-version
|
350
|
+
```
|
268
351
|
|
352
|
+
- `pygraphviz` related errors: Run the following commands:
|
353
|
+
```
|
354
|
+
brew install graphviz
|
355
|
+
uv pip install --config-settings="--global-option=build_ext" \
|
356
|
+
--config-settings="--global-option=-I$(brew --prefix graphviz)/include/" \
|
357
|
+
--config-settings="--global-option=-L$(brew --prefix graphviz)/lib/" \
|
358
|
+
pygraphviz
|
359
|
+
```
|
360
|
+
|
361
|
+
* If the error continues, skip pygraphviz installation by:
|
362
|
+
```
|
363
|
+
uv sync --all-extras --no-extra pygraphviz
|
364
|
+
```
|
365
|
+
|
366
|
+
- `torch`/`Docling` related errors: Set up default Python version either `3.11.x` or `3.12.x` (same as AssertionError)
|
367
|
+
|
368
|
+
### 3. Adding env secrets to .env file
|
269
369
|
|
270
|
-
|
370
|
+
Create `.env` file in the project root and add following:
|
271
371
|
|
272
372
|
```
|
273
|
-
LITELLM_API_KEY=your-litellm-api-key
|
274
373
|
OPENAI_API_KEY=your-openai-api-key
|
374
|
+
GEMINI_API_KEY=your-gemini-api-key
|
375
|
+
LITELLM_API_KEY=your-litellm-api-key
|
275
376
|
COMPOSIO_API_KEY=your-composio-api-key
|
276
377
|
COMPOSIO_CLI_KEY=your-composio-cli-key
|
277
|
-
[
|
378
|
+
[OTHER_LLM_INTERFACE_PROVIDER_OF_YOUR_CHOICE]_API_KEY=your-api-key
|
278
379
|
```
|
279
380
|
|
280
381
|
<hr />
|
281
382
|
|
282
383
|
## Contributing
|
283
384
|
|
385
|
+
`versionhq` is a open source project.
|
386
|
+
|
387
|
+
### Steps
|
388
|
+
|
284
389
|
1. Create your feature branch (`git checkout -b feature/your-amazing-feature`)
|
285
390
|
|
286
391
|
2. Create amazing features
|
@@ -288,6 +393,7 @@ src/
|
|
288
393
|
3. Add a test funcition to the `tests` directory and run **pytest**.
|
289
394
|
|
290
395
|
- Add secret values defined in `.github/workflows/run_test.yml` to your Github `repository secrets` located at settings > secrets & variables > Actions.
|
396
|
+
|
291
397
|
- Run a following command:
|
292
398
|
```
|
293
399
|
uv run pytest tests -vv --cache-clear
|
@@ -299,6 +405,8 @@ src/
|
|
299
405
|
|
300
406
|
* Test functions within the files must begin with `test_`.
|
301
407
|
|
408
|
+
* Pytest priorities are `1. playground demo > 2. docs use cases > 3. other features`
|
409
|
+
|
302
410
|
|
303
411
|
4. Update `docs` accordingly.
|
304
412
|
|
@@ -341,7 +449,7 @@ src/
|
|
341
449
|
|
342
450
|
Pre-commit hooks help maintain code quality by running checks for formatting, linting, and other issues before each commit.
|
343
451
|
|
344
|
-
* To skip pre-commit hooks
|
452
|
+
* To skip pre-commit hooks
|
345
453
|
```
|
346
454
|
git commit --no-verify -m "your-commit-message"
|
347
455
|
```
|
@@ -350,7 +458,7 @@ Pre-commit hooks help maintain code quality by running checks for formatting, li
|
|
350
458
|
|
351
459
|
* To edit the documentation, see `docs` repository and edit the respective component.
|
352
460
|
|
353
|
-
* We use `mkdocs` to update the docs. You can run the
|
461
|
+
* We use `mkdocs` to update the docs. You can run the docs locally at http://127.0.0.1:8000/.
|
354
462
|
|
355
463
|
```
|
356
464
|
uv run python3 -m mkdocs serve --clean
|