loom-agent 0.0.1__tar.gz → 0.0.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of loom-agent might be problematic. Click here for more details.

Files changed (113) hide show
  1. loom_agent-0.0.3/PKG-INFO +292 -0
  2. loom_agent-0.0.3/README.md +239 -0
  3. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/builtin/tools/calculator.py +4 -0
  4. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/builtin/tools/document_search.py +5 -0
  5. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/builtin/tools/glob.py +4 -0
  6. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/builtin/tools/grep.py +4 -0
  7. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/builtin/tools/http_request.py +5 -0
  8. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/builtin/tools/python_repl.py +5 -0
  9. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/builtin/tools/read_file.py +4 -0
  10. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/builtin/tools/task.py +105 -0
  11. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/builtin/tools/web_search.py +4 -0
  12. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/builtin/tools/write_file.py +4 -0
  13. loom_agent-0.0.3/loom/components/agent.py +223 -0
  14. loom_agent-0.0.3/loom/core/agent_executor.py +906 -0
  15. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/core/compression_manager.py +17 -10
  16. loom_agent-0.0.3/loom/core/context_assembly.py +437 -0
  17. loom_agent-0.0.3/loom/core/events.py +660 -0
  18. loom_agent-0.0.3/loom/core/execution_context.py +119 -0
  19. loom_agent-0.0.3/loom/core/tool_orchestrator.py +383 -0
  20. loom_agent-0.0.3/loom/core/turn_state.py +188 -0
  21. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/core/types.py +15 -4
  22. loom_agent-0.0.3/loom/core/unified_coordination.py +389 -0
  23. loom_agent-0.0.3/loom/interfaces/event_producer.py +172 -0
  24. loom_agent-0.0.3/loom/interfaces/tool.py +48 -0
  25. loom_agent-0.0.3/loom/security/__init__.py +13 -0
  26. loom_agent-0.0.3/loom/security/models.py +85 -0
  27. loom_agent-0.0.3/loom/security/path_validator.py +128 -0
  28. loom_agent-0.0.3/loom/security/validator.py +346 -0
  29. loom_agent-0.0.3/loom/tasks/PHASE_1_FOUNDATION/task_1.1_agent_events.md +121 -0
  30. loom_agent-0.0.3/loom/tasks/PHASE_1_FOUNDATION/task_1.2_streaming_api.md +521 -0
  31. loom_agent-0.0.3/loom/tasks/PHASE_1_FOUNDATION/task_1.3_context_assembler.md +606 -0
  32. loom_agent-0.0.3/loom/tasks/PHASE_2_CORE_FEATURES/task_2.1_tool_orchestrator.md +743 -0
  33. loom_agent-0.0.3/loom/tasks/PHASE_2_CORE_FEATURES/task_2.2_security_validator.md +676 -0
  34. loom_agent-0.0.3/loom/tasks/README.md +109 -0
  35. loom_agent-0.0.3/loom/tasks/__init__.py +11 -0
  36. loom_agent-0.0.3/loom/tasks/sql_placeholder.py +100 -0
  37. {loom_agent-0.0.1 → loom_agent-0.0.3}/pyproject.toml +1 -1
  38. loom_agent-0.0.1/PKG-INFO +0 -457
  39. loom_agent-0.0.1/README.md +0 -404
  40. loom_agent-0.0.1/loom/components/agent.py +0 -107
  41. loom_agent-0.0.1/loom/core/agent_executor.py +0 -450
  42. loom_agent-0.0.1/loom/interfaces/tool.py +0 -27
  43. {loom_agent-0.0.1 → loom_agent-0.0.3}/LICENSE +0 -0
  44. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/__init__.py +0 -0
  45. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/agent.py +0 -0
  46. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/agents/__init__.py +0 -0
  47. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/agents/refs.py +0 -0
  48. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/agents/registry.py +0 -0
  49. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/builtin/compression/__init__.py +0 -0
  50. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/builtin/compression/structured.py +0 -0
  51. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/builtin/embeddings/__init__.py +0 -0
  52. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/builtin/embeddings/openai_embedding.py +0 -0
  53. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/builtin/embeddings/sentence_transformers_embedding.py +0 -0
  54. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/builtin/llms/__init__.py +0 -0
  55. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/builtin/llms/mock.py +0 -0
  56. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/builtin/llms/openai.py +0 -0
  57. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/builtin/llms/rule.py +0 -0
  58. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/builtin/memory/__init__.py +0 -0
  59. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/builtin/memory/in_memory.py +0 -0
  60. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/builtin/memory/persistent_memory.py +0 -0
  61. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/builtin/retriever/__init__.py +0 -0
  62. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/builtin/retriever/chroma_store.py +0 -0
  63. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/builtin/retriever/in_memory.py +0 -0
  64. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/builtin/retriever/milvus_store.py +0 -0
  65. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/builtin/retriever/pinecone_store.py +0 -0
  66. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/builtin/retriever/qdrant_store.py +0 -0
  67. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/builtin/retriever/vector_store.py +0 -0
  68. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/builtin/retriever/vector_store_config.py +0 -0
  69. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/builtin/tools/__init__.py +0 -0
  70. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/callbacks/base.py +0 -0
  71. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/callbacks/logging.py +0 -0
  72. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/callbacks/metrics.py +0 -0
  73. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/callbacks/observability.py +0 -0
  74. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/core/circuit_breaker.py +0 -0
  75. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/core/context_retriever.py +0 -0
  76. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/core/error_classifier.py +0 -0
  77. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/core/errors.py +0 -0
  78. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/core/message_queue.py +0 -0
  79. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/core/permission_store.py +0 -0
  80. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/core/permissions.py +0 -0
  81. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/core/scheduler.py +0 -0
  82. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/core/steering_control.py +0 -0
  83. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/core/structured_logger.py +0 -0
  84. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/core/subagent_pool.py +0 -0
  85. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/core/system_prompt.py +0 -0
  86. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/core/system_reminders.py +0 -0
  87. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/core/tool_pipeline.py +0 -0
  88. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/interfaces/compressor.py +0 -0
  89. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/interfaces/embedding.py +0 -0
  90. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/interfaces/llm.py +0 -0
  91. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/interfaces/memory.py +0 -0
  92. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/interfaces/retriever.py +0 -0
  93. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/interfaces/vector_store.py +0 -0
  94. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/llm/__init__.py +0 -0
  95. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/llm/config.py +0 -0
  96. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/llm/factory.py +0 -0
  97. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/llm/model_health.py +0 -0
  98. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/llm/model_pool_advanced.py +0 -0
  99. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/llm/pool.py +0 -0
  100. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/llm/registry.py +0 -0
  101. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/mcp/__init__.py +0 -0
  102. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/mcp/client.py +0 -0
  103. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/mcp/registry.py +0 -0
  104. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/mcp/tool_adapter.py +0 -0
  105. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/observability/__init__.py +0 -0
  106. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/patterns/__init__.py +0 -0
  107. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/patterns/multi_agent.py +0 -0
  108. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/patterns/rag.py +0 -0
  109. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/plugins/registry.py +0 -0
  110. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/resilience/__init__.py +0 -0
  111. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/tooling.py +0 -0
  112. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/utils/agent_loader.py +0 -0
  113. {loom_agent-0.0.1 → loom_agent-0.0.3}/loom/utils/token_counter.py +0 -0
