versionhq 1.1.12.5__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.12.5 → versionhq-1.1.13.1}/.github/workflows/run_tests.yml +1 -1
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/.gitignore +4 -4
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/PKG-INFO +232 -130
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/README.md +223 -127
- versionhq-1.1.13.1/docs/_logos/favicon.ico +0 -0
- versionhq-1.1.13.1/docs/_logos/logo192.png +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/docs/core/Agent.md +177 -126
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/docs/core/tool.md +7 -9
- versionhq-1.1.13.1/docs/index.md +346 -0
- versionhq-1.1.13.1/docs/quickstart.md +116 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/mkdocs.yml +9 -16
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/pyproject.toml +13 -5
- versionhq-1.1.13.1/requirements-dev.txt +14 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/requirements.txt +0 -6
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/__init__.py +21 -3
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/_utils/usage_metrics.py +6 -6
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/agent/inhouse_agents.py +1 -1
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/agent/model.py +90 -38
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/llm/llm_vars.py +5 -1
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/llm/model.py +1 -1
- {versionhq-1.1.12.5/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.12.5 → versionhq-1.1.13.1}/src/versionhq/task/evaluate.py +5 -6
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/task/formation.py +64 -30
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/task/model.py +2 -5
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/team/model.py +95 -92
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/team/team_planner.py +5 -6
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq.egg-info/PKG-INFO +232 -130
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq.egg-info/SOURCES.txt +8 -1
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq.egg-info/requires.txt +9 -0
- {versionhq-1.1.12.5 → 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.12.5/tests/knowledge → versionhq-1.1.13.1/tests/cli}/__init__.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/tests/clients/customer_test.py +0 -4
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/tests/clients/workflow_test.py +0 -2
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/tests/doc_test.py +7 -201
- versionhq-1.1.13.1/tests/formation_test.py +48 -0
- {versionhq-1.1.12.5/tests/llm → versionhq-1.1.13.1/tests/knowledge}/__init__.py +0 -0
- {versionhq-1.1.12.5/tests/memory → versionhq-1.1.13.1/tests/llm}/__init__.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/tests/llm/llm_test.py +0 -3
- {versionhq-1.1.12.5/tests/team → versionhq-1.1.13.1/tests/memory}/__init__.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/tests/memory/memory_test.py +0 -5
- {versionhq-1.1.12.5/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.12.5 → versionhq-1.1.13.1}/tests/task/llm_connection_test.py +6 -6
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/tests/task/task_test.py +2 -18
- versionhq-1.1.13.1/tests/team/__init__.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/tests/team/team_test.py +50 -69
- 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.12.5 → versionhq-1.1.13.1}/uv.lock +254 -588
- versionhq-1.1.12.5/CNAME +0 -1
- versionhq-1.1.12.5/docs/_logos/favicon.ico +0 -0
- versionhq-1.1.12.5/docs/_logos/logo192.png +0 -0
- versionhq-1.1.12.5/docs/index.md +0 -379
- versionhq-1.1.12.5/docs/quickstart.md +0 -122
- versionhq-1.1.12.5/requirements-dev.txt +0 -9
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/.github/workflows/deploy_docs.yml +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/.github/workflows/publish.yml +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/.github/workflows/publish_testpypi.yml +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/.github/workflows/security_check.yml +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/.pre-commit-config.yaml +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/.python-version +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/LICENSE +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/SECURITY.md +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/db/preprocess.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/docs/CNAME +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/docs/stylesheets/main.css +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/runtime.txt +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/setup.cfg +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/_utils/__init__.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/_utils/i18n.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/_utils/logger.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/_utils/process_config.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/_utils/vars.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/agent/TEMPLATES/Backstory.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/agent/TEMPLATES/__init__.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/agent/__init__.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/agent/parser.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/agent/rpm_controller.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/cli/__init__.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/clients/__init__.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/clients/customer/__init__.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/clients/customer/model.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/clients/product/__init__.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/clients/product/model.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/clients/workflow/__init__.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/clients/workflow/model.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/knowledge/__init__.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/knowledge/_utils.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/knowledge/embedding.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/knowledge/model.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/knowledge/source.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/knowledge/source_docling.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/knowledge/storage.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/llm/__init__.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/memory/__init__.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/memory/contextual_memory.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/memory/model.py +0 -0
- {versionhq-1.1.12.5/src/versionhq/task → versionhq-1.1.13.1/src/versionhq/storage}/__init__.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/storage/base.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/storage/ltm_sqlite_storage.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/storage/mem0_storage.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/storage/rag_storage.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/storage/task_output_storage.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/storage/utils.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/task/TEMPLATES/Description.py +0 -0
- {versionhq-1.1.12.5/src/versionhq/team → versionhq-1.1.13.1/src/versionhq/task}/__init__.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/task/formatter.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/task/log_handler.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/task/structured_response.py +0 -0
- {versionhq-1.1.12.5/src/versionhq/tool → versionhq-1.1.13.1/src/versionhq/team}/__init__.py +0 -0
- {versionhq-1.1.12.5/tests → versionhq-1.1.13.1/src/versionhq/tool}/__init__.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/tool/cache_handler.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/tool/composio_tool.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/tool/composio_tool_vars.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/tool/decorator.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/tool/model.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq/tool/tool_handler.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq.egg-info/dependency_links.txt +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/src/versionhq.egg-info/top_level.txt +0 -0
- {versionhq-1.1.12.5/tests/agent → versionhq-1.1.13.1/tests}/__init__.py +0 -0
- {versionhq-1.1.12.5/tests/cli → versionhq-1.1.13.1/tests/agent}/__init__.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/tests/clients/product_test.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/tests/conftest.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/tests/knowledge/knowledge_test.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/tests/knowledge/mock_report_compressed.pdf +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/tests/task/__init__.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/tests/team/Prompts/Demo_test.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/tests/tool/composio_test.py +0 -0
- {versionhq-1.1.12.5 → versionhq-1.1.13.1}/tests/tool/tool_test.py +0 -0
@@ -1,7 +1,7 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: versionhq
|
3
|
-
Version: 1.1.
|
4
|
-
Summary: An agentic orchestration framework for building agent networks that handle task automation
|
3
|
+
Version: 1.1.13.1
|
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
|
7
7
|
|
@@ -40,7 +40,7 @@ Classifier: Development Status :: 3 - Alpha
|
|
40
40
|
Classifier: Intended Audience :: Developers
|
41
41
|
Classifier: Intended Audience :: Information Technology
|
42
42
|
Classifier: Topic :: Software Development :: Build Tools
|
43
|
-
Requires-Python:
|
43
|
+
Requires-Python: <3.13,>=3.11
|
44
44
|
Description-Content-Type: text/markdown
|
45
45
|
License-File: LICENSE
|
46
46
|
Requires-Dist: regex==2024.11.6
|
@@ -74,10 +74,16 @@ 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
89
|

