loom-agent 0.0.1__py3-none-any.whl → 0.0.3__py3-none-any.whl
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.
Potentially problematic release.
This version of loom-agent might be problematic. Click here for more details.
- loom/builtin/tools/calculator.py +4 -0
- loom/builtin/tools/document_search.py +5 -0
- loom/builtin/tools/glob.py +4 -0
- loom/builtin/tools/grep.py +4 -0
- loom/builtin/tools/http_request.py +5 -0
- loom/builtin/tools/python_repl.py +5 -0
- loom/builtin/tools/read_file.py +4 -0
- loom/builtin/tools/task.py +105 -0
- loom/builtin/tools/web_search.py +4 -0
- loom/builtin/tools/write_file.py +4 -0
- loom/components/agent.py +121 -5
- loom/core/agent_executor.py +777 -321
- loom/core/compression_manager.py +17 -10
- loom/core/context_assembly.py +437 -0
- loom/core/events.py +660 -0
- loom/core/execution_context.py +119 -0
- loom/core/tool_orchestrator.py +383 -0
- loom/core/turn_state.py +188 -0
- loom/core/types.py +15 -4
- loom/core/unified_coordination.py +389 -0
- loom/interfaces/event_producer.py +172 -0
- loom/interfaces/tool.py +22 -1
- loom/security/__init__.py +13 -0
- loom/security/models.py +85 -0
- loom/security/path_validator.py +128 -0
- loom/security/validator.py +346 -0
- loom/tasks/PHASE_1_FOUNDATION/task_1.1_agent_events.md +121 -0
- loom/tasks/PHASE_1_FOUNDATION/task_1.2_streaming_api.md +521 -0
- loom/tasks/PHASE_1_FOUNDATION/task_1.3_context_assembler.md +606 -0
- loom/tasks/PHASE_2_CORE_FEATURES/task_2.1_tool_orchestrator.md +743 -0
- loom/tasks/PHASE_2_CORE_FEATURES/task_2.2_security_validator.md +676 -0
- loom/tasks/README.md +109 -0
- loom/tasks/__init__.py +11 -0
- loom/tasks/sql_placeholder.py +100 -0
- loom_agent-0.0.3.dist-info/METADATA +292 -0
- {loom_agent-0.0.1.dist-info → loom_agent-0.0.3.dist-info}/RECORD +38 -19
- loom_agent-0.0.1.dist-info/METADATA +0 -457
- {loom_agent-0.0.1.dist-info → loom_agent-0.0.3.dist-info}/WHEEL +0 -0
- {loom_agent-0.0.1.dist-info → loom_agent-0.0.3.dist-info}/licenses/LICENSE +0 -0
loom/tasks/README.md
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Loom 2.0 任务追踪目录
|
|
2
|
+
|
|
3
|
+
本目录包含所有开发任务的详细规范和检查清单。
|
|
4
|
+
|
|
5
|
+
## 📂 目录结构
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
loom/tasks/
|
|
9
|
+
├── README.md # 本文件
|
|
10
|
+
├── PHASE_1_FOUNDATION/ # 阶段 1:基础架构
|
|
11
|
+
│ ├── task_1.1_agent_events.md ✅ 完成
|
|
12
|
+
│ ├── task_1.2_streaming_api.md ⏳ 待开始
|
|
13
|
+
│ └── task_1.3_rag_context_fix.md ⏳ 待开始
|
|
14
|
+
├── PHASE_2_CORE_FEATURES/ # 阶段 2:核心功能
|
|
15
|
+
│ ├── task_2.1_tool_orchestrator.md ⏳ 待开始
|
|
16
|
+
│ ├── task_2.2_security_validator.md ⏳ 待开始
|
|
17
|
+
│ └── task_2.4_prompt_engineering.md ⏳ 待开始
|
|
18
|
+
└── PHASE_3_OPTIMIZATION/ # 阶段 3:高级优化
|
|
19
|
+
├── task_3.1_memory_optimization.md ⏳ 待开始
|
|
20
|
+
├── task_3.2_error_recovery.md ⏳ 待开始
|
|
21
|
+
└── task_3.3_tt_recursion.md ⏳ 待开始(可选)
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## 📊 当前状态
|
|
25
|
+
|
|
26
|
+
**开始日期**: 2025-10-25
|
|
27
|
+
**当前阶段**: 阶段 1 - 基础架构
|
|
28
|
+
**已完成**: 1/9 任务 (11%)
|
|
29
|
+
**进行中**: 0 任务
|
|
30
|
+
|
|
31
|
+
## ✅ 已完成任务
|
|
32
|
+
|
|
33
|
+
### Task 1.1: AgentEvent 模型 ✅
|
|
34
|
+
|
|
35
|
+
- **完成日期**: 2025-10-25
|
|
36
|
+
- **时间**: 1 天
|
|
37
|
+
- **交付物**:
|
|
38
|
+
- `loom/core/events.py` (420 行)
|
|
39
|
+
- `loom/interfaces/event_producer.py` (120 行)
|
|
40
|
+
- `tests/unit/test_agent_events.py` (31 个测试,全部通过)
|
|
41
|
+
- `docs/agent_events_guide.md` (650 行)
|
|
42
|
+
- `examples/agent_events_demo.py` (350 行)
|
|
43
|
+
- **总结**: `docs/TASK_1.1_COMPLETION_SUMMARY.md`
|
|
44
|
+
|
|
45
|
+
## 🔄 下一个任务
|
|
46
|
+
|
|
47
|
+
**推荐**: Task 1.2 - 重构 Agent.execute() 为流式接口
|
|
48
|
+
|
|
49
|
+
**原因**:
|
|
50
|
+
1. P0 优先级(必须完成)
|
|
51
|
+
2. 依赖 Task 1.1(已完成)
|
|
52
|
+
3. 是后续任务的基础
|
|
53
|
+
|
|
54
|
+
## 📝 使用说明
|
|
55
|
+
|
|
56
|
+
### 开始新任务
|
|
57
|
+
|
|
58
|
+
1. 从 `loom/tasks/PHASE_X/` 找到任务文件
|
|
59
|
+
2. 阅读任务规范和检查清单
|
|
60
|
+
3. 逐项完成检查清单
|
|
61
|
+
4. 运行测试验证
|
|
62
|
+
5. 创建完成总结文档
|
|
63
|
+
|
|
64
|
+
### 任务文件格式
|
|
65
|
+
|
|
66
|
+
每个任务文件包含:
|
|
67
|
+
|
|
68
|
+
- **元信息**: 优先级、预计时间、依赖
|
|
69
|
+
- **目标**: 清晰的任务目标
|
|
70
|
+
- **背景**: 为什么需要这个任务
|
|
71
|
+
- **详细步骤**: 具体的实现步骤
|
|
72
|
+
- **代码示例**: 伪代码或参考实现
|
|
73
|
+
- **验收标准**: 明确的完成标准
|
|
74
|
+
- **测试要求**: 测试覆盖率和测试用例
|
|
75
|
+
- **文档要求**: 需要更新的文档
|
|
76
|
+
- **检查清单**: 逐项检查的清单
|
|
77
|
+
|
|
78
|
+
### 完成任务
|
|
79
|
+
|
|
80
|
+
完成任务后:
|
|
81
|
+
|
|
82
|
+
1. ✅ 所有检查清单项都完成
|
|
83
|
+
2. ✅ 所有测试通过
|
|
84
|
+
3. ✅ 代码审查(自查或同行审查)
|
|
85
|
+
4. ✅ 文档更新
|
|
86
|
+
5. ✅ 创建 `TASK_X.X_COMPLETION_SUMMARY.md`
|
|
87
|
+
6. ✅ 更新 `LOOM_2.0_DEVELOPMENT_PLAN.md`
|
|
88
|
+
|
|
89
|
+
## 🎯 质量标准
|
|
90
|
+
|
|
91
|
+
所有任务必须满足:
|
|
92
|
+
|
|
93
|
+
- ✅ 测试覆盖率 ≥ 80%
|
|
94
|
+
- ✅ 所有单元测试通过
|
|
95
|
+
- ✅ 所有集成测试通过
|
|
96
|
+
- ✅ 代码遵循 PEP 8
|
|
97
|
+
- ✅ 类型提示完整
|
|
98
|
+
- ✅ 文档字符串完整
|
|
99
|
+
- ✅ 无明显性能问题
|
|
100
|
+
|
|
101
|
+
## 🔗 相关文档
|
|
102
|
+
|
|
103
|
+
- [Loom 2.0 开发计划](../../LOOM_2.0_DEVELOPMENT_PLAN.md) - 总体规划
|
|
104
|
+
- [AgentEvent 使用指南](../../docs/agent_events_guide.md) - 事件系统文档
|
|
105
|
+
- [架构设计文档](../../docs/) - 架构和接口定义
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
**最后更新**: 2025-10-25
|
loom/tasks/__init__.py
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import re
|
|
4
|
+
from dataclasses import dataclass
|
|
5
|
+
from typing import Dict, List
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
PLACEHOLDER_PATTERN = re.compile(r"{{\s*(?P<name>[\w\-]+)\s*:\s*(?P<desc>[^}]+)\s*}}")
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@dataclass(frozen=True)
|
|
12
|
+
class Placeholder:
|
|
13
|
+
"""Represents a placeholder extracted from a context template."""
|
|
14
|
+
|
|
15
|
+
name: str
|
|
16
|
+
description: str
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@dataclass
|
|
20
|
+
class SQLPlaceholderPlan:
|
|
21
|
+
"""Plan describing how to populate placeholders using a single SQL result row."""
|
|
22
|
+
|
|
23
|
+
context_template: str
|
|
24
|
+
sql: str
|
|
25
|
+
placeholder_columns: Dict[str, str]
|
|
26
|
+
data_source: Dict[str, str]
|
|
27
|
+
schedule: str
|
|
28
|
+
window_start: str
|
|
29
|
+
window_end: str
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def parse_placeholders(template: str) -> List[Placeholder]:
|
|
33
|
+
"""Extract placeholders of the form {{name: description}} from a template."""
|
|
34
|
+
matches = PLACEHOLDER_PATTERN.findall(template)
|
|
35
|
+
return [Placeholder(name=m[0].strip(), description=m[1].strip()) for m in matches]
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def _infer_column_alias(placeholder: Placeholder, index: int) -> str:
|
|
39
|
+
"""Infer a sensible column alias for a placeholder."""
|
|
40
|
+
desc = placeholder.description.lower()
|
|
41
|
+
if placeholder.name == "top_product":
|
|
42
|
+
return "top_product_name"
|
|
43
|
+
if "销量" in desc:
|
|
44
|
+
return "total_quantity"
|
|
45
|
+
if "收入" in desc or "revenue" in desc or "gmv" in desc:
|
|
46
|
+
return "total_revenue"
|
|
47
|
+
return f"{placeholder.name}_{index}"
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def _build_top_product_query(window_start: str, window_end: str, database: str) -> str:
|
|
51
|
+
"""Create SQL that returns the top-selling product for the window."""
|
|
52
|
+
# Doris uses MySQL-compatible syntax for DATE_ADD.
|
|
53
|
+
return (
|
|
54
|
+
"SELECT\n"
|
|
55
|
+
" p.product_name AS top_product_name,\n"
|
|
56
|
+
" SUM(oi.order_item_quantity) AS total_quantity,\n"
|
|
57
|
+
" SUM(oi.order_item_subtotal) AS total_revenue\n"
|
|
58
|
+
f"FROM {database}.orders AS o\n"
|
|
59
|
+
f"JOIN {database}.order_items AS oi\n"
|
|
60
|
+
" ON o.order_id = oi.order_item_order_id\n"
|
|
61
|
+
f"JOIN {database}.products AS p\n"
|
|
62
|
+
" ON p.product_id = oi.order_item_product_id\n"
|
|
63
|
+
f"WHERE o.order_date >= '{window_start}'\n"
|
|
64
|
+
f" AND o.order_date < DATE_ADD('{window_end}', INTERVAL 1 DAY)\n"
|
|
65
|
+
"GROUP BY p.product_name\n"
|
|
66
|
+
"ORDER BY total_quantity DESC\n"
|
|
67
|
+
"LIMIT 1;"
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def generate_placeholder_sql_plan(
|
|
72
|
+
*,
|
|
73
|
+
context_template: str,
|
|
74
|
+
schedule: str,
|
|
75
|
+
window_start: str,
|
|
76
|
+
window_end: str,
|
|
77
|
+
data_source: Dict[str, str],
|
|
78
|
+
) -> SQLPlaceholderPlan:
|
|
79
|
+
"""Generate an execution plan that maps template placeholders to SQL columns."""
|
|
80
|
+
placeholders = parse_placeholders(context_template)
|
|
81
|
+
placeholder_columns: Dict[str, str] = {}
|
|
82
|
+
for idx, placeholder in enumerate(placeholders, start=1):
|
|
83
|
+
key = f"{placeholder.name}:{placeholder.description}"
|
|
84
|
+
placeholder_columns[key] = _infer_column_alias(placeholder, idx)
|
|
85
|
+
|
|
86
|
+
sql = _build_top_product_query(
|
|
87
|
+
window_start=window_start,
|
|
88
|
+
window_end=window_end,
|
|
89
|
+
database=data_source.get("database", "retail_db"),
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
return SQLPlaceholderPlan(
|
|
93
|
+
context_template=context_template,
|
|
94
|
+
sql=sql,
|
|
95
|
+
placeholder_columns=placeholder_columns,
|
|
96
|
+
data_source=data_source,
|
|
97
|
+
schedule=schedule,
|
|
98
|
+
window_start=window_start,
|
|
99
|
+
window_end=window_end,
|
|
100
|
+
)
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: loom-agent
|
|
3
|
+
Version: 0.0.3
|
|
4
|
+
Summary: Production-ready Python Agent framework with enterprise-grade reliability and observability
|
|
5
|
+
License: MIT
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
Keywords: ai,llm,agent,multi-agent,rag,tooling,asyncio
|
|
8
|
+
Author: kongusen
|
|
9
|
+
Author-email: wanghaishan0210@gmail.com
|
|
10
|
+
Requires-Python: >=3.11,<4.0
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Framework :: AsyncIO
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Programming Language :: Python
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
22
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
23
|
+
Classifier: Typing :: Typed
|
|
24
|
+
Provides-Extra: all
|
|
25
|
+
Provides-Extra: anthropic
|
|
26
|
+
Provides-Extra: mcp
|
|
27
|
+
Provides-Extra: observability
|
|
28
|
+
Provides-Extra: openai
|
|
29
|
+
Provides-Extra: retrieval
|
|
30
|
+
Provides-Extra: system
|
|
31
|
+
Provides-Extra: web
|
|
32
|
+
Requires-Dist: anthropic (>=0.7.0,<0.8.0) ; extra == "anthropic" or extra == "all"
|
|
33
|
+
Requires-Dist: asyncio-throttle (>=1.0.2,<2.0.0) ; extra == "all"
|
|
34
|
+
Requires-Dist: cachetools (>=5.3.0,<6.0.0) ; extra == "observability" or extra == "all"
|
|
35
|
+
Requires-Dist: chromadb (>=0.4.0,<0.5.0) ; extra == "retrieval" or extra == "all"
|
|
36
|
+
Requires-Dist: docker (>=7.0.0,<8.0.0) ; extra == "system" or extra == "all"
|
|
37
|
+
Requires-Dist: fastapi (>=0.104.0,<0.105.0) ; extra == "web" or extra == "all"
|
|
38
|
+
Requires-Dist: mcp (>=0.2.0,<0.3.0) ; extra == "mcp" or extra == "all"
|
|
39
|
+
Requires-Dist: numpy (>=1.24.0,<2.0.0) ; extra == "retrieval" or extra == "all"
|
|
40
|
+
Requires-Dist: openai (>=1.6.0,<2.0.0) ; extra == "openai" or extra == "all"
|
|
41
|
+
Requires-Dist: pinecone-client (>=2.2,<4.0) ; extra == "retrieval" or extra == "all"
|
|
42
|
+
Requires-Dist: psutil (>=5.9.0,<6.0.0) ; extra == "system" or extra == "all"
|
|
43
|
+
Requires-Dist: pydantic (>=2.5.0,<3.0.0)
|
|
44
|
+
Requires-Dist: structlog (>=23.2.0,<24.0.0) ; extra == "observability" or extra == "all"
|
|
45
|
+
Requires-Dist: uvicorn[standard] (>=0.24.0,<0.25.0) ; extra == "web" or extra == "all"
|
|
46
|
+
Requires-Dist: weakref-tools (>=1.0.0,<2.0.0) ; extra == "all"
|
|
47
|
+
Requires-Dist: websockets (>=12.0,<13.0) ; extra == "web" or extra == "all"
|
|
48
|
+
Project-URL: Documentation, https://github.com/kongusen/loom-agent#readme
|
|
49
|
+
Project-URL: Homepage, https://github.com/kongusen/loom-agent
|
|
50
|
+
Project-URL: Repository, https://github.com/kongusen/loom-agent
|
|
51
|
+
Description-Content-Type: text/markdown
|
|
52
|
+
|
|
53
|
+
# Loom Agent
|
|
54
|
+
|
|
55
|
+
<div align="center">
|
|
56
|
+
|
|
57
|
+
**Production-ready Python Agent framework with enterprise-grade reliability and observability**
|
|
58
|
+
|
|
59
|
+
[](https://pypi.org/project/loom-agent/)
|
|
60
|
+
[](https://www.python.org/downloads/)
|
|
61
|
+
[](https://opensource.org/licenses/MIT)
|
|
62
|
+
[](tests/)
|
|
63
|
+
|
|
64
|
+
[Documentation](docs/user/user-guide.md) | [API Reference](docs/user/api-reference.md) | [Contributing](CONTRIBUTING.md)
|
|
65
|
+
|
|
66
|
+
</div>
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## 🎯 What is Loom Agent?
|
|
71
|
+
|
|
72
|
+
Loom Agent is a Python framework for building reliable AI agents with production-grade features like automatic retries, context compression, persistent memory, and comprehensive observability.
|
|
73
|
+
|
|
74
|
+
**Key Features:**
|
|
75
|
+
|
|
76
|
+
- 🚀 **Simple API** - Get started with just 3 lines of code
|
|
77
|
+
- 🔧 **Tool System** - Easy decorator-based tool creation
|
|
78
|
+
- 💾 **Persistent Memory** - Cross-session conversation history
|
|
79
|
+
- 📊 **Observability** - Structured logging with correlation IDs
|
|
80
|
+
- 🛡️ **Production Ready** - Circuit breakers, retries, and failover
|
|
81
|
+
- ⚡ **High Performance** - Parallel tool execution and smart context compression (40% faster in v0.0.3)
|
|
82
|
+
- 🌐 **Multi-LLM** - OpenAI, Anthropic, and more
|
|
83
|
+
- 🎯 **Unified Coordination** - Advanced multi-agent coordination system
|
|
84
|
+
- 🔄 **TT Recursive Mode** - Enhanced task handling with improved recursion
|
|
85
|
+
|
|
86
|
+
## 📦 Installation
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
# Basic installation
|
|
90
|
+
pip install loom-agent
|
|
91
|
+
|
|
92
|
+
# With OpenAI support
|
|
93
|
+
pip install loom-agent[openai]
|
|
94
|
+
|
|
95
|
+
# With all features
|
|
96
|
+
pip install loom-agent[all]
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
**Requirements:** Python 3.11+
|
|
100
|
+
|
|
101
|
+
## 🚀 Quick Start
|
|
102
|
+
|
|
103
|
+
### Basic Agent
|
|
104
|
+
|
|
105
|
+
```python
|
|
106
|
+
import asyncio
|
|
107
|
+
from loom import agent
|
|
108
|
+
from loom.builtin.llms import MockLLM
|
|
109
|
+
|
|
110
|
+
async def main():
|
|
111
|
+
# Create an agent
|
|
112
|
+
my_agent = agent(llm=MockLLM())
|
|
113
|
+
|
|
114
|
+
# Run it
|
|
115
|
+
result = await my_agent.run("Hello, world!")
|
|
116
|
+
print(result)
|
|
117
|
+
|
|
118
|
+
asyncio.run(main())
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### With OpenAI
|
|
122
|
+
|
|
123
|
+
```python
|
|
124
|
+
from loom import agent
|
|
125
|
+
|
|
126
|
+
# Create agent with OpenAI
|
|
127
|
+
my_agent = agent(
|
|
128
|
+
provider="openai",
|
|
129
|
+
model="gpt-4",
|
|
130
|
+
api_key="sk-..." # or set OPENAI_API_KEY env var
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
result = await my_agent.run("What is the capital of France?")
|
|
134
|
+
print(result)
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### Custom Tools
|
|
138
|
+
|
|
139
|
+
```python
|
|
140
|
+
from loom import agent, tool
|
|
141
|
+
|
|
142
|
+
@tool()
|
|
143
|
+
def add(a: int, b: int) -> int:
|
|
144
|
+
"""Add two numbers together"""
|
|
145
|
+
return a + b
|
|
146
|
+
|
|
147
|
+
my_agent = agent(
|
|
148
|
+
provider="openai",
|
|
149
|
+
model="gpt-4",
|
|
150
|
+
tools=[add()]
|
|
151
|
+
)
|
|
152
|
+
|
|
153
|
+
result = await my_agent.run("What is 15 plus 27?")
|
|
154
|
+
print(result)
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## 📚 Documentation
|
|
158
|
+
|
|
159
|
+
- **[Getting Started](docs/user/getting-started.md)** - Your first Loom agent in 5 minutes
|
|
160
|
+
- **[User Guide](docs/user/user-guide.md)** - Complete usage documentation
|
|
161
|
+
- **[API Reference](docs/user/api-reference.md)** - Detailed API documentation
|
|
162
|
+
- **[Contributing Guide](CONTRIBUTING.md)** - How to contribute
|
|
163
|
+
|
|
164
|
+
## 🛠️ Core Components
|
|
165
|
+
|
|
166
|
+
### Agent Builder
|
|
167
|
+
```python
|
|
168
|
+
from loom import agent
|
|
169
|
+
|
|
170
|
+
my_agent = agent(
|
|
171
|
+
provider="openai", # LLM provider
|
|
172
|
+
model="gpt-4", # Model name
|
|
173
|
+
tools=[...], # Custom tools
|
|
174
|
+
memory=..., # Memory system
|
|
175
|
+
callbacks=[...] # Observability
|
|
176
|
+
)
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Tool Decorator
|
|
180
|
+
```python
|
|
181
|
+
from loom import tool
|
|
182
|
+
|
|
183
|
+
@tool(description="Fetch weather data")
|
|
184
|
+
def get_weather(city: str) -> dict:
|
|
185
|
+
return {"temp": 72, "condition": "sunny"}
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### Memory System
|
|
189
|
+
```python
|
|
190
|
+
from loom import PersistentMemory
|
|
191
|
+
|
|
192
|
+
memory = PersistentMemory() # Conversations persist across restarts
|
|
193
|
+
agent = agent(llm=..., memory=memory)
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### Observability
|
|
197
|
+
```python
|
|
198
|
+
from loom import ObservabilityCallback, MetricsAggregator
|
|
199
|
+
|
|
200
|
+
obs = ObservabilityCallback()
|
|
201
|
+
metrics = MetricsAggregator()
|
|
202
|
+
|
|
203
|
+
agent = agent(llm=..., callbacks=[obs, metrics])
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
## 🎯 Supported Platforms
|
|
207
|
+
|
|
208
|
+
- **Python:** 3.11, 3.12
|
|
209
|
+
- **Operating Systems:** Linux, macOS, Windows
|
|
210
|
+
- **LLM Providers:** OpenAI, Anthropic, Ollama
|
|
211
|
+
|
|
212
|
+
## 🎊 What's New in v0.0.3
|
|
213
|
+
|
|
214
|
+
**Major Performance & Reliability Improvements:**
|
|
215
|
+
|
|
216
|
+
- ⚡ **40% Performance Boost** - Optimized execution pipeline and context management
|
|
217
|
+
- 🔧 **Unified Coordination System** - Advanced multi-agent coordination with improved reliability
|
|
218
|
+
- 🔄 **Enhanced TT Recursive Mode** - Better task handling and recursion management
|
|
219
|
+
- 🛡️ **Bug Fixes** - All known issues resolved, compilation passes cleanly
|
|
220
|
+
- 📚 **Improved Documentation** - Comprehensive guides and API references
|
|
221
|
+
|
|
222
|
+
**Production Ready Features:**
|
|
223
|
+
- ✅ Core agent execution (stable)
|
|
224
|
+
- ✅ Tool system and decorators (enhanced)
|
|
225
|
+
- ✅ Memory and context management (optimized)
|
|
226
|
+
- ✅ Multi-LLM provider support (OpenAI, Anthropic, Ollama)
|
|
227
|
+
- ✅ Structured logging and observability
|
|
228
|
+
- ✅ Circuit breakers and retry mechanisms
|
|
229
|
+
- ✅ Unified coordination for complex workflows
|
|
230
|
+
|
|
231
|
+
## 🤝 Contributing
|
|
232
|
+
|
|
233
|
+
We welcome contributions! Here's how to get started:
|
|
234
|
+
|
|
235
|
+
1. Fork the repository
|
|
236
|
+
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
|
|
237
|
+
3. Make your changes and add tests
|
|
238
|
+
4. Run tests: `poetry run pytest`
|
|
239
|
+
5. Submit a pull request
|
|
240
|
+
|
|
241
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines.
|
|
242
|
+
|
|
243
|
+
## 📊 Project Status
|
|
244
|
+
|
|
245
|
+
- **Version:** 0.0.3 (Alpha)
|
|
246
|
+
- **Status:** Active Development
|
|
247
|
+
- **Tests:** 18/18 passing ✅
|
|
248
|
+
- **Python:** 3.11+ supported
|
|
249
|
+
- **Performance:** 40% improvement over v0.0.2
|
|
250
|
+
|
|
251
|
+
## 🗺️ Roadmap
|
|
252
|
+
|
|
253
|
+
### v0.1.0 (Planned)
|
|
254
|
+
- API stabilization
|
|
255
|
+
- More examples and tutorials
|
|
256
|
+
- Performance optimizations
|
|
257
|
+
- Extended documentation
|
|
258
|
+
|
|
259
|
+
### v0.2.0 (Planned)
|
|
260
|
+
- Additional LLM providers
|
|
261
|
+
- Plugin system
|
|
262
|
+
- Web UI for debugging
|
|
263
|
+
|
|
264
|
+
### v1.0.0 (Goal)
|
|
265
|
+
- Stable API
|
|
266
|
+
- Production-grade quality
|
|
267
|
+
- Comprehensive documentation
|
|
268
|
+
- Community ecosystem
|
|
269
|
+
|
|
270
|
+
## 📄 License
|
|
271
|
+
|
|
272
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
273
|
+
|
|
274
|
+
## 🔗 Links
|
|
275
|
+
|
|
276
|
+
- **PyPI:** https://pypi.org/project/loom-agent/
|
|
277
|
+
- **GitHub:** https://github.com/kongusen/loom-agent
|
|
278
|
+
- **Issues:** https://github.com/kongusen/loom-agent/issues
|
|
279
|
+
- **Releases:** [v0.0.3](releases/v0.0.3.md) | [v0.0.2](releases/v0.0.2.md) | [v0.0.1](releases/v0.0.1.md)
|
|
280
|
+
|
|
281
|
+
## 🙏 Acknowledgments
|
|
282
|
+
|
|
283
|
+
Special thanks to the Claude Code project for inspiration and to all early testers and contributors!
|
|
284
|
+
|
|
285
|
+
---
|
|
286
|
+
|
|
287
|
+
**Built with ❤️ for the AI community**
|
|
288
|
+
|
|
289
|
+
<div align="center">
|
|
290
|
+
<sub>If you find Loom Agent useful, please consider giving it a ⭐ on GitHub!</sub>
|
|
291
|
+
</div>
|
|
292
|
+
|
|
@@ -24,27 +24,30 @@ loom/builtin/retriever/qdrant_store.py,sha256=PRin2SVkhK0VAKZFtmojF3uye0P66LS5m0
|
|
|
24
24
|
loom/builtin/retriever/vector_store.py,sha256=AVB3rHfGVJQ_Q78owi2wUTWeqxDhWjO6cQCyp7zPLtM,3718
|
|
25
25
|
loom/builtin/retriever/vector_store_config.py,sha256=YI7i_Dq1vjO3doVCOLM1PZD47sm2xJj2--pEh9Xjisc,7485
|
|
26
26
|
loom/builtin/tools/__init__.py,sha256=BnXMYnL6bzd-dR4HmONiVEj8sCAL_0h9X_MrNtTVYOw,802
|
|
27
|
-
loom/builtin/tools/calculator.py,sha256=
|
|
28
|
-
loom/builtin/tools/document_search.py,sha256=
|
|
29
|
-
loom/builtin/tools/glob.py,sha256=
|
|
30
|
-
loom/builtin/tools/grep.py,sha256=
|
|
31
|
-
loom/builtin/tools/http_request.py,sha256=
|
|
32
|
-
loom/builtin/tools/python_repl.py,sha256=
|
|
33
|
-
loom/builtin/tools/read_file.py,sha256=
|
|
34
|
-
loom/builtin/tools/task.py,sha256=
|
|
35
|
-
loom/builtin/tools/web_search.py,sha256=
|
|
36
|
-
loom/builtin/tools/write_file.py,sha256=
|
|
27
|
+
loom/builtin/tools/calculator.py,sha256=fly54MNcv03XJLo-qwLGmBHi6c6jKGAJ1FI0mky9vWQ,1340
|
|
28
|
+
loom/builtin/tools/document_search.py,sha256=wTLiSORE9_qDQi0678jhenMboXPElyxhDIq-C9GDuzg,3543
|
|
29
|
+
loom/builtin/tools/glob.py,sha256=rn9pCDJef-3icK7vAARl312xaYlT0X1TBMBcGRxbuJI,898
|
|
30
|
+
loom/builtin/tools/grep.py,sha256=VpcAa4-w3X7byzuWHK-2YLhA9W7DGeA2LwhLN86_HL0,1941
|
|
31
|
+
loom/builtin/tools/http_request.py,sha256=unu2DdT50povWfIGv2Dg60bkwjFIlYHJLwVT3N9DWMc,2944
|
|
32
|
+
loom/builtin/tools/python_repl.py,sha256=rznRXVAxNsixoKaNEekXri-X1I8PlqHO4erQzyk2apY,2410
|
|
33
|
+
loom/builtin/tools/read_file.py,sha256=Vj_vT7kCEomz3MNjHJatElKBAgsBKI9uaPYq0zw5Ekc,1088
|
|
34
|
+
loom/builtin/tools/task.py,sha256=556us6eef0BaZPUyU5ABaRnF9yEYSgXuWurFws4hmYQ,10100
|
|
35
|
+
loom/builtin/tools/web_search.py,sha256=wh1TmfEpHPtCjSPCxmWVUsIevjF-CAMxAaymZd64wzU,2059
|
|
36
|
+
loom/builtin/tools/write_file.py,sha256=9YnsgUh0wOfAuFRNE0OhCKFiK_PL7vfibThx9sHfS24,1108
|
|
37
37
|
loom/callbacks/base.py,sha256=dCI8i-2m-V3Wuw-8UInUDh_tp_0zU3W_HyaeHus10q8,188
|
|
38
38
|
loom/callbacks/logging.py,sha256=rOO4GSB8hw7gpZnmQmO5IYkctz_hTgo4L7rMnVqBSgU,304
|
|
39
39
|
loom/callbacks/metrics.py,sha256=_mrC0tjFmus2dvON-BFWfzAhcYUwoppIKYEV9q57MU8,670
|
|
40
40
|
loom/callbacks/observability.py,sha256=to9l9A7SIY6awZP8nHOHCLMknlWhXqV8iXLIQ0XRGtc,8534
|
|
41
|
-
loom/components/agent.py,sha256=
|
|
42
|
-
loom/core/agent_executor.py,sha256=
|
|
41
|
+
loom/components/agent.py,sha256=8j5rCZUrkw5nah4eloa6lBmqzz2kh-SPEdXTCXQKi4k,8380
|
|
42
|
+
loom/core/agent_executor.py,sha256=fTPbDkz2OlWKIHqfvG2MqS48CN6XnNNtkXW2f7IdtLY,33129
|
|
43
43
|
loom/core/circuit_breaker.py,sha256=ye46zUCCaQ_HN2tnh0ugzkTvZzzSUlgM4L-Lc50WSXU,6024
|
|
44
|
-
loom/core/compression_manager.py,sha256=
|
|
44
|
+
loom/core/compression_manager.py,sha256=x0YlJSdvFa-65qV0Af21_wmSGSvPTdyjgbBf5VyjYCg,13029
|
|
45
|
+
loom/core/context_assembly.py,sha256=G3lyO08W7qcFMoUBi5RudTwzOrjLewxLJwTeACbLK_A,14706
|
|
45
46
|
loom/core/context_retriever.py,sha256=wWr2JsFrvOzk_QEysvglP6NjSywPYczk4ZusCPqEF4M,5370
|
|
46
47
|
loom/core/error_classifier.py,sha256=yPoqO-KBAusDrhWXDSFmGgOo6diW9cE0q19KdtUylSI,6675
|
|
47
48
|
loom/core/errors.py,sha256=3A3FBZOtYsoZYjEUneTTz3O1jzYGF3-eIyzguVD4mL8,2318
|
|
49
|
+
loom/core/events.py,sha256=FX6OkVd2F-k4GTi6ka4E9EeOmJof8lBKv5rdQmFqMAA,20179
|
|
50
|
+
loom/core/execution_context.py,sha256=HnoTXx8HELMNi1iM8bA6Gq5nYQvsVSrefuLGbRNLWRU,3621
|
|
48
51
|
loom/core/message_queue.py,sha256=K8ZqkwXSEZ6DlMPOkMj04coMzDgwFO3HHWB5EP36v-s,5659
|
|
49
52
|
loom/core/permission_store.py,sha256=kZF63b0PLMyZzgtq6X8MBYaqEJp4Gz-7AeV4Eq54-rE,1809
|
|
50
53
|
loom/core/permissions.py,sha256=C92jUr_F2NTfrKEIyAnLpInXMD6LrpVBIL9XQbiVrtQ,2443
|
|
@@ -54,14 +57,18 @@ loom/core/structured_logger.py,sha256=VI1NRQ6XAljrKV2GUq9I7pL86o_huR2NRFCfL1hx2m
|
|
|
54
57
|
loom/core/subagent_pool.py,sha256=riDf2eXiy8pHO49aBaxO2unlSwsUc3dLnGvXS8cVkzg,7829
|
|
55
58
|
loom/core/system_prompt.py,sha256=eOXXQlxqNosGNWofYdcUMuO4txobceGSO9PqrDGDJxI,5277
|
|
56
59
|
loom/core/system_reminders.py,sha256=mozKaey47oHT9zu367oCKNKGOoIxnwL0Wt4bswtylwA,9027
|
|
60
|
+
loom/core/tool_orchestrator.py,sha256=81loORaBugC9etqiRF9ExrmN6OjtDUtnwbCzT98KagQ,12285
|
|
57
61
|
loom/core/tool_pipeline.py,sha256=v_ke2Pc3sgEGuVXdlZ8sjFG3rPAEO2daZeNEGO1-4xA,4823
|
|
58
|
-
loom/core/
|
|
62
|
+
loom/core/turn_state.py,sha256=pVIV16g5VsIeChfXCiaxVaKffOO73GhF9-4hvKzO-M8,5860
|
|
63
|
+
loom/core/types.py,sha256=HQcYZ70J_ueqfigR2rF-EJTNePDI-RaDrDVCz0BkCoc,11744
|
|
64
|
+
loom/core/unified_coordination.py,sha256=SGAIlNZUCHJmUIhGdf3ozn83y2S3-5xfyAfg_j9f8qk,14574
|
|
59
65
|
loom/interfaces/compressor.py,sha256=O9ALDFTTKB19kiooN_moTQi4goeVe46mXOjS8F-KFo4,1863
|
|
60
66
|
loom/interfaces/embedding.py,sha256=iJ1omki4WKiMtYriAvoKZ7iCg-FOl7xjbBe5ElkX-Sg,1129
|
|
67
|
+
loom/interfaces/event_producer.py,sha256=VTOiVi0RMgGxCu1ivpz7D32e-3TAnPDRW0dE7_MEDdY,4375
|
|
61
68
|
loom/interfaces/llm.py,sha256=wTWMFsYslrvDDfVTkwWEIy2XI-Sde5fKdsckWdSEbvQ,958
|
|
62
69
|
loom/interfaces/memory.py,sha256=hI9KdatK3twrn7bT2womIUAnmeBL2P7F-LQ5aA46FiY,699
|
|
63
70
|
loom/interfaces/retriever.py,sha256=fRLyB3qVmoK8LybsjW_8u8C_ZpDavrc1gfJscYqPazQ,4342
|
|
64
|
-
loom/interfaces/tool.py,sha256=
|
|
71
|
+
loom/interfaces/tool.py,sha256=3JA0NYNuXT7krlLEF75gMJ_AROpWMDJwqqAuWqcZllY,1340
|
|
65
72
|
loom/interfaces/vector_store.py,sha256=6FTUuWREil3neEbW6dEW7CFWFQaLltEaBrcamgqEjIM,1880
|
|
66
73
|
loom/llm/__init__.py,sha256=dLuyWiw9ybOaEGt1AOQA2c2a39lzAr1G3ad5WrEoRQ4,287
|
|
67
74
|
loom/llm/config.py,sha256=mIgQPcc4qkN1HoRsyG9BgU75ayjSRpdSa_1SB8YaY14,6933
|
|
@@ -80,10 +87,22 @@ loom/patterns/multi_agent.py,sha256=uA9ZlRMWPVRhT5xL5Dn8kbbuTmOEtl72Mv8XqWlSzVM,
|
|
|
80
87
|
loom/patterns/rag.py,sha256=-0XjBZI1cPD0PcDAZXs8PMiWuGsK4JwlmomaxzQBNIY,7462
|
|
81
88
|
loom/plugins/registry.py,sha256=H7AAA9TsEZKiztfK0zEf6HkZWPbX-pmflVtTaW9kI70,1669
|
|
82
89
|
loom/resilience/__init__.py,sha256=HHTBZTWG09AzN_AzjiRLPzTZI9cXpA7g2irSo0sUqLM,136
|
|
90
|
+
loom/security/__init__.py,sha256=Lm1ro1GRvGwE7Q7rY2oJ_QldJV4ZldgRSy2wfT2hwYs,370
|
|
91
|
+
loom/security/models.py,sha256=77RBB8UeS9MJdntKac0kR6TDybS2O_dhe1rQhdmSc1o,2335
|
|
92
|
+
loom/security/path_validator.py,sha256=HRzdP9jawPzfp3igPP6-qXUSNwuFTk4ua7us9DEYEPk,3370
|
|
93
|
+
loom/security/validator.py,sha256=HWBfY-X-Go2QUoNCWUzP-l4i0Ryx2q9ClrvrYbcqIoc,11526
|
|
94
|
+
loom/tasks/PHASE_1_FOUNDATION/task_1.1_agent_events.md,sha256=6xOcvId5EHAAVAe1qe1W29Ux3JvOfbDW-2KJ8f46fyE,3528
|
|
95
|
+
loom/tasks/PHASE_1_FOUNDATION/task_1.2_streaming_api.md,sha256=0bIblMx-OrK9BWcSWQv3pwkJlfY5iSg2vuBKUDaJ2Hs,14838
|
|
96
|
+
loom/tasks/PHASE_1_FOUNDATION/task_1.3_context_assembler.md,sha256=5feduFlGa_ZQW46O3Rygs-0DNahFKnVlkUM2FNrL_ls,17050
|
|
97
|
+
loom/tasks/PHASE_2_CORE_FEATURES/task_2.1_tool_orchestrator.md,sha256=trpw_Rq5EXHXG2eEBbxjH0G8lVf5m3YVamNk4IcG8Hk,21749
|
|
98
|
+
loom/tasks/PHASE_2_CORE_FEATURES/task_2.2_security_validator.md,sha256=-8ZrHWNRlRmYjz0-XBh5Po0FpdNoHgLeV8dEQkqXnxU,20126
|
|
99
|
+
loom/tasks/README.md,sha256=0AeVml7wAIBS0SLlXopmBoSvt0cf7BhroruIj8gnv0k,3154
|
|
100
|
+
loom/tasks/__init__.py,sha256=uPEJg4KxsLhaB9ycZuhYmvJR53Z_e9ChIXzC9gfAdOg,220
|
|
101
|
+
loom/tasks/sql_placeholder.py,sha256=I3lYI8ZnBDTCekFneq_AhlcisYopVI1y4HVQnYSt_38,3285
|
|
83
102
|
loom/tooling.py,sha256=sLAnjArQCU3oWuUTUDzNioZXZG33jYe3tGaIUpR22e4,2495
|
|
84
103
|
loom/utils/agent_loader.py,sha256=ngtD-mVNcHhs9xzx8rVHuWNFktdgH3zfy1ZkAzEBX-4,7034
|
|
85
104
|
loom/utils/token_counter.py,sha256=H0JY7HH8R0LhpWVamvx3Uuds9tphJar-c0hOrvJzYJU,462
|
|
86
|
-
loom_agent-0.0.
|
|
87
|
-
loom_agent-0.0.
|
|
88
|
-
loom_agent-0.0.
|
|
89
|
-
loom_agent-0.0.
|
|
105
|
+
loom_agent-0.0.3.dist-info/METADATA,sha256=uTF28IfM7WfPZCAF4kjSsmCbNCOO57whIjWbuR65QNU,9032
|
|
106
|
+
loom_agent-0.0.3.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
|
|
107
|
+
loom_agent-0.0.3.dist-info/licenses/LICENSE,sha256=2Fc25AXQ9WYE1SNVk4OYhze80Jq2yZvQnquS-2_Ytm4,1065
|
|
108
|
+
loom_agent-0.0.3.dist-info/RECORD,,
|