kweaver-dolphin 0.1.0__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.
Files changed (199) hide show
  1. DolphinLanguageSDK/__init__.py +58 -0
  2. dolphin/__init__.py +62 -0
  3. dolphin/cli/__init__.py +20 -0
  4. dolphin/cli/args/__init__.py +9 -0
  5. dolphin/cli/args/parser.py +567 -0
  6. dolphin/cli/builtin_agents/__init__.py +22 -0
  7. dolphin/cli/commands/__init__.py +4 -0
  8. dolphin/cli/interrupt/__init__.py +8 -0
  9. dolphin/cli/interrupt/handler.py +205 -0
  10. dolphin/cli/interrupt/keyboard.py +82 -0
  11. dolphin/cli/main.py +49 -0
  12. dolphin/cli/multimodal/__init__.py +34 -0
  13. dolphin/cli/multimodal/clipboard.py +327 -0
  14. dolphin/cli/multimodal/handler.py +249 -0
  15. dolphin/cli/multimodal/image_processor.py +214 -0
  16. dolphin/cli/multimodal/input_parser.py +149 -0
  17. dolphin/cli/runner/__init__.py +8 -0
  18. dolphin/cli/runner/runner.py +989 -0
  19. dolphin/cli/ui/__init__.py +10 -0
  20. dolphin/cli/ui/console.py +2795 -0
  21. dolphin/cli/ui/input.py +340 -0
  22. dolphin/cli/ui/layout.py +425 -0
  23. dolphin/cli/ui/stream_renderer.py +302 -0
  24. dolphin/cli/utils/__init__.py +8 -0
  25. dolphin/cli/utils/helpers.py +135 -0
  26. dolphin/cli/utils/version.py +49 -0
  27. dolphin/core/__init__.py +107 -0
  28. dolphin/core/agent/__init__.py +10 -0
  29. dolphin/core/agent/agent_state.py +69 -0
  30. dolphin/core/agent/base_agent.py +970 -0
  31. dolphin/core/code_block/__init__.py +0 -0
  32. dolphin/core/code_block/agent_init_block.py +0 -0
  33. dolphin/core/code_block/assign_block.py +98 -0
  34. dolphin/core/code_block/basic_code_block.py +1865 -0
  35. dolphin/core/code_block/explore_block.py +1327 -0
  36. dolphin/core/code_block/explore_block_v2.py +712 -0
  37. dolphin/core/code_block/explore_strategy.py +672 -0
  38. dolphin/core/code_block/judge_block.py +220 -0
  39. dolphin/core/code_block/prompt_block.py +32 -0
  40. dolphin/core/code_block/skill_call_deduplicator.py +291 -0
  41. dolphin/core/code_block/tool_block.py +129 -0
  42. dolphin/core/common/__init__.py +17 -0
  43. dolphin/core/common/constants.py +176 -0
  44. dolphin/core/common/enums.py +1173 -0
  45. dolphin/core/common/exceptions.py +133 -0
  46. dolphin/core/common/multimodal.py +539 -0
  47. dolphin/core/common/object_type.py +165 -0
  48. dolphin/core/common/output_format.py +432 -0
  49. dolphin/core/common/types.py +36 -0
  50. dolphin/core/config/__init__.py +16 -0
  51. dolphin/core/config/global_config.py +1289 -0
  52. dolphin/core/config/ontology_config.py +133 -0
  53. dolphin/core/context/__init__.py +12 -0
  54. dolphin/core/context/context.py +1580 -0
  55. dolphin/core/context/context_manager.py +161 -0
  56. dolphin/core/context/var_output.py +82 -0
  57. dolphin/core/context/variable_pool.py +356 -0
  58. dolphin/core/context_engineer/__init__.py +41 -0
  59. dolphin/core/context_engineer/config/__init__.py +5 -0
  60. dolphin/core/context_engineer/config/settings.py +402 -0
  61. dolphin/core/context_engineer/core/__init__.py +7 -0
  62. dolphin/core/context_engineer/core/budget_manager.py +327 -0
  63. dolphin/core/context_engineer/core/context_assembler.py +583 -0
  64. dolphin/core/context_engineer/core/context_manager.py +637 -0
  65. dolphin/core/context_engineer/core/tokenizer_service.py +260 -0
  66. dolphin/core/context_engineer/example/incremental_example.py +267 -0
  67. dolphin/core/context_engineer/example/traditional_example.py +334 -0
  68. dolphin/core/context_engineer/services/__init__.py +5 -0
  69. dolphin/core/context_engineer/services/compressor.py +399 -0
  70. dolphin/core/context_engineer/utils/__init__.py +6 -0
  71. dolphin/core/context_engineer/utils/context_utils.py +441 -0
  72. dolphin/core/context_engineer/utils/message_formatter.py +270 -0
  73. dolphin/core/context_engineer/utils/token_utils.py +139 -0
  74. dolphin/core/coroutine/__init__.py +15 -0
  75. dolphin/core/coroutine/context_snapshot.py +154 -0
  76. dolphin/core/coroutine/context_snapshot_profile.py +922 -0
  77. dolphin/core/coroutine/context_snapshot_store.py +268 -0
  78. dolphin/core/coroutine/execution_frame.py +145 -0
  79. dolphin/core/coroutine/execution_state_registry.py +161 -0
  80. dolphin/core/coroutine/resume_handle.py +101 -0
  81. dolphin/core/coroutine/step_result.py +101 -0
  82. dolphin/core/executor/__init__.py +18 -0
  83. dolphin/core/executor/debug_controller.py +630 -0
  84. dolphin/core/executor/dolphin_executor.py +1063 -0
  85. dolphin/core/executor/executor.py +624 -0
  86. dolphin/core/flags/__init__.py +27 -0
  87. dolphin/core/flags/definitions.py +49 -0
  88. dolphin/core/flags/manager.py +113 -0
  89. dolphin/core/hook/__init__.py +95 -0
  90. dolphin/core/hook/expression_evaluator.py +499 -0
  91. dolphin/core/hook/hook_dispatcher.py +380 -0
  92. dolphin/core/hook/hook_types.py +248 -0
  93. dolphin/core/hook/isolated_variable_pool.py +284 -0
  94. dolphin/core/interfaces.py +53 -0
  95. dolphin/core/llm/__init__.py +0 -0
  96. dolphin/core/llm/llm.py +495 -0
  97. dolphin/core/llm/llm_call.py +100 -0
  98. dolphin/core/llm/llm_client.py +1285 -0
  99. dolphin/core/llm/message_sanitizer.py +120 -0
  100. dolphin/core/logging/__init__.py +20 -0
  101. dolphin/core/logging/logger.py +526 -0
  102. dolphin/core/message/__init__.py +8 -0
  103. dolphin/core/message/compressor.py +749 -0
  104. dolphin/core/parser/__init__.py +8 -0
  105. dolphin/core/parser/parser.py +405 -0
  106. dolphin/core/runtime/__init__.py +10 -0
  107. dolphin/core/runtime/runtime_graph.py +926 -0
  108. dolphin/core/runtime/runtime_instance.py +446 -0
  109. dolphin/core/skill/__init__.py +14 -0
  110. dolphin/core/skill/context_retention.py +157 -0
  111. dolphin/core/skill/skill_function.py +686 -0
  112. dolphin/core/skill/skill_matcher.py +282 -0
  113. dolphin/core/skill/skillkit.py +700 -0
  114. dolphin/core/skill/skillset.py +72 -0
  115. dolphin/core/trajectory/__init__.py +10 -0
  116. dolphin/core/trajectory/recorder.py +189 -0
  117. dolphin/core/trajectory/trajectory.py +522 -0
  118. dolphin/core/utils/__init__.py +9 -0
  119. dolphin/core/utils/cache_kv.py +212 -0
  120. dolphin/core/utils/tools.py +340 -0
  121. dolphin/lib/__init__.py +93 -0
  122. dolphin/lib/debug/__init__.py +8 -0
  123. dolphin/lib/debug/visualizer.py +409 -0
  124. dolphin/lib/memory/__init__.py +28 -0
  125. dolphin/lib/memory/async_processor.py +220 -0
  126. dolphin/lib/memory/llm_calls.py +195 -0
  127. dolphin/lib/memory/manager.py +78 -0
  128. dolphin/lib/memory/sandbox.py +46 -0
  129. dolphin/lib/memory/storage.py +245 -0
  130. dolphin/lib/memory/utils.py +51 -0
  131. dolphin/lib/ontology/__init__.py +12 -0
  132. dolphin/lib/ontology/basic/__init__.py +0 -0
  133. dolphin/lib/ontology/basic/base.py +102 -0
  134. dolphin/lib/ontology/basic/concept.py +130 -0
  135. dolphin/lib/ontology/basic/object.py +11 -0
  136. dolphin/lib/ontology/basic/relation.py +63 -0
  137. dolphin/lib/ontology/datasource/__init__.py +27 -0
  138. dolphin/lib/ontology/datasource/datasource.py +66 -0
  139. dolphin/lib/ontology/datasource/oracle_datasource.py +338 -0
  140. dolphin/lib/ontology/datasource/sql.py +845 -0
  141. dolphin/lib/ontology/mapping.py +177 -0
  142. dolphin/lib/ontology/ontology.py +733 -0
  143. dolphin/lib/ontology/ontology_context.py +16 -0
  144. dolphin/lib/ontology/ontology_manager.py +107 -0
  145. dolphin/lib/skill_results/__init__.py +31 -0
  146. dolphin/lib/skill_results/cache_backend.py +559 -0
  147. dolphin/lib/skill_results/result_processor.py +181 -0
  148. dolphin/lib/skill_results/result_reference.py +179 -0
  149. dolphin/lib/skill_results/skillkit_hook.py +324 -0
  150. dolphin/lib/skill_results/strategies.py +328 -0
  151. dolphin/lib/skill_results/strategy_registry.py +150 -0
  152. dolphin/lib/skillkits/__init__.py +44 -0
  153. dolphin/lib/skillkits/agent_skillkit.py +155 -0
  154. dolphin/lib/skillkits/cognitive_skillkit.py +82 -0
  155. dolphin/lib/skillkits/env_skillkit.py +250 -0
  156. dolphin/lib/skillkits/mcp_adapter.py +616 -0
  157. dolphin/lib/skillkits/mcp_skillkit.py +771 -0
  158. dolphin/lib/skillkits/memory_skillkit.py +650 -0
  159. dolphin/lib/skillkits/noop_skillkit.py +31 -0
  160. dolphin/lib/skillkits/ontology_skillkit.py +89 -0
  161. dolphin/lib/skillkits/plan_act_skillkit.py +452 -0
  162. dolphin/lib/skillkits/resource/__init__.py +52 -0
  163. dolphin/lib/skillkits/resource/models/__init__.py +6 -0
  164. dolphin/lib/skillkits/resource/models/skill_config.py +109 -0
  165. dolphin/lib/skillkits/resource/models/skill_meta.py +127 -0
  166. dolphin/lib/skillkits/resource/resource_skillkit.py +393 -0
  167. dolphin/lib/skillkits/resource/skill_cache.py +215 -0
  168. dolphin/lib/skillkits/resource/skill_loader.py +395 -0
  169. dolphin/lib/skillkits/resource/skill_validator.py +406 -0
  170. dolphin/lib/skillkits/resource_skillkit.py +11 -0
  171. dolphin/lib/skillkits/search_skillkit.py +163 -0
  172. dolphin/lib/skillkits/sql_skillkit.py +274 -0
  173. dolphin/lib/skillkits/system_skillkit.py +509 -0
  174. dolphin/lib/skillkits/vm_skillkit.py +65 -0
  175. dolphin/lib/utils/__init__.py +9 -0
  176. dolphin/lib/utils/data_process.py +207 -0
  177. dolphin/lib/utils/handle_progress.py +178 -0
  178. dolphin/lib/utils/security.py +139 -0
  179. dolphin/lib/utils/text_retrieval.py +462 -0
  180. dolphin/lib/vm/__init__.py +11 -0
  181. dolphin/lib/vm/env_executor.py +895 -0
  182. dolphin/lib/vm/python_session_manager.py +453 -0
  183. dolphin/lib/vm/vm.py +610 -0
  184. dolphin/sdk/__init__.py +60 -0
  185. dolphin/sdk/agent/__init__.py +12 -0
  186. dolphin/sdk/agent/agent_factory.py +236 -0
  187. dolphin/sdk/agent/dolphin_agent.py +1106 -0
  188. dolphin/sdk/api/__init__.py +4 -0
  189. dolphin/sdk/runtime/__init__.py +8 -0
  190. dolphin/sdk/runtime/env.py +363 -0
  191. dolphin/sdk/skill/__init__.py +10 -0
  192. dolphin/sdk/skill/global_skills.py +706 -0
  193. dolphin/sdk/skill/traditional_toolkit.py +260 -0
  194. kweaver_dolphin-0.1.0.dist-info/METADATA +521 -0
  195. kweaver_dolphin-0.1.0.dist-info/RECORD +199 -0
  196. kweaver_dolphin-0.1.0.dist-info/WHEEL +5 -0
  197. kweaver_dolphin-0.1.0.dist-info/entry_points.txt +27 -0
  198. kweaver_dolphin-0.1.0.dist-info/licenses/LICENSE.txt +201 -0
  199. kweaver_dolphin-0.1.0.dist-info/top_level.txt +2 -0