|
@@ -85,7 +91,7 @@ Requires-Dist: numpy>=1.26.4; extra == "numpy"
|
|
85
91
|

|
86
92
|
|
87
93
|
|
88
|
-
|
94
|
+
A Python framework for agentic orchestration that handles complex task automation without human interaction.
|
89
95
|
|
90
96
|
**Visit:**
|
91
97
|
|
@@ -103,20 +109,24 @@ Agentic orchestration framework to deploy agent network and handle complex task
|
|
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
|
-
- [
|
108
|
-
- [
|
109
|
-
- [
|
110
|
-
- [Supervising
|
115
|
+
- [Package installation](#package-installation)
|
116
|
+
- [Forming a agent network](#forming-a-agent-network)
|
117
|
+
- [Executing tasks](#executing-tasks)
|
118
|
+
- [Supervising](#supervising)
|
111
119
|
- [Technologies Used](#technologies-used)
|
112
120
|
- [Project Structure](#project-structure)
|
113
|
-
- [
|
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)
|
115
|
-
- [
|
116
|
-
- [Customizing AI Agent](#customizing-ai-agent)
|
117
|
-
- [Modifying RAG Functionality](#modifying-rag-functionality)
|
126
|
+
- [Steps](#steps)
|
118
127
|
- [Package Management with uv](#package-management-with-uv)
|
119
128
|
- [Pre-Commit Hooks](#pre-commit-hooks)
|
129
|
+
- [Documentation](#documentation)
|
120
130
|
- [Trouble Shooting](#trouble-shooting)
|
121
131
|
- [Frequently Asked Questions (FAQ)](#frequently-asked-questions-faq)
|
122
132
|
|
@@ -146,22 +156,89 @@ You can specify a desired formation or allow the agents to determine it autonomo
|
|
146
156
|
|
147
157
|
<hr />
|
148
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
|
+
|
149
226
|
## Quick Start
|
150
227
|
|
151
|
-
|
228
|
+
### Package installation
|
152
229
|
|
153
230
|
```
|
154
231
|
pip install versionhq
|
155
232
|
```
|
156
233
|
|
157
|
-
(Python 3.11
|
234
|
+
(Python 3.11 / 3.12)
|
158
235
|
|
159
|
-
###
|
236
|
+
### Forming a agent network
|
160
237
|
|
161
238
|
```python
|
162
|
-
|
239
|
+
import versionhq as vhq
|
163
240
|
|
164
|
-
network = form_agent_network(
|
241
|
+
network = vhq.form_agent_network(
|
165
242
|
task="YOUR AMAZING TASK OVERVIEW",
|
166
243
|
expected_outcome="YOUR OUTCOME EXPECTATION",
|
167
244
|
)
|
@@ -171,31 +248,28 @@ You can specify a desired formation or allow the agents to determine it autonomo
|
|
171
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.
|
172
249
|
|
173
250
|
|
174
|
-
###
|
251
|
+
### Executing tasks
|
175
252
|
|
176
|
-
|
253
|
+
You can simply build an agent using `Agent` model and execute the task using `Task` class.
|
177
254
|
|
178
|
-
|
255
|
+
By default, agents prioritize JSON over plane text outputs.
|
179
256
|
|
180
|
-
By default, the agent prioritize JSON serializable output.
|
181
|
-
|
182
|
-
But you can add a plane text summary of the structured output by using callbacks.
|
183
257
|
|
184
258
|
```python
|
259
|
+
import versionhq as vhq
|
185
260
|
from pydantic import BaseModel
|
186
|
-
from versionhq import Agent, Task
|
187
261
|
|
188
262
|
class CustomOutput(BaseModel):
|
189
263
|
test1: str
|
190
264
|
test2: list[str]
|
191
265
|
|
192
266
|
def dummy_func(message: str, test1: str, test2: list[str]) -> str:
|
193
|
-
return f"{message}: {test1}, {", ".join(test2)}"
|
267
|
+
return f"""{message}: {test1}, {", ".join(test2)}"""
|
194
268
|
|
195
269
|
|
196
|
-
agent = Agent(role="demo", goal="amazing project goal")
|
270
|
+
agent = vhq.Agent(role="demo", goal="amazing project goal")
|
197
271
|
|
198
|
-
task = Task(
|
272
|
+
task = vhq.Task(
|
199
273
|
description="Amazing task",
|
200
274
|
pydantic_output=CustomOutput,
|
201
275
|
callback=dummy_func,
|
@@ -221,33 +295,33 @@ This will return a `TaskOutput` object that stores response in plane text, JSON,
|
|
221
295
|
)
|
222
296
|
```
|
223
297
|
|
224
|
-
### Supervising
|
298
|
+
### Supervising
|
225
299
|
|
226
300
|
```python
|
227
|
-
|
301
|
+
import versionhq as vhq
|
228
302
|
|
229
|
-
agent_a = Agent(role="agent a", goal="My amazing goals", llm="llm-of-your-choice")
|
230
|
-
agent_b = Agent(role="agent b", goal="My amazing goals", llm="llm-of-your-choice")
|
303
|
+
agent_a = vhq.Agent(role="agent a", goal="My amazing goals", llm="llm-of-your-choice")
|
304
|
+
agent_b = vhq.Agent(role="agent b", goal="My amazing goals", llm="llm-of-your-choice")
|
231
305
|
|
232
|
-
task_1 = Task(
|
306
|
+
task_1 = vhq.Task(
|
233
307
|
description="Analyze the client's business model.",
|
234
|
-
response_fields=[ResponseField(title="test1", data_type=str, required=True),],
|
308
|
+
response_fields=[vhq.ResponseField(title="test1", data_type=str, required=True),],
|
235
309
|
allow_delegation=True
|
236
310
|
)
|
237
311
|
|
238
|
-
task_2 = Task(
|
312
|
+
task_2 = vhq.Task(
|
239
313
|
description="Define the cohort.",
|
240
314
|
response_fields=[ResponseField(title="test1", data_type=int, required=True),],
|
241
315
|
allow_delegation=False
|
242
316
|
)
|
243
317
|
|
244
|
-
team = Team(
|
318
|
+
team = vhq.Team(
|
245
319
|
members=[
|
246
|
-
|
247
|
-
|
320
|
+
vhq.Member(agent=agent_a, is_manager=False, task=task_1),
|
321
|
+
vhq.Member(agent=agent_b, is_manager=True, task=task_2),
|
248
322
|
],
|
249
323
|
)
|
250
|
-
res = team.
|
324
|
+
res = team.launch()
|
251
325
|
```
|
252
326
|
|
253
327
|
This will return a list with dictionaries with keys defined in the `ResponseField` of each task.
|
@@ -257,27 +331,41 @@ Tasks can be delegated to a team manager, peers in the team, or completely new a
|
|
257
331
|
<hr />
|
258
332
|
|
259
333
|
## Technologies Used
|
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
|
+
|
260
342
|
**Schema, Data Validation**
|
261
|
-
|
262
|
-
|
263
|
-
|
343
|
+
|
344
|
+
* [Pydantic](https://docs.pydantic.dev/latest/): Data validation and serialization library for Python.
|
345
|
+
* [Upstage](https://console.upstage.ai/docs/getting-started/overview): Document processer for ML tasks. (Use `Document Parser API` to extract data from documents)
|
346
|
+
* [Docling](https://ds4sd.github.io/docling/): Document parsing
|
347
|
+
|
264
348
|
|
265
349
|
**Storage**
|
266
|
-
- [mem0ai](https://docs.mem0.ai/quickstart#install-package): Agents' memory storage and management.
|
267
|
-
- [Chroma DB](https://docs.trychroma.com/): Vector database for storing and querying usage data.
|
268
|
-
- [SQLite](https://www.sqlite.org/docs.html): C-language library to implements a small SQL database engine.
|
269
350
|
|
270
|
-
|
271
|
-
|
351
|
+
* [mem0ai](https://docs.mem0.ai/quickstart#install-package): Agents' memory storage and management.
|
352
|
+
* [Chroma DB](https://docs.trychroma.com/): Vector database for storing and querying usage data.
|
353
|
+
* [SQLite](https://www.sqlite.org/docs.html): C-language library to implements a small SQL database engine.
|
354
|
+
|
355
|
+
**LLM Integration**
|
356
|
+
|
357
|
+
* [LiteLLM](https://docs.litellm.ai/docs/providers): Integration to diverse LLMs
|
272
358
|
|
273
359
|
**Tools**
|
274
|
-
|
360
|
+
|
361
|
+
* [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.
|
275
362
|
|
276
363
|
**Deployment**
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
364
|
+
|
365
|
+
* **Python**: Primary programming language. v3.12.x is recommended
|
366
|
+
* [uv](https://docs.astral.sh/uv/): Python package installer and resolver
|
367
|
+
* [pre-commit](https://pre-commit.com/): Manage and maintain pre-commit hooks
|
368
|
+
* [setuptools](https://pypi.org/project/setuptools/): Build python modules
|
281
369
|
|
282
370
|
<hr />
|
283
371
|
|
@@ -303,30 +391,30 @@ src/
|
|
303
391
|
│ └── llm/
|
304
392
|
│ └── ...
|
305
393
|
│
|
306
|
-
└── uploads/
|
394
|
+
└── uploads/ [.gitignore] # Local directory to store uploaded files such as graphviz diagrams generatd by `Network` class
|
307
395
|
|
308
396
|
```
|
309
397
|
|
310
398
|
<hr />
|
311
399
|
|
312
|
-
##
|
400
|
+
## Setting Up a Project
|
313
401
|
|
314
|
-
1.
|
402
|
+
### 1. Installing package manager
|
315
403
|
|
316
|
-
|
404
|
+
For MacOS:
|
317
405
|
|
318
|
-
|
319
|
-
|
320
|
-
|
406
|
+
```
|
407
|
+
brew install uv
|
408
|
+
```
|
321
409
|
|
322
|
-
|
410
|
+
For Ubuntu/Debian:
|
411
|
+
```
|
412
|
+
sudo apt-get install uv
|
413
|
+
```
|
323
414
|
|
324
|
-
```
|
325
|
-
sudo apt-get install uv
|
326
|
-
```
|
327
415
|
|
416
|
+
### 2. Installing dependencies
|
328
417
|
|
329
|
-
2. Install dependencies:
|
330
418
|
```
|
331
419
|
uv venv
|
332
420
|
source .venv/bin/activate
|
@@ -334,95 +422,89 @@ src/
|
|
334
422
|
uv sync --all-extras
|
335
423
|
```
|
336
424
|
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
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
|
+
```
|
344
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
|
450
|
+
|
451
|
+
Create `.env` file in the project root and add following:
|
345
452
|
|
346
|
-
3. Set up environment variables:
|
347
|
-
Create a `.env` file in the project root and add the following:
|
348
453
|
```
|
349
|
-
LITELLM_API_KEY=your-litellm-api-key
|
350
454
|
OPENAI_API_KEY=your-openai-api-key
|
455
|
+
GEMINI_API_KEY=your-gemini-api-key
|
456
|
+
LITELLM_API_KEY=your-litellm-api-key
|
351
457
|
COMPOSIO_API_KEY=your-composio-api-key
|
352
458
|
COMPOSIO_CLI_KEY=your-composio-cli-key
|
353
|
-
[
|
459
|
+
[OTHER_LLM_INTERFACE_PROVIDER_OF_YOUR_CHOICE]_API_KEY=your-api-key
|
354
460
|
```
|
355
461
|
|
356
462
|
<hr />
|
357
463
|
|
358
464
|
## Contributing
|
359
465
|
|
466
|
+
`versionhq` is a open source project.
|
467
|
+
|
468
|
+
### Steps
|
469
|
+
|
360
470
|
1. Create your feature branch (`git checkout -b feature/your-amazing-feature`)
|
361
471
|
|
362
472
|
2. Create amazing features
|
363
473
|
|
364
|
-
3.
|
474
|
+
3. Add a test funcition to the `tests` directory and run **pytest**.
|
475
|
+
|
476
|
+
- Add secret values defined in `.github/workflows/run_test.yml` to your Github `repository secrets` located at settings > secrets & variables > Actions.
|
365
477
|
|
366
|
-
-
|
367
|
-
- Add your `LITELLM_API_KEY`, `OPENAI_API_KEY`, `COMPOSIO_API_KEY`, `DEFAULT_USER_ID` to the Github `repository secrets` located at settings > secrets & variables > Actions.
|
368
|
-
- Run a test.
|
478
|
+
- Run a following command:
|
369
479
|
```
|
370
480
|
uv run pytest tests -vv --cache-clear
|
371
481
|
```
|
372
482
|
|
373
|
-
**pytest**
|
374
|
-
|
375
|
-
* When adding a new file to `tests`, name the file ended with `_test.py`.
|
376
|
-
* When adding a new feature to the file, name the feature started with `test_`.
|
377
|
-
|
378
|
-
4. Pull the latest version of source code from the main branch (`git pull origin main`) *Address conflicts if any.
|
379
|
-
5. Commit your changes (`git add .` / `git commit -m 'Add your-amazing-feature'`)
|
380
|
-
6. Push to the branch (`git push origin feature/your-amazing-feature`)
|
381
|
-
7. Open a pull request
|
382
|
-
|
383
|
-
|
384
|
-
**Optional**
|
385
|
-
* Flag with `#! REFINEME` for any improvements needed and `#! FIXME` for any errors.
|
386
|
-
|
387
|
-
<!-- * Run a React demo app: [React demo app](https://github.com/versionHQ/test-client-app) to check it on the client endpoint.
|
388
|
-
```
|
389
|
-
npm i
|
390
|
-
npm start
|
391
|
-
```
|
392
|
-
The frontend will be available at `http://localhost:3000`. -->
|
393
|
-
|
394
|
-
* `production` use case is available at `https://versi0n.io`. Currently, we are running alpha test.
|
395
|
-
|
396
|
-
|
397
|
-
### Documentation
|
483
|
+
**Building a new pytest function**
|
398
484
|
|
399
|
-
*
|
485
|
+
* Files added to the `tests` directory must end in `_test.py`.
|
400
486
|
|
401
|
-
*
|
487
|
+
* Test functions within the files must begin with `test_`.
|
402
488
|
|
403
|
-
|
404
|
-
uv run python3 -m mkdocs serve --clean
|
405
|
-
```
|
489
|
+
* Pytest priorities are `1. playground demo > 2. docs use cases > 3. other features`
|
406
490
|
|
407
|
-
* To add a new page, update `mkdocs.yml` in the root. Refer to [MkDocs official docs](https://squidfunk.github.io/mkdocs-material/getting-started/) for more details.
|
408
491
|
|
492
|
+
4. Update `docs` accordingly.
|
409
493
|
|
410
|
-
|
494
|
+
5. Pull the latest version of source code from the main branch (`git pull origin main`) *Address conflicts if any.
|
411
495
|
|
412
|
-
|
496
|
+
6. Commit your changes (`git add .` / `git commit -m 'Add your-amazing-feature'`)
|
413
497
|
|
414
|
-
|
498
|
+
7. Push to the branch (`git push origin feature/your-amazing-feature`)
|
415
499
|
|
416
|
-
|
500
|
+
8. Open a pull request
|
417
501
|
|
418
502
|
|
419
|
-
|
503
|
+
**Optional**
|
420
504
|
|
421
|
-
|
505
|
+
* Flag with `#! REFINEME` for any improvements needed and `#! FIXME` for any errors.
|
422
506
|
|
423
|
-
|
424
|
-
2. Modify the `tools.py` file to update the ingestion process if necessary.
|
425
|
-
3. Run the ingestion process to update the Chroma DB.
|
507
|
+
* `Playground` is available at `https://versi0n.io`.
|
426
508
|
|
427
509
|
|
428
510
|
### Package Management with uv
|
@@ -448,24 +530,44 @@ The RAG system uses Chroma DB to store and query past campaign dataset. To updat
|
|
448
530
|
|
449
531
|
Pre-commit hooks help maintain code quality by running checks for formatting, linting, and other issues before each commit.
|
450
532
|
|
451
|
-
* To skip pre-commit hooks
|
533
|
+
* To skip pre-commit hooks
|
452
534
|
```
|
453
535
|
git commit --no-verify -m "your-commit-message"
|
454
536
|
```
|
455
537
|
|
538
|
+
### Documentation
|
539
|
+
|
540
|
+
* To edit the documentation, see `docs` repository and edit the respective component.
|
541
|
+
|
542
|
+
* We use `mkdocs` to update the docs. You can run the docs locally at http://127.0.0.1:8000/.
|
543
|
+
|
544
|
+
```
|
545
|
+
uv run python3 -m mkdocs serve --clean
|
546
|
+
```
|
547
|
+
|
548
|
+
* To add a new page, update `mkdocs.yml` in the root. Refer to [MkDocs documentation](https://squidfunk.github.io/mkdocs-material/getting-started/) for more details.
|
549
|
+
|
456
550
|
<hr />
|
457
551
|
|
458
552
|
## Trouble Shooting
|
459
553
|
|
460
554
|
Common issues and solutions:
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
555
|
+
|
556
|
+
* API key errors: Ensure all API keys in the `.env` file are correct and up to date. Make sure to add `load_dotenv()` on the top of the python file to apply the latest environment values.
|
557
|
+
|
558
|
+
* Database connection issues: Check if the Chroma DB is properly initialized and accessible.
|
559
|
+
|
560
|
+
* Memory errors: If processing large contracts, you may need to increase the available memory for the Python process.
|
561
|
+
|
562
|
+
* Issues related to the Python version: Docling/Pytorch is not ready for Python 3.13 as of Jan 2025. Use Python 3.12.x as default by running `uv venv --python 3.12.8` and `uv python pin 3.12.8`.
|
563
|
+
|
564
|
+
* Issues related to dependencies: `rm -rf uv.lock`, `uv cache clean`, `uv venv`, and run `uv pip install -r requirements.txt -v`.
|
565
|
+
|
566
|
+
* Issues related to the AI agents or RAG system: Check the `output.log` file for detailed error messages and stack traces.
|
567
|
+
|
568
|
+
* Issues related to `Python quit unexpectedly`: Check [this stackoverflow article](https://stackoverflow.com/questions/59888499/macos-catalina-python-quit-unexpectedly-error).
|
569
|
+
|
570
|
+
* `reportMissingImports` error from pyright after installing the package: This might occur when installing new libraries while VSCode is running. Open the command pallete (ctrl + shift + p) and run the Python: Restart language server task.
|
469
571
|
|
470
572
|
<hr />
|
471
573
|
|
@@ -477,5 +579,5 @@ A. Visit [playground](https://versi0n.io).
|
|
477
579
|
|
478
580
|
**Q. How do you analyze the customer?**
|
479
581
|
|
480
|
-
|
481
|
-
|
582
|
+
A. We employ soft clustering for each customer.
|
583
|
+
<img width="200" src="https://res.cloudinary.com/dfeirxlea/image/upload/v1732732628/pj_m_agents/ito937s5d5x0so8isvw6.png">
|