@@ -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
+ [![PyPI](https://img.shields.io/pypi/v/loom-agent.svg)](https://pypi.org/project/loom-agent/)
60
+ [![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)
61
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
62
+ [![Tests](https://img.shields.io/badge/tests-18%2F18%20passing-brightgreen.svg)](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
+
@@ -0,0 +1,239 @@
1
+ # Loom Agent
2
+
3
+ <div align="center">
4
+
5
+ **Production-ready Python Agent framework with enterprise-grade reliability and observability**
6
+
7
+ [![PyPI](https://img.shields.io/pypi/v/loom-agent.svg)](https://pypi.org/project/loom-agent/)
8
+ [![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)
9
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
10
+ [![Tests](https://img.shields.io/badge/tests-18%2F18%20passing-brightgreen.svg)](tests/)
11
+
12
+ [Documentation](docs/user/user-guide.md) | [API Reference](docs/user/api-reference.md) | [Contributing](CONTRIBUTING.md)
13
+
14
+ </div>
15
+
16
+ ---
17
+
18
+ ## 🎯 What is Loom Agent?
19
+
20
+ 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.
21
+
22
+ **Key Features:**
23
+
24
+ - 🚀 **Simple API** - Get started with just 3 lines of code
25
+ - 🔧 **Tool System** - Easy decorator-based tool creation
26
+ - 💾 **Persistent Memory** - Cross-session conversation history
27
+ - 📊 **Observability** - Structured logging with correlation IDs
28
+ - 🛡️ **Production Ready** - Circuit breakers, retries, and failover
29
+ - ⚡ **High Performance** - Parallel tool execution and smart context compression (40% faster in v0.0.3)
30
+ - 🌐 **Multi-LLM** - OpenAI, Anthropic, and more
31
+ - 🎯 **Unified Coordination** - Advanced multi-agent coordination system
32
+ - 🔄 **TT Recursive Mode** - Enhanced task handling with improved recursion
33
+
34
+ ## 📦 Installation
35
+
36
+ ```bash
37
+ # Basic installation
38
+ pip install loom-agent
39
+
40
+ # With OpenAI support
41
+ pip install loom-agent[openai]
42
+
43
+ # With all features
44
+ pip install loom-agent[all]
45
+ ```
46
+
47
+ **Requirements:** Python 3.11+
48
+
49
+ ## 🚀 Quick Start
50
+
51
+ ### Basic Agent
52
+
53
+ ```python
54
+ import asyncio
55
+ from loom import agent
56
+ from loom.builtin.llms import MockLLM
57
+
58
+ async def main():
59
+ # Create an agent
60
+ my_agent = agent(llm=MockLLM())
61
+
62
+ # Run it
63
+ result = await my_agent.run("Hello, world!")
64
+ print(result)
65
+
66
+ asyncio.run(main())
67
+ ```
68
+
69
+ ### With OpenAI
70
+
71
+ ```python
72
+ from loom import agent
73
+
74
+ # Create agent with OpenAI
75
+ my_agent = agent(
76
+ provider="openai",
77
+ model="gpt-4",
78
+ api_key="sk-..." # or set OPENAI_API_KEY env var
79
+ )
80
+
81
+ result = await my_agent.run("What is the capital of France?")
82
+ print(result)
83
+ ```
84
+
85
+ ### Custom Tools
86
+
87
+ ```python
88
+ from loom import agent, tool
89
+
90
+ @tool()
91
+ def add(a: int, b: int) -> int:
92
+ """Add two numbers together"""
93
+ return a + b
94
+
95
+ my_agent = agent(
96
+ provider="openai",
97
+ model="gpt-4",
98
+ tools=[add()]
99
+ )
100
+
101
+ result = await my_agent.run("What is 15 plus 27?")
102
+ print(result)
103
+ ```
104
+
105
+ ## 📚 Documentation
106
+
107
+ - **[Getting Started](docs/user/getting-started.md)** - Your first Loom agent in 5 minutes
108
+ - **[User Guide](docs/user/user-guide.md)** - Complete usage documentation
109
+ - **[API Reference](docs/user/api-reference.md)** - Detailed API documentation
110
+ - **[Contributing Guide](CONTRIBUTING.md)** - How to contribute
111
+
112
+ ## 🛠️ Core Components
113
+
114
+ ### Agent Builder
115
+ ```python
116
+ from loom import agent
117
+
118
+ my_agent = agent(
119
+ provider="openai", # LLM provider
120
+ model="gpt-4", # Model name
121
+ tools=[...], # Custom tools
122
+ memory=..., # Memory system
123
+ callbacks=[...] # Observability
124
+ )
125
+ ```
126
+
127
+ ### Tool Decorator
128
+ ```python
129
+ from loom import tool
130
+
131
+ @tool(description="Fetch weather data")
132
+ def get_weather(city: str) -> dict:
133
+ return {"temp": 72, "condition": "sunny"}
134
+ ```
135
+
136
+ ### Memory System
137
+ ```python
138
+ from loom import PersistentMemory
139
+
140
+ memory = PersistentMemory() # Conversations persist across restarts
141
+ agent = agent(llm=..., memory=memory)
142
+ ```
143
+
144
+ ### Observability
145
+ ```python
146
+ from loom import ObservabilityCallback, MetricsAggregator
147
+
148
+ obs = ObservabilityCallback()
149
+ metrics = MetricsAggregator()
150
+
151
+ agent = agent(llm=..., callbacks=[obs, metrics])
152
+ ```
153
+
154
+ ## 🎯 Supported Platforms
155
+
156
+ - **Python:** 3.11, 3.12
157
+ - **Operating Systems:** Linux, macOS, Windows
158
+ - **LLM Providers:** OpenAI, Anthropic, Ollama
159
+
160
+ ## 🎊 What's New in v0.0.3
161
+
162
+ **Major Performance & Reliability Improvements:**
163
+
164
+ - ⚡ **40% Performance Boost** - Optimized execution pipeline and context management
165
+ - 🔧 **Unified Coordination System** - Advanced multi-agent coordination with improved reliability
166
+ - 🔄 **Enhanced TT Recursive Mode** - Better task handling and recursion management
167
+ - 🛡️ **Bug Fixes** - All known issues resolved, compilation passes cleanly
168
+ - 📚 **Improved Documentation** - Comprehensive guides and API references
169
+
170
+ **Production Ready Features:**
171
+ - ✅ Core agent execution (stable)
172
+ - ✅ Tool system and decorators (enhanced)
173
+ - ✅ Memory and context management (optimized)
174
+ - ✅ Multi-LLM provider support (OpenAI, Anthropic, Ollama)
175
+ - ✅ Structured logging and observability
176
+ - ✅ Circuit breakers and retry mechanisms
177
+ - ✅ Unified coordination for complex workflows
178
+
179
+ ## 🤝 Contributing
180
+
181
+ We welcome contributions! Here's how to get started:
182
+
183
+ 1. Fork the repository
184
+ 2. Create a feature branch (`git checkout -b feature/amazing-feature`)
185
+ 3. Make your changes and add tests
186
+ 4. Run tests: `poetry run pytest`
187
+ 5. Submit a pull request
188
+
189
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines.
190
+
191
+ ## 📊 Project Status
192
+
193
+ - **Version:** 0.0.3 (Alpha)
194
+ - **Status:** Active Development
195
+ - **Tests:** 18/18 passing ✅
196
+ - **Python:** 3.11+ supported
197
+ - **Performance:** 40% improvement over v0.0.2
198
+
199
+ ## 🗺️ Roadmap
200
+
201
+ ### v0.1.0 (Planned)
202
+ - API stabilization
203
+ - More examples and tutorials
204
+ - Performance optimizations
205
+ - Extended documentation
206
+
207
+ ### v0.2.0 (Planned)
208
+ - Additional LLM providers
209
+ - Plugin system
210
+ - Web UI for debugging
211
+
212
+ ### v1.0.0 (Goal)
213
+ - Stable API
214
+ - Production-grade quality
215
+ - Comprehensive documentation
216
+ - Community ecosystem
217
+
218
+ ## 📄 License
219
+
220
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
221
+
222
+ ## 🔗 Links
223
+
224
+ - **PyPI:** https://pypi.org/project/loom-agent/
225
+ - **GitHub:** https://github.com/kongusen/loom-agent
226
+ - **Issues:** https://github.com/kongusen/loom-agent/issues
227
+ - **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)
228
+
229
+ ## 🙏 Acknowledgments
230
+
231
+ Special thanks to the Claude Code project for inspiration and to all early testers and contributors!
232
+
233
+ ---
234
+
235
+ **Built with ❤️ for the AI community**
236
+
237
+ <div align="center">
238
+ <sub>If you find Loom Agent useful, please consider giving it a ⭐ on GitHub!</sub>
239
+ </div>
@@ -18,6 +18,10 @@ class Calculator(BaseTool):
18
18
  description = "Evaluate simple arithmetic expressions"
19
19
  args_schema = CalcArgs
20
20
 
21
+ # 🆕 Loom 2.0 - Orchestration attributes
22
+ is_read_only = True # Pure computation, no side effects
23
+ category = "general"
24
+
21
25
  async def run(self, **kwargs) -> Any:
22
26
  expr = kwargs.get("expression", "")
23
27
  return str(_safe_eval(expr))
@@ -48,6 +48,11 @@ class DocumentSearchTool(BaseTool):
48
48
  """
49
49
 
50
50
  name = "search_documents"
51
+
52
+ # 🆕 Loom 2.0 - Orchestration attributes
53
+ is_read_only = True # Only searches documents, no modifications
54
+ category = "general"
55
+
51
56
  description = (
52
57
  "Search for relevant documents from the knowledge base. "
53
58
  "Use this when you need specific information that might be in the documents. "
@@ -19,6 +19,10 @@ class GlobTool(BaseTool):
19
19
  description = "按模式匹配文件路径"
20
20
  args_schema = GlobArgs
21
21
 
22
+ # 🆕 Loom 2.0 - Orchestration attributes
23
+ is_read_only = True
24
+ category = "general"
25
+
22
26
  async def run(self, **kwargs) -> Any:
23
27
  args = self.args_schema(**kwargs) # type: ignore
24
28
  cwd = Path(args.cwd).expanduser() if args.cwd else Path.cwd()
@@ -22,6 +22,10 @@ class GrepTool(BaseTool):
22
22
  description = "在文件或文件集内检索正则匹配"
23
23
  args_schema = GrepArgs
24
24
 
25
+ # 🆕 Loom 2.0 - Orchestration attributes
26
+ is_read_only = True
27
+ category = "general"
28
+
25
29
  async def run(self, **kwargs) -> Any:
26
30
  args = self.args_schema(**kwargs) # type: ignore
27
31
  flags = 0
@@ -35,6 +35,11 @@ class HTTPRequestTool(BaseTool):
35
35
  args_schema = HTTPRequestInput
36
36
  is_concurrency_safe = True
37
37
 
38
+ # 🆕 Loom 2.0 - Orchestration attributes
39
+ is_read_only = False # POST/PUT/DELETE may modify remote state
40
+ category = "network" # Network operation
41
+ requires_confirmation = False # Usually safe, but depends on usage
42
+
38
43
  def __init__(self, timeout: int = 10) -> None:
39
44
  if httpx is None:
40
45
  raise ImportError("Please install httpx: pip install httpx")
@@ -33,6 +33,11 @@ class PythonREPLTool(BaseTool):
33
33
  args_schema = PythonREPLInput
34
34
  is_concurrency_safe = False # 代码执行不并发安全
35
35
 
36
+ # 🆕 Loom 2.0 - Orchestration attributes
37
+ is_read_only = False # Code execution may have side effects
38
+ category = "destructive" # Potentially dangerous
39
+ requires_confirmation = True # Should require user confirmation
40
+
36
41
  async def run(self, code: str, **kwargs: Any) -> str:
37
42
  """执行 Python 代码"""
38
43
  # 安全性检查 - 禁止危险操作
@@ -19,6 +19,10 @@ class ReadFileTool(BaseTool):
19
19
  description = "读取文本文件内容"
20
20
  args_schema = ReadArgs
21
21
 
22
+ # 🆕 Loom 2.0 - Orchestration attributes
23
+ is_read_only = True
24
+ category = "general"
25
+
22
26
  async def run(self, **kwargs) -> Any:
23
27
  args = self.args_schema(**kwargs) # type: ignore
24
28
  p = Path(args.path).expanduser()