@@ -0,0 +1,521 @@
1
+ Metadata-Version: 2.4
2
+ Name: kweaver-dolphin
3
+ Version: 0.1.0
4
+ Summary: Dolphin Language - An intelligent agent framework
5
+ Author-email: AnyData <contact@anydata.com>
6
+ License: Apache 2.0
7
+ Classifier: Development Status :: 4 - Beta
8
+ Classifier: Intended Audience :: Developers
9
+ Classifier: License :: OSI Approved :: Apache Software License
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Requires-Python: >=3.10
15
+ Description-Content-Type: text/markdown
16
+ License-File: LICENSE.txt
17
+ Requires-Dist: pydantic<3.0.0,>=2.0.0
18
+ Requires-Dist: PyYAML<7.0.0,>=6.0.1
19
+ Requires-Dist: openai<2.0.0,>=1.0.0
20
+ Requires-Dist: tiktoken<1.0.0,>=0.4.0
21
+ Requires-Dist: aiohttp<4.0.0,>=3.9.0
22
+ Requires-Dist: aiofiles>=23.0.0
23
+ Requires-Dist: requests>=2.31.0
24
+ Requires-Dist: docstring-parser>=0.15
25
+ Requires-Dist: jsonschema>=4.17.0
26
+ Requires-Dist: rich<15.0.0,>=14.0.0
27
+ Provides-Extra: lib
28
+ Requires-Dist: mcp<2.0.0,>=1.0.0; extra == "lib"
29
+ Requires-Dist: sqlalchemy<3.0.0,>=2.0.0; extra == "lib"
30
+ Requires-Dist: oracledb<3.0.0,>=2.2.0; extra == "lib"
31
+ Requires-Dist: rank-bm25<1.0.0,>=0.2.0; extra == "lib"
32
+ Requires-Dist: paramiko>=3.5.0; extra == "lib"
33
+ Requires-Dist: cryptography>=43.0.0; extra == "lib"
34
+ Requires-Dist: pandas; extra == "lib"
35
+ Provides-Extra: cli
36
+ Requires-Dist: rich<15.0.0,>=14.0.0; extra == "cli"
37
+ Requires-Dist: prompt_toolkit<4.0.0,>=3.0.0; extra == "cli"
38
+ Provides-Extra: full
39
+ Requires-Dist: kweaver-dolphin[lib]; extra == "full"
40
+ Requires-Dist: kweaver-dolphin[cli]; extra == "full"
41
+ Provides-Extra: dev
42
+ Requires-Dist: kweaver-dolphin[full]; extra == "dev"
43
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
44
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
45
+ Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
46
+ Requires-Dist: ruff>=0.1.0; extra == "dev"
47
+ Requires-Dist: black>=23.0.0; extra == "dev"
48
+ Requires-Dist: mypy>=1.0.0; extra == "dev"
49
+ Dynamic: license-file
50
+
51
+ # Dolphin Language SDK
52
+
53
+ **[ไธญๆ–‡ๆ–‡ๆกฃ](./README.zh-CN.md)** | English
54
+
55
+ [![Python](https://img.shields.io/badge/python-3.10+-blue.svg)](https://python.org)
56
+ [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
57
+
58
+ > ๐Ÿฌ A Domain-Specific Language (DSL) and SDK for building intelligent AI workflows
59
+
60
+ Dolphin Language is an innovative programming language and SDK designed specifically for building complex AI-driven applications. It solves complex problems by breaking down user requirements into smaller, manageable steps, providing a complete toolchain for developing, testing, and deploying AI applications.
61
+
62
+ ## โœจ Core Features
63
+
64
+ ### ๐ŸŽฏ AI Workflow Orchestration
65
+
66
+ - **Intelligent Task Decomposition**: Automatically breaks down complex queries into executable subtasks
67
+ - **Multi-Agent Collaboration**: Supports coordination and interaction between multiple AI Agents
68
+ - **Context Awareness**: Intelligent context management and compression mechanisms
69
+
70
+ ### ๐Ÿ”ง Rich Tool Ecosystem
71
+
72
+ - **SQL/Database Integration**: Native support for various database queries and operations
73
+ - **Ontology Management**: Structured concept and relationship modeling
74
+ - **Long-term Memory**: Persistent memory storage and retrieval system
75
+ - **MCP Integration**: Model Context Protocol support for connecting external tools and services
76
+
77
+ ### ๐Ÿงช Experiment System (Planned)
78
+
79
+ Note: The experiment system mentioned here is not included in this repository snapshot.
80
+
81
+ - **Benchmarking**: Standardized performance evaluation and comparison
82
+ - **Configuration Management**: Flexible experiment configuration and parameter tuning
83
+ - **Result Tracking**: Detailed experiment result recording and analysis
84
+
85
+ ### ๐Ÿ“Š Monitoring & Debugging
86
+
87
+ - **Runtime Tracking**: Complete execution path monitoring
88
+ - **Performance Analysis**: Detailed performance metrics and bottleneck analysis
89
+ - **Visual Debugging**: Intuitive call chain graphical display
90
+
91
+ ## ๐Ÿ”ง Requirements
92
+
93
+ ```text
94
+ python=3.10+
95
+ ```
96
+
97
+ ## ๐Ÿš€ Quick Installation
98
+
99
+ ### Recommended: Automated Setup
100
+
101
+ ```bash
102
+ git clone https://github.com/kweaver-ai/dolphin.git
103
+ cd dolphin
104
+ make dev-setup
105
+ ```
106
+
107
+ This will:
108
+ - Install all dependencies using `uv`
109
+ - Set up the development environment
110
+ - Make the `dolphin` command available
111
+
112
+ ### Alternative: Manual Installation
113
+
114
+ If you prefer manual control:
115
+
116
+ ```bash
117
+ # Install dependencies
118
+ uv sync --all-groups
119
+
120
+ # Or using pip in editable mode
121
+ pip install -e ".[dev]"
122
+ ```
123
+
124
+ ### Build Only (No Install)
125
+
126
+ To build the wheel package without installing:
127
+
128
+ ```bash
129
+ make build-only
130
+ # or
131
+ uv run python -m build
132
+ ```
133
+
134
+ **Requirements**: Python 3.10+ and [uv](https://docs.astral.sh/uv/) package manager (recommended) or pip.
135
+
136
+ For more installation options, see `make help`.
137
+
138
+ ## โš™๏ธ Configuration
139
+
140
+ Before running Dolphin, configure your LLM API credentials. Choose the method that fits your workflow:
141
+
142
+ ### ๐Ÿš€ Quick Setup: Environment Variables (Recommended)
143
+
144
+ The simplest way to get started:
145
+
146
+ ```bash
147
+ # Set your OpenAI API key
148
+ export OPENAI_API_KEY="sk-your-key-here"
149
+
150
+ # Or add to your shell profile for persistence
151
+ echo 'export OPENAI_API_KEY="sk-your-key-here"' >> ~/.bashrc # or ~/.zshrc
152
+ ```
153
+
154
+ **Why environment variables?**
155
+ - โœ… No configuration files needed
156
+ - โœ… More secure (won't accidentally commit secrets)
157
+ - โœ… Works across all examples
158
+ - โœ… Easy to update or rotate keys
159
+
160
+ **You're ready!** Continue to [Quick Start](#-quick-start) to run your first agent.
161
+
162
+ ### ๐Ÿ“ Advanced: Configuration File (Optional)
163
+
164
+ For complex setups (multiple models, custom endpoints):
165
+
166
+ ```bash
167
+ # 1. Copy the template
168
+ cp config/global.template.yaml config/global.yaml
169
+
170
+ # 2. Edit with your API key
171
+ vim config/global.yaml
172
+ # Replace "********" with your actual API key
173
+ ```
174
+
175
+ **Example configuration**:
176
+ ```yaml
177
+ clouds:
178
+ openai:
179
+ api: "https://api.openai.com/v1/chat/completions"
180
+ api_key: "sk-your-actual-key" # โ† Replace this
181
+
182
+ llms:
183
+ default: # Custom config name (not a model name)
184
+ cloud: "openai"
185
+ model_name: "gpt-4o" # Actual OpenAI model
186
+ temperature: 0.0
187
+ ```
188
+
189
+ **Configuration Priority** (highest to lowest):
190
+ 1. Environment variables (`OPENAI_API_KEY`)
191
+ 2. CLI argument `--config path/to/config.yaml`
192
+ 3. Project config `./config/global.yaml`
193
+ 4. User config `~/.dolphin/config.yaml`
194
+ 5. Default values
195
+
196
+ ๐Ÿ’ก See [config/global.template.yaml](config/global.template.yaml) for all options.
197
+
198
+ ## ๐ŸŒŸ Quick Start
199
+
200
+ ### Your First Query (30 seconds)
201
+
202
+ **Prerequisites**: Make sure you've [configured](#%EF%B8%8F-configuration) your API key.
203
+
204
+ ```bash
205
+ # 1. Create a sample data file
206
+ echo "name,age,city
207
+ Alice,30,New York
208
+ Bob,25,San Francisco
209
+ Charlie,35,Los Angeles" > /tmp/test_data.csv
210
+
211
+ # 2. Run your first analysis
212
+ dolphin run --agent tabular_analyst \
213
+ --folder ./examples/tabular_analyst \
214
+ --query "/tmp/test_data.csv"
215
+ ```
216
+
217
+ โœ… You should see Dolphin analyzing your data with intelligent insights!
218
+
219
+ ---
220
+
221
+ ### CLI Tool
222
+
223
+ Dolphin provides a powerful command-line tool with four running modes:
224
+
225
+ ```bash
226
+ # Explore mode (default, like Claude Code / Codex)
227
+ dolphin
228
+ dolphin explore
229
+
230
+ # Run Agent
231
+ dolphin run --agent my_agent --folder ./agents --query "Analyze data"
232
+
233
+ # Debug mode (step-by-step, breakpoints, variable inspection)
234
+ dolphin debug --agent my_agent --folder ./agents --break-on-start
235
+
236
+ # Interactive chat
237
+ dolphin chat --agent my_agent --folder ./agents
238
+ ```
239
+
240
+ ### Subcommand Overview
241
+
242
+ | Subcommand | Description | Typical Usage |
243
+ |------------|-------------|---------------|
244
+ | `explore` | Explore mode (default) | Interactive coding assistant |
245
+ | `run` | Run Agent (default) | Batch execution, scripting |
246
+ | `debug` | Debug mode | Development, troubleshooting |
247
+ | `chat` | Interactive chat | Continuous conversation, exploration |
248
+
249
+ ### Common Options
250
+
251
+ ```bash
252
+ # Basic run
253
+ dolphin run --agent my_agent --folder ./agents --query "your query"
254
+
255
+ # Verbose output
256
+ dolphin run --agent my_agent --folder ./agents -v --query "task"
257
+
258
+ # Debug level logging
259
+ dolphin run --agent my_agent --folder ./agents -vv --query "debug"
260
+
261
+ # Debug mode (with breakpoints)
262
+ dolphin debug --agent my_agent --folder ./agents --break-at 3 --break-at 7
263
+
264
+ # Interactive chat (with turn limit)
265
+ dolphin chat --agent my_agent --folder ./agents --max-turns 10
266
+
267
+ # Show version
268
+ dolphin --version
269
+
270
+ # Show help
271
+ dolphin --help
272
+ dolphin run --help
273
+ dolphin debug --help
274
+ dolphin chat --help
275
+ ```
276
+
277
+ Detailed CLI documentation: [bin/README.md](bin/README.md)
278
+
279
+ ### Python API
280
+
281
+ ```python
282
+ from dolphin.sdk.agent.dolphin_agent import DolphinAgent
283
+ import asyncio
284
+
285
+ async def main():
286
+ # Create Agent
287
+ agent = DolphinAgent(
288
+ name="my_agent",
289
+ content="@print('Hello, Dolphin!') -> result"
290
+ )
291
+
292
+ # Initialize
293
+ await agent.initialize()
294
+
295
+ # Run
296
+ async for result in agent.arun(query="test"):
297
+ print(result)
298
+
299
+ asyncio.run(main())
300
+ ```
301
+
302
+ For detailed Python API usage, see [Dolphin Agent Integration Guide](docs/usage/guides/dolphin-agent-integration.md).
303
+
304
+
305
+ ## ๐Ÿ› ๏ธ Utility Tools
306
+
307
+ The project provides a collection of utility tools in the `tools/` directory:
308
+
309
+ | Tool | Description |
310
+ |------|-------------|
311
+ | `view_trajectory.py` | Visualize Agent execution trajectories |
312
+
313
+ ### Usage Examples
314
+
315
+ ```bash
316
+ # List all trajectory files
317
+ python tools/view_trajectory.py --list
318
+
319
+ # View the latest trajectory
320
+ python tools/view_trajectory.py --latest
321
+
322
+ # View the Nth trajectory
323
+ python tools/view_trajectory.py --index 1
324
+ ```
325
+
326
+ Detailed tools documentation: [tools/README.md](tools/README.md)
327
+
328
+ ## ๐Ÿงช Experiment System (Planned)
329
+
330
+ The experiment system mentioned in some older docs/examples is not included in this repository snapshot.
331
+
332
+ ## ๐Ÿ”Œ MCP Integration
333
+
334
+ Support for Model Context Protocol (MCP) integration, connecting various external tools and services:
335
+
336
+ ```yaml
337
+ # Configure MCP servers
338
+ mcp_servers:
339
+ - name: browser_automation
340
+ command: ["npx", "playwright-mcp-server"]
341
+ args: ["--port", "3000"]
342
+ - name: file_operations
343
+ command: ["filesystem-mcp-server"]
344
+ args: ["--root", "/workspace"]
345
+ ```
346
+
347
+ ### Supported MCP Services
348
+
349
+ - **๐ŸŒ Browser Automation**: Playwright integration
350
+ - **๐Ÿ“ File System Operations**: File read/write and management
351
+ - **๐Ÿ—„๏ธ Database Access**: Multiple database connections
352
+ - **๐Ÿ› ๏ธ Custom Tools**: Any MCP protocol-compliant service
353
+
354
+ Detailed documentation: [docs/design/skill/mcp_integration_design.md](docs/design/skill/mcp_integration_design.md)
355
+
356
+ ## ๐Ÿง  Intelligent Features
357
+
358
+ ### Context Engineering
359
+
360
+ - **Smart Compression**: Importance-based context compression
361
+ - **Strategy Configuration**: Configurable compression strategies
362
+ - **Model Awareness**: Automatic adaptation to different LLM token limits
363
+
364
+ ### Long-term Memory
365
+
366
+ - **Persistent Storage**: Support for multiple storage backends
367
+ - **Semantic Retrieval**: Similarity-based memory retrieval
368
+ - **Automatic Management**: Intelligent memory compression and cleanup
369
+
370
+ ### Ontology Management
371
+
372
+ - **Concept Modeling**: Structured domain knowledge representation
373
+ - **Relationship Mapping**: Entity relationship modeling
374
+ - **Data Source Integration**: Unified data access interface
375
+
376
+ ## ๐Ÿ“– Project Structure
377
+
378
+ ```
379
+ dolphin/
380
+ โ”œโ”€โ”€ bin/ # CLI entry point
381
+ โ”‚ โ””โ”€โ”€ dolphin # Main CLI tool
382
+ โ”œโ”€โ”€ src/dolphin/ # Core SDK
383
+ โ”œโ”€โ”€ tools/ # Utility tools
384
+ โ”‚ โ””โ”€โ”€ view_trajectory.py # Trajectory visualization tool
385
+ โ”œโ”€โ”€ examples/ # Example projects
386
+ โ”œโ”€โ”€ tests/ # Test suite
387
+ โ”œโ”€โ”€ docs/ # Documentation
388
+ โ””โ”€โ”€ config/ # Configuration files
389
+ ```
390
+
391
+ ## ๐Ÿ“– Documentation
392
+
393
+ - [CLI Guide](bin/README.md) - Complete CLI documentation
394
+ - [Utility Tools](tools/README.md) - Utility tools usage guide
395
+ - [Language Rules](docs/usage/concepts/language_rules.md) - Dolphin Language syntax and specifications
396
+ - [Variable Format Guide](docs/usage/guides/Dolphin_Language_SDK_Variable_Format_Guide.md) - Variable usage guide
397
+ - [Context Engineering Guide](docs/design/context/context_engineer_guide.md) - Context management best practices
398
+ - [Runtime Tracking Architecture](docs/design/architecture/Runtime_Tracking_Architecture_Guide.md) - Monitoring and debugging guide
399
+ - [Long-term Memory Design](docs/design/context/long_term_memory_design.md) - Memory system design document
400
+
401
+ ## ๐Ÿ’ก Examples and Use Cases
402
+
403
+ ### Intelligent Data Analysis Workflow
404
+
405
+ ```dph
406
+ # Data analysis example
407
+ AGENT data_analyst:
408
+ PROMPT analyze_data:
409
+ Please analyze the following dataset: {{query}}
410
+
411
+ TOOL sql_query:
412
+ Query relevant data from database
413
+
414
+ JUDGE validate_results:
415
+ Check the reasonability of analysis results
416
+ ```
417
+
418
+ ### Quick Experience
419
+
420
+ ```bash
421
+ # Chat BI example
422
+ ./examples/bin/chatbi.sh
423
+
424
+ # Deep search example
425
+ ./examples/bin/deepsearch.sh
426
+ ```
427
+
428
+ ### Use Cases
429
+
430
+ - **๐Ÿ” Intelligent Q&A Systems**: Build enterprise-level knowledge Q&A applications
431
+ - **๐Ÿ“Š Data Analysis Platforms**: Automated data analysis and report generation
432
+ - **๐Ÿค– AI Assistants**: Multi-skill intelligent assistant development
433
+ - **๐Ÿ”ฌ Research Tools**: Academic research and experiment automation
434
+ - **๐Ÿ’ผ Business Process Automation**: Complex business logic automation
435
+
436
+ ## ๐Ÿ—๏ธ Architecture Overview
437
+
438
+ Dolphin Language SDK adopts a modular design with main components including:
439
+
440
+ - **Core Engine**: Core execution engine and language parser
441
+ - **CLI**: Command-line tool (run/debug/chat subcommands)
442
+ - **Skill System**: Extensible skill and tool system
443
+ - **Context Manager**: Intelligent context management and compression
444
+ - **Memory System**: Long-term memory storage and retrieval
445
+ - **Experiment Framework**: Experiment management and benchmarking
446
+ - **MCP Integration**: External tools and services integration
447
+
448
+ ## ๐Ÿงช Testing and Quality Assurance
449
+
450
+ ```bash
451
+ # Run complete test suite
452
+ make test
453
+
454
+ # Run integration tests
455
+ ./tests/run_tests.sh
456
+
457
+ # Run unit tests
458
+ python -m pytest tests/unittest/
459
+ ```
460
+
461
+ ### Test Coverage
462
+
463
+ - โœ… Unit Tests: Core components and algorithms
464
+ - โœ… Integration Tests: End-to-end workflow validation
465
+ - โœ… Benchmark Tests: Performance and accuracy evaluation
466
+ - โœ… Compatibility Tests: Multi-version Python support
467
+
468
+ ## ๐Ÿ› ๏ธ Development Environment Setup
469
+
470
+ ```bash
471
+ # Clone project
472
+ git clone https://github.com/kweaver-ai/dolphin.git
473
+ cd dolphin
474
+
475
+ # Setup development environment
476
+ make dev-setup
477
+
478
+ # Clean build files
479
+ make clean
480
+
481
+ # Build (clean + build)
482
+ make build
483
+
484
+ # Run tests
485
+ make test
486
+ ```
487
+
488
+ ## ๐Ÿค Contributing
489
+
490
+ We welcome community contributions! Ways to participate:
491
+
492
+ 1. **๐Ÿ› Report Issues**: Report bugs or feature requests in Issues
493
+ 2. **๐Ÿ“ Improve Documentation**: Help improve documentation and examples
494
+ 3. **๐Ÿ’ป Submit Code**: Submit bug fixes or new features
495
+ 4. **๐Ÿงช Add Tests**: Expand test coverage
496
+ 5. **๐Ÿ”ง Develop Tools**: Develop new Skillkits or tools
497
+
498
+ ### Development Workflow
499
+
500
+ 1. Fork the project and create a feature branch
501
+ 2. Write code and tests
502
+ 3. Ensure all tests pass
503
+ 4. Submit Pull Request
504
+
505
+ ## ๐Ÿ“„ License
506
+
507
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details
508
+
509
+ ## ๐Ÿ”— Related Links
510
+
511
+ - [Official Documentation](docs/README.md)
512
+ - [CLI Documentation](bin/README.md)
513
+ - [Utility Tools](tools/README.md)
514
+ - [Example Projects](examples/)
515
+ - [Changelog](CHANGELOG.md)
516
+
517
+ ---
518
+
519
+ ## ๐Ÿฌ Dolphin Language SDK - Making AI Workflow Development Simpler
520
+
521
+ [Get Started](#-quick-start) โ€ข [View Docs](docs/README.md) โ€ข [Contribute](#-contributing) โ€ข [Report Issues](../../issues)