versionhq 1.1.13.0__tar.gz → 1.1.13.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.1.13.1}/.github/workflows/run_tests.yml +1 -1
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/PKG-INFO +144 -32
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/README.md +137 -31
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/docs/core/Agent.md +57 -4
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/docs/index.md +178 -103
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/docs/quickstart.md +13 -49
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/mkdocs.yml +6 -13
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/pyproject.toml +12 -6
- versionhq-1.1.13.1/requirements-dev.txt +14 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/requirements.txt +0 -6
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/__init__.py +16 -1
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/agent/model.py +90 -38
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/llm/llm_vars.py +0 -1
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/llm/model.py +1 -1
- {versionhq-1.1.13.0/src/versionhq/storage → versionhq-1.1.13.1/src/versionhq/network}/__init__.py +0 -0
- versionhq-1.1.13.1/src/versionhq/network/model.py +394 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq.egg-info/PKG-INFO +144 -32
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq.egg-info/SOURCES.txt +7 -1
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq.egg-info/requires.txt +9 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/tests/agent/agent_test.py +17 -3
- versionhq-1.1.13.1/tests/agent/doc_test.py +227 -0
- {versionhq-1.1.13.0/tests/knowledge → versionhq-1.1.13.1/tests/cli}/__init__.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/tests/doc_test.py +1 -195
- {versionhq-1.1.13.0/tests/llm → versionhq-1.1.13.1/tests/knowledge}/__init__.py +0 -0
- {versionhq-1.1.13.0/tests/memory → versionhq-1.1.13.1/tests/llm}/__init__.py +0 -0
- {versionhq-1.1.13.0/tests/team → versionhq-1.1.13.1/tests/memory}/__init__.py +0 -0
- {versionhq-1.1.13.0/tests/tool → versionhq-1.1.13.1/tests/network}/__init__.py +0 -0
- versionhq-1.1.13.1/tests/network/doc_test.py +31 -0
- versionhq-1.1.13.1/tests/network/network_test.py +0 -0
- versionhq-1.1.13.1/tests/team/__init__.py +0 -0
- versionhq-1.1.13.1/tests/tool/__init__.py +0 -0
- versionhq-1.1.13.1/tests/usecase_test.py +57 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.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 → versionhq-1.1.13.1}/.github/workflows/deploy_docs.yml +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/.github/workflows/publish.yml +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/.github/workflows/publish_testpypi.yml +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/.github/workflows/security_check.yml +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/.gitignore +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/.pre-commit-config.yaml +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/.python-version +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/LICENSE +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/SECURITY.md +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/db/preprocess.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/docs/CNAME +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/docs/_logos/favicon.ico +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/docs/_logos/logo192.png +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/docs/core/tool.md +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/docs/stylesheets/main.css +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/runtime.txt +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/setup.cfg +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/_utils/__init__.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/_utils/i18n.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/_utils/logger.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/_utils/process_config.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/_utils/usage_metrics.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/_utils/vars.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/agent/TEMPLATES/Backstory.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/agent/TEMPLATES/__init__.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/agent/__init__.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/agent/inhouse_agents.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/agent/parser.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/agent/rpm_controller.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/cli/__init__.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/clients/__init__.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/clients/customer/__init__.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/clients/customer/model.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/clients/product/__init__.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/clients/product/model.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/clients/workflow/__init__.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/clients/workflow/model.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/knowledge/__init__.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/knowledge/_utils.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/knowledge/embedding.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/knowledge/model.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/knowledge/source.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/knowledge/source_docling.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/knowledge/storage.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/llm/__init__.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/memory/__init__.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/memory/contextual_memory.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/memory/model.py +0 -0
- {versionhq-1.1.13.0/src/versionhq/task → versionhq-1.1.13.1/src/versionhq/storage}/__init__.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/storage/base.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/storage/ltm_sqlite_storage.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/storage/mem0_storage.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/storage/rag_storage.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/storage/task_output_storage.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/storage/utils.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/task/TEMPLATES/Description.py +0 -0
- {versionhq-1.1.13.0/src/versionhq/team → versionhq-1.1.13.1/src/versionhq/task}/__init__.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/task/evaluate.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/task/formation.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/task/formatter.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/task/log_handler.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/task/model.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/task/structured_response.py +0 -0
- {versionhq-1.1.13.0/src/versionhq/tool → versionhq-1.1.13.1/src/versionhq/team}/__init__.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/team/model.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/team/team_planner.py +0 -0
- {versionhq-1.1.13.0/tests → versionhq-1.1.13.1/src/versionhq/tool}/__init__.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/tool/cache_handler.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/tool/composio_tool.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/tool/composio_tool_vars.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/tool/decorator.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/tool/model.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq/tool/tool_handler.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq.egg-info/dependency_links.txt +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/src/versionhq.egg-info/top_level.txt +0 -0
- {versionhq-1.1.13.0/tests/agent → versionhq-1.1.13.1/tests}/__init__.py +0 -0
- {versionhq-1.1.13.0/tests/cli → versionhq-1.1.13.1/tests/agent}/__init__.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/tests/clients/customer_test.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/tests/clients/product_test.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/tests/clients/workflow_test.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/tests/conftest.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/tests/formation_test.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/tests/knowledge/knowledge_test.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/tests/knowledge/mock_report_compressed.pdf +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/tests/llm/llm_test.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/tests/memory/memory_test.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/tests/task/__init__.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/tests/task/llm_connection_test.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/tests/task/task_test.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/tests/team/Prompts/Demo_test.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/tests/team/team_test.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.1}/tests/tool/composio_test.py +0 -0
- {versionhq-1.1.13.0 → versionhq-1.1.13.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.1.13.
|
3
|
+
Version: 1.1.13.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,6 +74,12 @@ 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
|
|
@@ -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
|
@@ -253,21 +332,29 @@ Tasks can be delegated to a team manager, peers in the team, or completely new a
|
|
253
332
|
|
254
333
|
## Technologies Used
|
255
334
|
|
335
|
+
**Graph Theory (Analysis and Visualization)**
|
336
|
+
|
337
|
+
* [NetworkX](https://networkx.org/documentation/stable/reference/introduction.html): A Python package to analyze, create, and manipulate complex graph networks.
|
338
|
+
* [Matplotlib](https://matplotlib.org/stable/index.html): Visualization library
|
339
|
+
* [Graphviz](https://graphviz.org/about/): Graph visualization software
|
340
|
+
|
341
|
+
|
256
342
|
**Schema, Data Validation**
|
257
343
|
|
258
344
|
* [Pydantic](https://docs.pydantic.dev/latest/): Data validation and serialization library for Python.
|
259
345
|
* [Upstage](https://console.upstage.ai/docs/getting-started/overview): Document processer for ML tasks. (Use `Document Parser API` to extract data from documents)
|
260
346
|
* [Docling](https://ds4sd.github.io/docling/): Document parsing
|
261
347
|
|
348
|
+
|
262
349
|
**Storage**
|
263
350
|
|
264
351
|
* [mem0ai](https://docs.mem0.ai/quickstart#install-package): Agents' memory storage and management.
|
265
352
|
* [Chroma DB](https://docs.trychroma.com/): Vector database for storing and querying usage data.
|
266
353
|
* [SQLite](https://www.sqlite.org/docs.html): C-language library to implements a small SQL database engine.
|
267
354
|
|
268
|
-
**LLM
|
355
|
+
**LLM Integration**
|
269
356
|
|
270
|
-
* [LiteLLM](https://docs.litellm.ai/docs/providers):
|
357
|
+
* [LiteLLM](https://docs.litellm.ai/docs/providers): Integration to diverse LLMs
|
271
358
|
|
272
359
|
**Tools**
|
273
360
|
|
@@ -304,30 +391,30 @@ 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
|
308
395
|
|
309
396
|
```
|
310
397
|
|
311
398
|
<hr />
|
312
399
|
|
313
|
-
## Setting Up
|
400
|
+
## Setting Up a Project
|
314
401
|
|
315
|
-
1.
|
402
|
+
### 1. Installing package manager
|
316
403
|
|
317
|
-
|
404
|
+
For MacOS:
|
318
405
|
|
319
|
-
|
320
|
-
|
321
|
-
|
406
|
+
```
|
407
|
+
brew install uv
|
408
|
+
```
|
322
409
|
|
323
|
-
|
410
|
+
For Ubuntu/Debian:
|
411
|
+
```
|
412
|
+
sudo apt-get install uv
|
413
|
+
```
|
324
414
|
|
325
|
-
```
|
326
|
-
sudo apt-get install uv
|
327
|
-
```
|
328
415
|
|
416
|
+
### 2. Installing dependencies
|
329
417
|
|
330
|
-
2. Install dependencies:
|
331
418
|
```
|
332
419
|
uv venv
|
333
420
|
source .venv/bin/activate
|
@@ -335,29 +422,51 @@ src/
|
|
335
422
|
uv sync --all-extras
|
336
423
|
```
|
337
424
|
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
425
|
+
- AssertionError/module mismatch errors: Set up default Python version using `.pyenv`
|
426
|
+
```
|
427
|
+
pyenv install 3.12.8
|
428
|
+
pyenv global 3.12.8 (optional: `pyenv global system` to get back to the system default ver.)
|
429
|
+
uv python pin 3.12.8
|
430
|
+
echo 3.12.8 >> .python-version
|
431
|
+
```
|
345
432
|
|
433
|
+
- `pygraphviz` related errors: Run the following commands:
|
434
|
+
```
|
435
|
+
brew install graphviz
|
436
|
+
uv pip install --config-settings="--global-option=build_ext" \
|
437
|
+
--config-settings="--global-option=-I$(brew --prefix graphviz)/include/" \
|
438
|
+
--config-settings="--global-option=-L$(brew --prefix graphviz)/lib/" \
|
439
|
+
pygraphviz
|
440
|
+
```
|
441
|
+
|
442
|
+
* If the error continues, skip pygraphviz installation by:
|
443
|
+
```
|
444
|
+
uv sync --all-extras --no-extra pygraphviz
|
445
|
+
```
|
446
|
+
|
447
|
+
- `torch`/`Docling` related errors: Set up default Python version either `3.11.x` or `3.12.x` (same as AssertionError)
|
448
|
+
|
449
|
+
### 3. Adding env secrets to .env file
|
346
450
|
|
347
|
-
|
451
|
+
Create `.env` file in the project root and add following:
|
348
452
|
|
349
453
|
```
|
350
|
-
LITELLM_API_KEY=your-litellm-api-key
|
351
454
|
OPENAI_API_KEY=your-openai-api-key
|
455
|
+
GEMINI_API_KEY=your-gemini-api-key
|
456
|
+
LITELLM_API_KEY=your-litellm-api-key
|
352
457
|
COMPOSIO_API_KEY=your-composio-api-key
|
353
458
|
COMPOSIO_CLI_KEY=your-composio-cli-key
|
354
|
-
[
|
459
|
+
[OTHER_LLM_INTERFACE_PROVIDER_OF_YOUR_CHOICE]_API_KEY=your-api-key
|
355
460
|
```
|
356
461
|
|
357
462
|
<hr />
|
358
463
|
|
359
464
|
## Contributing
|
360
465
|
|
466
|
+
`versionhq` is a open source project.
|
467
|
+
|
468
|
+
### Steps
|
469
|
+
|
361
470
|
1. Create your feature branch (`git checkout -b feature/your-amazing-feature`)
|
362
471
|
|
363
472
|
2. Create amazing features
|
@@ -365,6 +474,7 @@ src/
|
|
365
474
|
3. Add a test funcition to the `tests` directory and run **pytest**.
|
366
475
|
|
367
476
|
- Add secret values defined in `.github/workflows/run_test.yml` to your Github `repository secrets` located at settings > secrets & variables > Actions.
|
477
|
+
|
368
478
|
- Run a following command:
|
369
479
|
```
|
370
480
|
uv run pytest tests -vv --cache-clear
|
@@ -376,6 +486,8 @@ src/
|
|
376
486
|
|
377
487
|
* Test functions within the files must begin with `test_`.
|
378
488
|
|
489
|
+
* Pytest priorities are `1. playground demo > 2. docs use cases > 3. other features`
|
490
|
+
|
379
491
|
|
380
492
|
4. Update `docs` accordingly.
|
381
493
|
|
@@ -418,7 +530,7 @@ src/
|
|
418
530
|
|
419
531
|
Pre-commit hooks help maintain code quality by running checks for formatting, linting, and other issues before each commit.
|
420
532
|
|
421
|
-
* To skip pre-commit hooks
|
533
|
+
* To skip pre-commit hooks
|
422
534
|
```
|
423
535
|
git commit --no-verify -m "your-commit-message"
|
424
536
|
```
|
@@ -427,7 +539,7 @@ Pre-commit hooks help maintain code quality by running checks for formatting, li
|
|
427
539
|
|
428
540
|
* To edit the documentation, see `docs` repository and edit the respective component.
|
429
541
|
|
430
|
-
* We use `mkdocs` to update the docs. You can run the
|
542
|
+
* We use `mkdocs` to update the docs. You can run the docs locally at http://127.0.0.1:8000/.
|
431
543
|
|
432
544
|
```
|
433
545
|
uv run python3 -m mkdocs serve --clean
|
@@ -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
|
@@ -176,21 +249,29 @@ Tasks can be delegated to a team manager, peers in the team, or completely new a
|
|
176
249
|
|
177
250
|
## Technologies Used
|
178
251
|
|
252
|
+
**Graph Theory (Analysis and Visualization)**
|
253
|
+
|
254
|
+
* [NetworkX](https://networkx.org/documentation/stable/reference/introduction.html): A Python package to analyze, create, and manipulate complex graph networks.
|
255
|
+
* [Matplotlib](https://matplotlib.org/stable/index.html): Visualization library
|
256
|
+
* [Graphviz](https://graphviz.org/about/): Graph visualization software
|
257
|
+
|
258
|
+
|
179
259
|
**Schema, Data Validation**
|
180
260
|
|
181
261
|
* [Pydantic](https://docs.pydantic.dev/latest/): Data validation and serialization library for Python.
|
182
262
|
* [Upstage](https://console.upstage.ai/docs/getting-started/overview): Document processer for ML tasks. (Use `Document Parser API` to extract data from documents)
|
183
263
|
* [Docling](https://ds4sd.github.io/docling/): Document parsing
|
184
264
|
|
265
|
+
|
185
266
|
**Storage**
|
186
267
|
|
187
268
|
* [mem0ai](https://docs.mem0.ai/quickstart#install-package): Agents' memory storage and management.
|
188
269
|
* [Chroma DB](https://docs.trychroma.com/): Vector database for storing and querying usage data.
|
189
270
|
* [SQLite](https://www.sqlite.org/docs.html): C-language library to implements a small SQL database engine.
|
190
271
|
|
191
|
-
**LLM
|
272
|
+
**LLM Integration**
|
192
273
|
|
193
|
-
* [LiteLLM](https://docs.litellm.ai/docs/providers):
|
274
|
+
* [LiteLLM](https://docs.litellm.ai/docs/providers): Integration to diverse LLMs
|
194
275
|
|
195
276
|
**Tools**
|
196
277
|
|
@@ -227,30 +308,30 @@ 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
|
231
312
|
|
232
313
|
```
|
233
314
|
|
234
315
|
<hr />
|
235
316
|
|
236
|
-
## Setting Up
|
317
|
+
## Setting Up a Project
|
237
318
|
|
238
|
-
1.
|
319
|
+
### 1. Installing package manager
|
239
320
|
|
240
|
-
|
321
|
+
For MacOS:
|
241
322
|
|
242
|
-
|
243
|
-
|
244
|
-
|
323
|
+
```
|
324
|
+
brew install uv
|
325
|
+
```
|
245
326
|
|
246
|
-
|
327
|
+
For Ubuntu/Debian:
|
328
|
+
```
|
329
|
+
sudo apt-get install uv
|
330
|
+
```
|
247
331
|
|
248
|
-
```
|
249
|
-
sudo apt-get install uv
|
250
|
-
```
|
251
332
|
|
333
|
+
### 2. Installing dependencies
|
252
334
|
|
253
|
-
2. Install dependencies:
|
254
335
|
```
|
255
336
|
uv venv
|
256
337
|
source .venv/bin/activate
|
@@ -258,29 +339,51 @@ src/
|
|
258
339
|
uv sync --all-extras
|
259
340
|
```
|
260
341
|
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
342
|
+
- AssertionError/module mismatch errors: Set up default Python version using `.pyenv`
|
343
|
+
```
|
344
|
+
pyenv install 3.12.8
|
345
|
+
pyenv global 3.12.8 (optional: `pyenv global system` to get back to the system default ver.)
|
346
|
+
uv python pin 3.12.8
|
347
|
+
echo 3.12.8 >> .python-version
|
348
|
+
```
|
268
349
|
|
350
|
+
- `pygraphviz` related errors: Run the following commands:
|
351
|
+
```
|
352
|
+
brew install graphviz
|
353
|
+
uv pip install --config-settings="--global-option=build_ext" \
|
354
|
+
--config-settings="--global-option=-I$(brew --prefix graphviz)/include/" \
|
355
|
+
--config-settings="--global-option=-L$(brew --prefix graphviz)/lib/" \
|
356
|
+
pygraphviz
|
357
|
+
```
|
358
|
+
|
359
|
+
* If the error continues, skip pygraphviz installation by:
|
360
|
+
```
|
361
|
+
uv sync --all-extras --no-extra pygraphviz
|
362
|
+
```
|
363
|
+
|
364
|
+
- `torch`/`Docling` related errors: Set up default Python version either `3.11.x` or `3.12.x` (same as AssertionError)
|
365
|
+
|
366
|
+
### 3. Adding env secrets to .env file
|
269
367
|
|
270
|
-
|
368
|
+
Create `.env` file in the project root and add following:
|
271
369
|
|
272
370
|
```
|
273
|
-
LITELLM_API_KEY=your-litellm-api-key
|
274
371
|
OPENAI_API_KEY=your-openai-api-key
|
372
|
+
GEMINI_API_KEY=your-gemini-api-key
|
373
|
+
LITELLM_API_KEY=your-litellm-api-key
|
275
374
|
COMPOSIO_API_KEY=your-composio-api-key
|
276
375
|
COMPOSIO_CLI_KEY=your-composio-cli-key
|
277
|
-
[
|
376
|
+
[OTHER_LLM_INTERFACE_PROVIDER_OF_YOUR_CHOICE]_API_KEY=your-api-key
|
278
377
|
```
|
279
378
|
|
280
379
|
<hr />
|
281
380
|
|
282
381
|
## Contributing
|
283
382
|
|
383
|
+
`versionhq` is a open source project.
|
384
|
+
|
385
|
+
### Steps
|
386
|
+
|
284
387
|
1. Create your feature branch (`git checkout -b feature/your-amazing-feature`)
|
285
388
|
|
286
389
|
2. Create amazing features
|
@@ -288,6 +391,7 @@ src/
|
|
288
391
|
3. Add a test funcition to the `tests` directory and run **pytest**.
|
289
392
|
|
290
393
|
- Add secret values defined in `.github/workflows/run_test.yml` to your Github `repository secrets` located at settings > secrets & variables > Actions.
|
394
|
+
|
291
395
|
- Run a following command:
|
292
396
|
```
|
293
397
|
uv run pytest tests -vv --cache-clear
|
@@ -299,6 +403,8 @@ src/
|
|
299
403
|
|
300
404
|
* Test functions within the files must begin with `test_`.
|
301
405
|
|
406
|
+
* Pytest priorities are `1. playground demo > 2. docs use cases > 3. other features`
|
407
|
+
|
302
408
|
|
303
409
|
4. Update `docs` accordingly.
|
304
410
|
|
@@ -341,7 +447,7 @@ src/
|
|
341
447
|
|
342
448
|
Pre-commit hooks help maintain code quality by running checks for formatting, linting, and other issues before each commit.
|
343
449
|
|
344
|
-
* To skip pre-commit hooks
|
450
|
+
* To skip pre-commit hooks
|
345
451
|
```
|
346
452
|
git commit --no-verify -m "your-commit-message"
|
347
453
|
```
|
@@ -350,7 +456,7 @@ Pre-commit hooks help maintain code quality by running checks for formatting, li
|
|
350
456
|
|
351
457
|
* To edit the documentation, see `docs` repository and edit the respective component.
|
352
458
|
|
353
|
-
* We use `mkdocs` to update the docs. You can run the
|
459
|
+
* We use `mkdocs` to update the docs. You can run the docs locally at http://127.0.0.1:8000/.
|
354
460
|
|
355
461
|
```
|
356
462
|
uv run python3 -m mkdocs serve --clean
|
@@ -33,7 +33,7 @@ agent = vhq.Agent(
|
|
33
33
|
|
34
34
|
### Model optimization
|
35
35
|
|
36
|
-
`[var]`<bold>`llm: Optional[str | LLM | Dict[str, Any]] = "gpt-4o"
|
36
|
+
`[var]`<bold>`llm: Optional[str | LLM | Dict[str, Any]] = "gpt-4o"`</bold>
|
37
37
|
|
38
38
|
You can select a model or model provider that the agent will run on.
|
39
39
|
|
@@ -49,10 +49,31 @@ agent = vhq.Agent(
|
|
49
49
|
)
|
50
50
|
```
|
51
51
|
|
52
|
+
### Switching models
|
53
|
+
|
54
|
+
`[class method]`<bold>`update_llm(self, llm: Any = None, llm_config: Optional[Dict[str, Any]] = None) -> Self`<bold>
|
55
|
+
|
56
|
+
You can update LLM model and its configuration of the existing agent.
|
57
|
+
|
58
|
+
```python
|
59
|
+
import versionhq as vhq
|
60
|
+
|
61
|
+
agent = vhq.Agent(
|
62
|
+
role="Marketing Analyst",
|
63
|
+
goal="Coping with price competition in saturated markets",
|
64
|
+
llm="gemini-2.0"
|
65
|
+
)
|
66
|
+
|
67
|
+
agent.update_llm(llm="deepseek", llm_config=dict(max_tokens=3000))
|
68
|
+
assert "deepseek-r1" in agent.llm.model
|
69
|
+
assert agent.llm.max_tokens == 3000
|
70
|
+
```
|
71
|
+
|
72
|
+
<hr/>
|
52
73
|
|
53
74
|
### Developer Prompt (System Prompt)
|
54
75
|
|
55
|
-
`[var]`<bold>`backstory: Optional[str] = TEMPLATE_BACKSTORY
|
76
|
+
`[var]`<bold>`backstory: Optional[str] = TEMPLATE_BACKSTORY`<bold>
|
56
77
|
|
57
78
|
Backstory will be drafted automatically using the given role, goal and other values in the Agent model, and converted into the **developer prompt** when the agent executes the task.
|
58
79
|
|
@@ -352,7 +373,7 @@ assert "gold" in res.raw == True
|
|
352
373
|
|
353
374
|
* Reference: <bold>`Knowledge` class</bold>
|
354
375
|
|
355
|
-
|
376
|
+
<hr />
|
356
377
|
|
357
378
|
## Memory
|
358
379
|
|
@@ -425,7 +446,39 @@ import versionhq as vhq
|
|
425
446
|
|
426
447
|
agent = vhq.Agent(
|
427
448
|
role="Marketing Analyst",
|
428
|
-
goal="Coping with
|
449
|
+
goal="Coping with price competition in saturated markets.",
|
450
|
+
)
|
451
|
+
```
|
452
|
+
|
453
|
+
<hr />
|
454
|
+
|
455
|
+
### Updating model values
|
456
|
+
|
457
|
+
`[class method]`<bold>`update(self, **kwargs) -> Self`</bold>
|
458
|
+
|
459
|
+
You can update values of exsiting agents using `update` class method.
|
460
|
+
|
461
|
+
This class method will safely trigger some setups that needs to be run before the agent start executing tasks.
|
462
|
+
|
463
|
+
|
464
|
+
```python
|
465
|
+
import versionhq as vhq
|
466
|
+
|
467
|
+
agent = vhq.Agent(
|
468
|
+
role="Marketing Analyst",
|
469
|
+
goal="Coping with price competition in saturated markets"
|
470
|
+
)
|
471
|
+
|
472
|
+
tool = vhq.Tool(func=lambda x: x)
|
473
|
+
agent.update(
|
474
|
+
tools=[tool],
|
475
|
+
goal="my new goal", # updating the goal (this will trigger updating the developer_prompt.)
|
476
|
+
max_rpm=3,
|
477
|
+
knowledge_sources=["testing", "testing2"], # adding knowledge sources (this will trigger the storage creation.)
|
478
|
+
memory_config={"user_id": "0000"},
|
479
|
+
llm="gemini-2.0", # Updating model (The valid llm_config for the new model will be inherited.)
|
480
|
+
use_developer_prompt=False,
|
481
|
+
dummy="I am dummy" # <- Invalid field will be automatically ignored.
|
429
482
|
)
|
430
483
|
```
|
431
484
|
|