agentic-cli 0.2.0__tar.gz → 0.3.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.
- {agentic_cli-0.2.0 → agentic_cli-0.3.1}/CHANGELOG.md +58 -0
- {agentic_cli-0.2.0 → agentic_cli-0.3.1}/PKG-INFO +56 -23
- {agentic_cli-0.2.0 → agentic_cli-0.3.1}/README.md +55 -22
- {agentic_cli-0.2.0 → agentic_cli-0.3.1}/examples/hello_agent.py +19 -22
- {agentic_cli-0.2.0 → agentic_cli-0.3.1}/examples/hello_langgraph.py +19 -29
- agentic_cli-0.3.1/examples/research_demo/README.md +160 -0
- agentic_cli-0.3.1/examples/research_demo/__init__.py +21 -0
- agentic_cli-0.3.1/examples/research_demo/__main__.py +18 -0
- agentic_cli-0.3.1/examples/research_demo/agents.py +165 -0
- agentic_cli-0.3.1/examples/research_demo/app.py +233 -0
- agentic_cli-0.3.1/examples/research_demo/commands.py +359 -0
- agentic_cli-0.3.1/examples/research_demo/settings.py +46 -0
- agentic_cli-0.3.1/examples/research_demo/tools.py +139 -0
- {agentic_cli-0.2.0 → agentic_cli-0.3.1}/pyproject.toml +1 -1
- {agentic_cli-0.2.0 → agentic_cli-0.3.1}/src/agentic_cli/__init__.py +9 -2
- {agentic_cli-0.2.0 → agentic_cli-0.3.1}/src/agentic_cli/cli/__init__.py +2 -0
- {agentic_cli-0.2.0 → agentic_cli-0.3.1}/src/agentic_cli/cli/app.py +172 -49
- agentic_cli-0.3.1/src/agentic_cli/cli/settings.py +50 -0
- agentic_cli-0.3.1/src/agentic_cli/cli/settings_command.py +63 -0
- agentic_cli-0.3.1/src/agentic_cli/cli/settings_introspection.py +180 -0
- {agentic_cli-0.2.0 → agentic_cli-0.3.1}/src/agentic_cli/config.py +122 -73
- agentic_cli-0.3.1/src/agentic_cli/config_mixins.py +119 -0
- agentic_cli-0.3.1/src/agentic_cli/hitl/__init__.py +29 -0
- agentic_cli-0.3.1/src/agentic_cli/hitl/approval.py +226 -0
- agentic_cli-0.3.1/src/agentic_cli/hitl/checkpoints.py +149 -0
- agentic_cli-0.3.1/src/agentic_cli/hitl/config.py +47 -0
- agentic_cli-0.3.1/src/agentic_cli/memory/__init__.py +28 -0
- agentic_cli-0.3.1/src/agentic_cli/memory/longterm.py +302 -0
- agentic_cli-0.3.1/src/agentic_cli/memory/manager.py +139 -0
- agentic_cli-0.3.1/src/agentic_cli/memory/tools.py +251 -0
- agentic_cli-0.3.1/src/agentic_cli/memory/working.py +121 -0
- agentic_cli-0.3.1/src/agentic_cli/planning/__init__.py +27 -0
- agentic_cli-0.3.1/src/agentic_cli/planning/task_graph.py +454 -0
- agentic_cli-0.3.1/src/agentic_cli/settings_persistence.py +127 -0
- agentic_cli-0.3.1/src/agentic_cli/tools/__init__.py +135 -0
- agentic_cli-0.3.1/src/agentic_cli/tools/file_ops.py +358 -0
- agentic_cli-0.3.1/src/agentic_cli/tools/hitl_tools.py +212 -0
- agentic_cli-0.3.1/src/agentic_cli/tools/memory_tools.py +199 -0
- agentic_cli-0.3.1/src/agentic_cli/tools/planning_tools.py +281 -0
- {agentic_cli-0.2.0 → agentic_cli-0.3.1}/src/agentic_cli/tools/registry.py +3 -0
- agentic_cli-0.3.1/src/agentic_cli/tools/shell.py +181 -0
- agentic_cli-0.3.1/src/agentic_cli/workflow/__init__.py +92 -0
- agentic_cli-0.3.1/src/agentic_cli/workflow/adk/__init__.py +18 -0
- {agentic_cli-0.2.0 → agentic_cli-0.3.1}/src/agentic_cli/workflow/adk_manager.py +21 -3
- {agentic_cli-0.2.0 → agentic_cli-0.3.1}/src/agentic_cli/workflow/base_manager.py +87 -1
- agentic_cli-0.3.1/src/agentic_cli/workflow/context.py +90 -0
- {agentic_cli-0.2.0 → agentic_cli-0.3.1}/src/agentic_cli/workflow/events.py +34 -0
- agentic_cli-0.3.1/src/agentic_cli/workflow/langgraph/__init__.py +42 -0
- agentic_cli-0.2.0/src/agentic_cli/workflow/langgraph_manager.py → agentic_cli-0.3.1/src/agentic_cli/workflow/langgraph/manager.py +81 -186
- agentic_cli-0.3.1/src/agentic_cli/workflow/langgraph/persistence/__init__.py +21 -0
- agentic_cli-0.3.1/src/agentic_cli/workflow/langgraph/persistence/checkpointers.py +152 -0
- agentic_cli-0.3.1/src/agentic_cli/workflow/langgraph/persistence/stores.py +159 -0
- agentic_cli-0.3.1/src/agentic_cli/workflow/langgraph/tools/__init__.py +28 -0
- agentic_cli-0.3.1/src/agentic_cli/workflow/langgraph/tools/file_search.py +251 -0
- agentic_cli-0.3.1/src/agentic_cli/workflow/langgraph/tools/shell.py +364 -0
- agentic_cli-0.3.1/src/agentic_cli/workflow/langgraph_manager.py +32 -0
- agentic_cli-0.3.1/src/agentic_cli/workflow/langgraph_state.py +54 -0
- agentic_cli-0.3.1/src/agentic_cli/workflow/settings.py +152 -0
- {agentic_cli-0.2.0 → agentic_cli-0.3.1}/tests/test_config.py +22 -0
- agentic_cli-0.3.1/tests/test_hitl.py +250 -0
- {agentic_cli-0.2.0 → agentic_cli-0.3.1}/tests/test_langgraph.py +163 -3
- agentic_cli-0.3.1/tests/test_memory.py +596 -0
- agentic_cli-0.3.1/tests/test_planning.py +359 -0
- agentic_cli-0.3.1/tests/test_tools.py +1114 -0
- agentic_cli-0.2.0/src/agentic_cli/cli/settings_command.py +0 -75
- agentic_cli-0.2.0/src/agentic_cli/config_mixins.py +0 -123
- agentic_cli-0.2.0/src/agentic_cli/tools/__init__.py +0 -62
- agentic_cli-0.2.0/src/agentic_cli/workflow/__init__.py +0 -39
- agentic_cli-0.2.0/tests/test_tools.py +0 -605
- {agentic_cli-0.2.0 → agentic_cli-0.3.1}/.gitignore +0 -0
- {agentic_cli-0.2.0 → agentic_cli-0.3.1}/LICENSE +0 -0
- {agentic_cli-0.2.0 → agentic_cli-0.3.1}/environment.yml +0 -0
- {agentic_cli-0.2.0 → agentic_cli-0.3.1}/requirements-dev.txt +0 -0
- {agentic_cli-0.2.0 → agentic_cli-0.3.1}/requirements.txt +0 -0
- {agentic_cli-0.2.0 → agentic_cli-0.3.1}/src/agentic_cli/cli/builtin_commands.py +0 -0
- {agentic_cli-0.2.0 → agentic_cli-0.3.1}/src/agentic_cli/cli/commands.py +0 -0
- {agentic_cli-0.2.0 → agentic_cli-0.3.1}/src/agentic_cli/knowledge_base/__init__.py +0 -0
- {agentic_cli-0.2.0 → agentic_cli-0.3.1}/src/agentic_cli/knowledge_base/embeddings.py +0 -0
- {agentic_cli-0.2.0 → agentic_cli-0.3.1}/src/agentic_cli/knowledge_base/manager.py +0 -0
- {agentic_cli-0.2.0 → agentic_cli-0.3.1}/src/agentic_cli/knowledge_base/models.py +0 -0
- {agentic_cli-0.2.0 → agentic_cli-0.3.1}/src/agentic_cli/knowledge_base/sources.py +0 -0
- {agentic_cli-0.2.0 → agentic_cli-0.3.1}/src/agentic_cli/knowledge_base/vector_store.py +0 -0
- {agentic_cli-0.2.0 → agentic_cli-0.3.1}/src/agentic_cli/logging.py +0 -0
- {agentic_cli-0.2.0 → agentic_cli-0.3.1}/src/agentic_cli/persistence/__init__.py +0 -0
- {agentic_cli-0.2.0 → agentic_cli-0.3.1}/src/agentic_cli/persistence/artifacts.py +0 -0
- {agentic_cli-0.2.0 → agentic_cli-0.3.1}/src/agentic_cli/persistence/session.py +0 -0
- {agentic_cli-0.2.0 → agentic_cli-0.3.1}/src/agentic_cli/resolvers.py +0 -0
- {agentic_cli-0.2.0 → agentic_cli-0.3.1}/src/agentic_cli/tools/executor.py +0 -0
- {agentic_cli-0.2.0 → agentic_cli-0.3.1}/src/agentic_cli/tools/standard.py +0 -0
- {agentic_cli-0.2.0 → agentic_cli-0.3.1}/src/agentic_cli/workflow/config.py +0 -0
- /agentic_cli-0.2.0/src/agentic_cli/workflow/langgraph_state.py → /agentic_cli-0.3.1/src/agentic_cli/workflow/langgraph/state.py +0 -0
- {agentic_cli-0.2.0 → agentic_cli-0.3.1}/src/agentic_cli/workflow/thinking.py +0 -0
- {agentic_cli-0.2.0 → agentic_cli-0.3.1}/tests/__init__.py +0 -0
- {agentic_cli-0.2.0 → agentic_cli-0.3.1}/tests/conftest.py +0 -0
- {agentic_cli-0.2.0 → agentic_cli-0.3.1}/tests/test_commands.py +0 -0
- {agentic_cli-0.2.0 → agentic_cli-0.3.1}/tests/test_knowledge_base.py +0 -0
- {agentic_cli-0.2.0 → agentic_cli-0.3.1}/tests/test_persistence.py +0 -0
- {agentic_cli-0.2.0 → agentic_cli-0.3.1}/tests/test_workflow.py +0 -0
|
@@ -5,6 +5,64 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.3.1] - 2026-01-28
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **Task Progress Display**: Thinking box now shows dynamic task progress with status icons (◐ ☐ ✓ ✗)
|
|
13
|
+
- `TASK_PROGRESS` event type for signaling task graph updates
|
|
14
|
+
- `TaskGraph.to_compact_display()` for condensed status display
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- **Background Initialization**: Workflow manager now initializes services in background, eliminating first-message lag
|
|
19
|
+
- Simplified LangGraph imports - removed `_import_langgraph` helper in favor of direct imports
|
|
20
|
+
|
|
21
|
+
## [0.3.0] - 2025-01-27
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
|
|
25
|
+
- **Memory System** with 3-tier architecture:
|
|
26
|
+
- `WorkingMemory` - Session-scoped context with tags and serialization
|
|
27
|
+
- `LongTermMemory` - Persistent memory with knowledge base references
|
|
28
|
+
- `MemoryManager` - Unified interface for working and long-term memory
|
|
29
|
+
- Memory tools (`working_memory_tool`, `long_term_memory_tool`)
|
|
30
|
+
- **Planning System**:
|
|
31
|
+
- `TaskGraph` - Work plan management with dependencies and status tracking
|
|
32
|
+
- `TaskStatus` enum for pending/in_progress/completed/blocked states
|
|
33
|
+
- `Task` dataclass with subtasks, dependencies, and metadata
|
|
34
|
+
- **Human-in-the-Loop (HITL) System**:
|
|
35
|
+
- `ApprovalManager` - Configurable approval gates with auto-approve patterns
|
|
36
|
+
- `CheckpointManager` - Review checkpoints with continue/edit/regenerate/abort actions
|
|
37
|
+
- `HITLConfig` and `ApprovalRule` for configuration
|
|
38
|
+
- **New Tools**:
|
|
39
|
+
- `shell_executor` with safety controls (blocks dangerous commands)
|
|
40
|
+
- `file_manager` with read/write/list/copy/move/delete operations
|
|
41
|
+
- `diff_compare` with unified/side-by-side/summary modes
|
|
42
|
+
- New tool categories: `MEMORY`, `PLANNING`, `SYSTEM`
|
|
43
|
+
- Framework-provided tools with auto-detection
|
|
44
|
+
- Layered JSON settings persistence with organized mixins
|
|
45
|
+
- `research_demo` example showcasing memory, planning, and file operations
|
|
46
|
+
|
|
47
|
+
### Changed
|
|
48
|
+
|
|
49
|
+
- **LangGraph Module Reorganization**:
|
|
50
|
+
- Moved to dedicated `workflow/langgraph/` submodule
|
|
51
|
+
- Added `persistence/` for checkpointers and stores
|
|
52
|
+
- Added `tools/` for shell and file search utilities
|
|
53
|
+
- **Simplified LangGraphWorkflowManager**:
|
|
54
|
+
- Removed dead middleware module (~400 lines)
|
|
55
|
+
- Use explicit provider instantiation (GenAI for Gemini, not VertexAI)
|
|
56
|
+
- Simplified model creation with thinking support for Claude and Gemini
|
|
57
|
+
- **BaseCLIApp Simplification**:
|
|
58
|
+
- Constructor-based configuration instead of method overrides
|
|
59
|
+
- `AppInfo` is now a constructor parameter
|
|
60
|
+
|
|
61
|
+
### Fixed
|
|
62
|
+
|
|
63
|
+
- LangGraph no longer requires `langchain-google-vertexai` package
|
|
64
|
+
- Explicit provider detection prevents VertexAI initialization errors
|
|
65
|
+
|
|
8
66
|
## [0.2.0] - 2025-01-25
|
|
9
67
|
|
|
10
68
|
### Added
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: agentic-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.1
|
|
4
4
|
Summary: A framework for building domain-specific agentic CLI applications
|
|
5
5
|
Project-URL: Homepage, https://github.com/shoom1/agentic-cli
|
|
6
6
|
Project-URL: Repository, https://github.com/shoom1/agentic-cli
|
|
@@ -60,6 +60,8 @@ Agentic CLI provides the core infrastructure for building interactive CLI applic
|
|
|
60
60
|
│ - Terminal UI (thinking-prompt) │
|
|
61
61
|
│ - Command registry (/help, /status, /clear, etc.) │
|
|
62
62
|
│ - Message history │
|
|
63
|
+
│ - Background initialization (no first-message lag) │
|
|
64
|
+
│ - Task progress display in thinking box │
|
|
63
65
|
└─────────────────────────────────────────────────────────────────────┘
|
|
64
66
|
│
|
|
65
67
|
▼
|
|
@@ -120,8 +122,9 @@ Create a minimal CLI application in just a few lines:
|
|
|
120
122
|
|
|
121
123
|
```python
|
|
122
124
|
import asyncio
|
|
123
|
-
from agentic_cli import BaseCLIApp, BaseSettings
|
|
125
|
+
from agentic_cli import BaseCLIApp, BaseSettings
|
|
124
126
|
from agentic_cli.cli import AppInfo
|
|
127
|
+
from agentic_cli.workflow import AgentConfig
|
|
125
128
|
|
|
126
129
|
# Define your tools
|
|
127
130
|
def greet(name: str) -> dict:
|
|
@@ -137,19 +140,14 @@ AGENTS = [
|
|
|
137
140
|
),
|
|
138
141
|
]
|
|
139
142
|
|
|
140
|
-
# Create your app
|
|
141
|
-
class MyApp(BaseCLIApp):
|
|
142
|
-
def get_app_info(self) -> AppInfo:
|
|
143
|
-
return AppInfo(name="My App", version="0.1.0")
|
|
144
|
-
|
|
145
|
-
def get_settings(self) -> BaseSettings:
|
|
146
|
-
return BaseSettings()
|
|
147
|
-
|
|
148
|
-
def create_workflow_manager(self) -> GoogleADKWorkflowManager:
|
|
149
|
-
return GoogleADKWorkflowManager(agent_configs=AGENTS, settings=self._settings)
|
|
150
|
-
|
|
143
|
+
# Create and run your app
|
|
151
144
|
if __name__ == "__main__":
|
|
152
|
-
|
|
145
|
+
app = BaseCLIApp(
|
|
146
|
+
app_info=AppInfo(name="My App", version="0.1.0"),
|
|
147
|
+
agent_configs=AGENTS,
|
|
148
|
+
settings=BaseSettings(),
|
|
149
|
+
)
|
|
150
|
+
asyncio.run(app.run())
|
|
153
151
|
```
|
|
154
152
|
|
|
155
153
|
Run with your API key:
|
|
@@ -182,20 +180,26 @@ manager = GoogleADKWorkflowManager(
|
|
|
182
180
|
|
|
183
181
|
Uses LangGraph for orchestration. Best for:
|
|
184
182
|
- Cyclical workflows (self-validation, iterative refinement)
|
|
185
|
-
- Model-agnostic operation (OpenAI, Anthropic, Google)
|
|
183
|
+
- Model-agnostic operation (OpenAI, Anthropic, Google via GenAI)
|
|
186
184
|
- State checkpointing and time-travel debugging
|
|
187
185
|
- Complex multi-agent coordination
|
|
188
186
|
|
|
189
187
|
```python
|
|
190
|
-
from agentic_cli import LangGraphWorkflowManager
|
|
188
|
+
from agentic_cli.workflow.langgraph import LangGraphWorkflowManager
|
|
191
189
|
|
|
192
190
|
manager = LangGraphWorkflowManager(
|
|
193
191
|
agent_configs=AGENTS,
|
|
194
192
|
settings=settings,
|
|
195
|
-
checkpointer="memory", #
|
|
193
|
+
checkpointer="memory", # "memory", "postgres", "sqlite", or None
|
|
196
194
|
)
|
|
197
195
|
```
|
|
198
196
|
|
|
197
|
+
Features:
|
|
198
|
+
- **Explicit provider support**: Uses `langchain-google-genai` for Gemini (not VertexAI)
|
|
199
|
+
- **Thinking mode**: Native support for Claude and Gemini thinking/reasoning
|
|
200
|
+
- **Retry policies**: Automatic retry with exponential backoff
|
|
201
|
+
- **Event streaming**: Real-time workflow events via `WorkflowEvent`
|
|
202
|
+
|
|
199
203
|
Requires: `pip install agentic-cli[langgraph]`
|
|
200
204
|
|
|
201
205
|
### Comparison
|
|
@@ -204,9 +208,10 @@ Requires: `pip install agentic-cli[langgraph]`
|
|
|
204
208
|
|---------|------------|-----------|
|
|
205
209
|
| Setup complexity | Simple | Moderate |
|
|
206
210
|
| Cyclical workflows | Limited | Native |
|
|
207
|
-
| Multi-provider | Google only | OpenAI, Anthropic, Google |
|
|
208
|
-
| State persistence | In-memory | Memory or
|
|
209
|
-
| Thinking support | Native (Gemini) |
|
|
211
|
+
| Multi-provider | Google only | OpenAI, Anthropic, Google (GenAI) |
|
|
212
|
+
| State persistence | In-memory | Memory, PostgreSQL, or SQLite |
|
|
213
|
+
| Thinking support | Native (Gemini) | Native (Claude & Gemini) |
|
|
214
|
+
| Retry handling | Manual | Built-in with backoff |
|
|
210
215
|
|
|
211
216
|
### Auto-selection via Settings
|
|
212
217
|
|
|
@@ -427,6 +432,7 @@ WorkflowEvent types for UI integration:
|
|
|
427
432
|
| `CODE_EXECUTION` | Code execution result | outcome |
|
|
428
433
|
| `ERROR` | Error message | recoverable, error_code |
|
|
429
434
|
| `USER_INPUT_REQUIRED` | Tool needs user input | request_id, prompt |
|
|
435
|
+
| `TASK_PROGRESS` | Task graph update | current_task_description, progress |
|
|
430
436
|
|
|
431
437
|
### Processing Events
|
|
432
438
|
|
|
@@ -442,12 +448,31 @@ async for event in manager.process(message, user_id="user1"):
|
|
|
442
448
|
print(f"Result: {event.metadata['result']}")
|
|
443
449
|
```
|
|
444
450
|
|
|
451
|
+
### Task Progress Display
|
|
452
|
+
|
|
453
|
+
When using a task graph for planning, the CLI thinking box dynamically shows task progress:
|
|
454
|
+
|
|
455
|
+
```
|
|
456
|
+
Calling: search_web
|
|
457
|
+
─── Tasks: 2/5 ───
|
|
458
|
+
◐ Researching topic
|
|
459
|
+
☐ Analyzing results
|
|
460
|
+
☐ Writing summary
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
Status icons:
|
|
464
|
+
- `◐` In progress
|
|
465
|
+
- `☐` Pending
|
|
466
|
+
- `✓` Completed
|
|
467
|
+
- `✗` Failed
|
|
468
|
+
|
|
445
469
|
## Examples
|
|
446
470
|
|
|
447
471
|
See the `examples/` directory for complete working examples:
|
|
448
472
|
|
|
449
473
|
- **hello_agent.py** - Simple assistant using Google ADK
|
|
450
|
-
- **hello_langgraph.py** - Same assistant using LangGraph
|
|
474
|
+
- **hello_langgraph.py** - Same assistant using LangGraph orchestration
|
|
475
|
+
- **research_demo/** - Full-featured research assistant with memory, planning, and file operations
|
|
451
476
|
|
|
452
477
|
Run examples:
|
|
453
478
|
|
|
@@ -458,6 +483,9 @@ python examples/hello_agent.py
|
|
|
458
483
|
# Or with LangGraph (requires langgraph extra)
|
|
459
484
|
pip install agentic-cli[langgraph]
|
|
460
485
|
python examples/hello_langgraph.py
|
|
486
|
+
|
|
487
|
+
# Research demo (full features)
|
|
488
|
+
python -m examples.research_demo
|
|
461
489
|
```
|
|
462
490
|
|
|
463
491
|
## Development
|
|
@@ -489,14 +517,19 @@ agentic-cli/
|
|
|
489
517
|
│ │ ├── events.py # WorkflowEvent, EventType
|
|
490
518
|
│ │ ├── config.py # AgentConfig
|
|
491
519
|
│ │ ├── adk_manager.py # GoogleADKWorkflowManager
|
|
492
|
-
│ │ └──
|
|
520
|
+
│ │ └── langgraph/ # LangGraph submodule
|
|
521
|
+
│ │ ├── manager.py # LangGraphWorkflowManager
|
|
522
|
+
│ │ ├── state.py # AgentState, CheckpointData
|
|
523
|
+
│ │ ├── persistence/ # Checkpointers and stores
|
|
524
|
+
│ │ └── tools/ # Shell, file search tools
|
|
493
525
|
│ ├── tools/
|
|
494
526
|
│ │ └── executor.py # SafePythonExecutor
|
|
495
527
|
│ └── knowledge_base/
|
|
496
528
|
│ └── manager.py # KnowledgeBaseManager
|
|
497
529
|
├── examples/
|
|
498
530
|
│ ├── hello_agent.py
|
|
499
|
-
│
|
|
531
|
+
│ ├── hello_langgraph.py
|
|
532
|
+
│ └── research_demo/ # Full-featured example
|
|
500
533
|
└── tests/
|
|
501
534
|
```
|
|
502
535
|
|
|
@@ -21,6 +21,8 @@ Agentic CLI provides the core infrastructure for building interactive CLI applic
|
|
|
21
21
|
│ - Terminal UI (thinking-prompt) │
|
|
22
22
|
│ - Command registry (/help, /status, /clear, etc.) │
|
|
23
23
|
│ - Message history │
|
|
24
|
+
│ - Background initialization (no first-message lag) │
|
|
25
|
+
│ - Task progress display in thinking box │
|
|
24
26
|
└─────────────────────────────────────────────────────────────────────┘
|
|
25
27
|
│
|
|
26
28
|
▼
|
|
@@ -81,8 +83,9 @@ Create a minimal CLI application in just a few lines:
|
|
|
81
83
|
|
|
82
84
|
```python
|
|
83
85
|
import asyncio
|
|
84
|
-
from agentic_cli import BaseCLIApp, BaseSettings
|
|
86
|
+
from agentic_cli import BaseCLIApp, BaseSettings
|
|
85
87
|
from agentic_cli.cli import AppInfo
|
|
88
|
+
from agentic_cli.workflow import AgentConfig
|
|
86
89
|
|
|
87
90
|
# Define your tools
|
|
88
91
|
def greet(name: str) -> dict:
|
|
@@ -98,19 +101,14 @@ AGENTS = [
|
|
|
98
101
|
),
|
|
99
102
|
]
|
|
100
103
|
|
|
101
|
-
# Create your app
|
|
102
|
-
class MyApp(BaseCLIApp):
|
|
103
|
-
def get_app_info(self) -> AppInfo:
|
|
104
|
-
return AppInfo(name="My App", version="0.1.0")
|
|
105
|
-
|
|
106
|
-
def get_settings(self) -> BaseSettings:
|
|
107
|
-
return BaseSettings()
|
|
108
|
-
|
|
109
|
-
def create_workflow_manager(self) -> GoogleADKWorkflowManager:
|
|
110
|
-
return GoogleADKWorkflowManager(agent_configs=AGENTS, settings=self._settings)
|
|
111
|
-
|
|
104
|
+
# Create and run your app
|
|
112
105
|
if __name__ == "__main__":
|
|
113
|
-
|
|
106
|
+
app = BaseCLIApp(
|
|
107
|
+
app_info=AppInfo(name="My App", version="0.1.0"),
|
|
108
|
+
agent_configs=AGENTS,
|
|
109
|
+
settings=BaseSettings(),
|
|
110
|
+
)
|
|
111
|
+
asyncio.run(app.run())
|
|
114
112
|
```
|
|
115
113
|
|
|
116
114
|
Run with your API key:
|
|
@@ -143,20 +141,26 @@ manager = GoogleADKWorkflowManager(
|
|
|
143
141
|
|
|
144
142
|
Uses LangGraph for orchestration. Best for:
|
|
145
143
|
- Cyclical workflows (self-validation, iterative refinement)
|
|
146
|
-
- Model-agnostic operation (OpenAI, Anthropic, Google)
|
|
144
|
+
- Model-agnostic operation (OpenAI, Anthropic, Google via GenAI)
|
|
147
145
|
- State checkpointing and time-travel debugging
|
|
148
146
|
- Complex multi-agent coordination
|
|
149
147
|
|
|
150
148
|
```python
|
|
151
|
-
from agentic_cli import LangGraphWorkflowManager
|
|
149
|
+
from agentic_cli.workflow.langgraph import LangGraphWorkflowManager
|
|
152
150
|
|
|
153
151
|
manager = LangGraphWorkflowManager(
|
|
154
152
|
agent_configs=AGENTS,
|
|
155
153
|
settings=settings,
|
|
156
|
-
checkpointer="memory", #
|
|
154
|
+
checkpointer="memory", # "memory", "postgres", "sqlite", or None
|
|
157
155
|
)
|
|
158
156
|
```
|
|
159
157
|
|
|
158
|
+
Features:
|
|
159
|
+
- **Explicit provider support**: Uses `langchain-google-genai` for Gemini (not VertexAI)
|
|
160
|
+
- **Thinking mode**: Native support for Claude and Gemini thinking/reasoning
|
|
161
|
+
- **Retry policies**: Automatic retry with exponential backoff
|
|
162
|
+
- **Event streaming**: Real-time workflow events via `WorkflowEvent`
|
|
163
|
+
|
|
160
164
|
Requires: `pip install agentic-cli[langgraph]`
|
|
161
165
|
|
|
162
166
|
### Comparison
|
|
@@ -165,9 +169,10 @@ Requires: `pip install agentic-cli[langgraph]`
|
|
|
165
169
|
|---------|------------|-----------|
|
|
166
170
|
| Setup complexity | Simple | Moderate |
|
|
167
171
|
| Cyclical workflows | Limited | Native |
|
|
168
|
-
| Multi-provider | Google only | OpenAI, Anthropic, Google |
|
|
169
|
-
| State persistence | In-memory | Memory or
|
|
170
|
-
| Thinking support | Native (Gemini) |
|
|
172
|
+
| Multi-provider | Google only | OpenAI, Anthropic, Google (GenAI) |
|
|
173
|
+
| State persistence | In-memory | Memory, PostgreSQL, or SQLite |
|
|
174
|
+
| Thinking support | Native (Gemini) | Native (Claude & Gemini) |
|
|
175
|
+
| Retry handling | Manual | Built-in with backoff |
|
|
171
176
|
|
|
172
177
|
### Auto-selection via Settings
|
|
173
178
|
|
|
@@ -388,6 +393,7 @@ WorkflowEvent types for UI integration:
|
|
|
388
393
|
| `CODE_EXECUTION` | Code execution result | outcome |
|
|
389
394
|
| `ERROR` | Error message | recoverable, error_code |
|
|
390
395
|
| `USER_INPUT_REQUIRED` | Tool needs user input | request_id, prompt |
|
|
396
|
+
| `TASK_PROGRESS` | Task graph update | current_task_description, progress |
|
|
391
397
|
|
|
392
398
|
### Processing Events
|
|
393
399
|
|
|
@@ -403,12 +409,31 @@ async for event in manager.process(message, user_id="user1"):
|
|
|
403
409
|
print(f"Result: {event.metadata['result']}")
|
|
404
410
|
```
|
|
405
411
|
|
|
412
|
+
### Task Progress Display
|
|
413
|
+
|
|
414
|
+
When using a task graph for planning, the CLI thinking box dynamically shows task progress:
|
|
415
|
+
|
|
416
|
+
```
|
|
417
|
+
Calling: search_web
|
|
418
|
+
─── Tasks: 2/5 ───
|
|
419
|
+
◐ Researching topic
|
|
420
|
+
☐ Analyzing results
|
|
421
|
+
☐ Writing summary
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
Status icons:
|
|
425
|
+
- `◐` In progress
|
|
426
|
+
- `☐` Pending
|
|
427
|
+
- `✓` Completed
|
|
428
|
+
- `✗` Failed
|
|
429
|
+
|
|
406
430
|
## Examples
|
|
407
431
|
|
|
408
432
|
See the `examples/` directory for complete working examples:
|
|
409
433
|
|
|
410
434
|
- **hello_agent.py** - Simple assistant using Google ADK
|
|
411
|
-
- **hello_langgraph.py** - Same assistant using LangGraph
|
|
435
|
+
- **hello_langgraph.py** - Same assistant using LangGraph orchestration
|
|
436
|
+
- **research_demo/** - Full-featured research assistant with memory, planning, and file operations
|
|
412
437
|
|
|
413
438
|
Run examples:
|
|
414
439
|
|
|
@@ -419,6 +444,9 @@ python examples/hello_agent.py
|
|
|
419
444
|
# Or with LangGraph (requires langgraph extra)
|
|
420
445
|
pip install agentic-cli[langgraph]
|
|
421
446
|
python examples/hello_langgraph.py
|
|
447
|
+
|
|
448
|
+
# Research demo (full features)
|
|
449
|
+
python -m examples.research_demo
|
|
422
450
|
```
|
|
423
451
|
|
|
424
452
|
## Development
|
|
@@ -450,14 +478,19 @@ agentic-cli/
|
|
|
450
478
|
│ │ ├── events.py # WorkflowEvent, EventType
|
|
451
479
|
│ │ ├── config.py # AgentConfig
|
|
452
480
|
│ │ ├── adk_manager.py # GoogleADKWorkflowManager
|
|
453
|
-
│ │ └──
|
|
481
|
+
│ │ └── langgraph/ # LangGraph submodule
|
|
482
|
+
│ │ ├── manager.py # LangGraphWorkflowManager
|
|
483
|
+
│ │ ├── state.py # AgentState, CheckpointData
|
|
484
|
+
│ │ ├── persistence/ # Checkpointers and stores
|
|
485
|
+
│ │ └── tools/ # Shell, file search tools
|
|
454
486
|
│ ├── tools/
|
|
455
487
|
│ │ └── executor.py # SafePythonExecutor
|
|
456
488
|
│ └── knowledge_base/
|
|
457
489
|
│ └── manager.py # KnowledgeBaseManager
|
|
458
490
|
├── examples/
|
|
459
491
|
│ ├── hello_agent.py
|
|
460
|
-
│
|
|
492
|
+
│ ├── hello_langgraph.py
|
|
493
|
+
│ └── research_demo/ # Full-featured example
|
|
461
494
|
└── tests/
|
|
462
495
|
```
|
|
463
496
|
|
|
@@ -15,8 +15,7 @@ from pydantic_settings import SettingsConfigDict
|
|
|
15
15
|
|
|
16
16
|
from agentic_cli import BaseCLIApp, BaseSettings
|
|
17
17
|
from agentic_cli.cli import AppInfo
|
|
18
|
-
from agentic_cli.
|
|
19
|
-
from agentic_cli.workflow import AgentConfig, GoogleADKWorkflowManager
|
|
18
|
+
from agentic_cli.workflow import AgentConfig
|
|
20
19
|
|
|
21
20
|
|
|
22
21
|
# =============================================================================
|
|
@@ -83,26 +82,24 @@ AGENT_CONFIGS = [
|
|
|
83
82
|
]
|
|
84
83
|
|
|
85
84
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
def get_settings(self) -> Settings:
|
|
100
|
-
return get_settings()
|
|
101
|
-
|
|
102
|
-
def create_workflow_manager(self) -> GoogleADKWorkflowManager:
|
|
103
|
-
set_settings(self._settings)
|
|
104
|
-
return GoogleADKWorkflowManager(agent_configs=AGENT_CONFIGS, settings=self._settings)
|
|
85
|
+
def _create_app_info() -> AppInfo:
|
|
86
|
+
"""Create the application info for the welcome message."""
|
|
87
|
+
text = Text()
|
|
88
|
+
text.append("Hello Agent\n\n", style="bold cyan")
|
|
89
|
+
text.append("Tools: get_current_time, calculate, echo\n", style="dim")
|
|
90
|
+
text.append("Type /help for commands", style="dim")
|
|
91
|
+
return AppInfo(
|
|
92
|
+
name="Hello Agent",
|
|
93
|
+
version="0.1.0",
|
|
94
|
+
welcome_message=lambda: Panel(text, border_style="cyan"),
|
|
95
|
+
echo_thinking=False,
|
|
96
|
+
)
|
|
105
97
|
|
|
106
98
|
|
|
107
99
|
if __name__ == "__main__":
|
|
108
|
-
|
|
100
|
+
app = BaseCLIApp(
|
|
101
|
+
app_info=_create_app_info(),
|
|
102
|
+
agent_configs=AGENT_CONFIGS,
|
|
103
|
+
settings=get_settings(),
|
|
104
|
+
)
|
|
105
|
+
asyncio.run(app.run())
|
|
@@ -22,9 +22,7 @@ from pydantic_settings import SettingsConfigDict
|
|
|
22
22
|
|
|
23
23
|
from agentic_cli import BaseCLIApp, BaseSettings
|
|
24
24
|
from agentic_cli.cli import AppInfo
|
|
25
|
-
from agentic_cli.config import set_settings
|
|
26
25
|
from agentic_cli.workflow import AgentConfig
|
|
27
|
-
from agentic_cli.workflow.langgraph_manager import LangGraphWorkflowManager
|
|
28
26
|
|
|
29
27
|
|
|
30
28
|
# =============================================================================
|
|
@@ -100,33 +98,25 @@ AGENT_CONFIGS = [
|
|
|
100
98
|
# Application
|
|
101
99
|
# =============================================================================
|
|
102
100
|
|
|
103
|
-
|
|
104
|
-
"""
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
echo_thinking=False,
|
|
117
|
-
)
|
|
118
|
-
|
|
119
|
-
def get_settings(self) -> Settings:
|
|
120
|
-
return get_settings()
|
|
121
|
-
|
|
122
|
-
def create_workflow_manager(self) -> LangGraphWorkflowManager:
|
|
123
|
-
set_settings(self._settings)
|
|
124
|
-
return LangGraphWorkflowManager(
|
|
125
|
-
agent_configs=AGENT_CONFIGS,
|
|
126
|
-
settings=self._settings,
|
|
127
|
-
checkpointer="memory", # Use in-memory checkpointing
|
|
128
|
-
)
|
|
101
|
+
def _create_app_info() -> AppInfo:
|
|
102
|
+
"""Create the application info for the welcome message."""
|
|
103
|
+
text = Text()
|
|
104
|
+
text.append("Hello LangGraph\n\n", style="bold magenta")
|
|
105
|
+
text.append("Orchestrator: LangGraph\n", style="dim")
|
|
106
|
+
text.append("Tools: get_current_time, calculate, echo\n", style="dim")
|
|
107
|
+
text.append("Type /help for commands", style="dim")
|
|
108
|
+
return AppInfo(
|
|
109
|
+
name="Hello LangGraph",
|
|
110
|
+
version="0.1.0",
|
|
111
|
+
welcome_message=lambda: Panel(text, border_style="magenta"),
|
|
112
|
+
echo_thinking=False,
|
|
113
|
+
)
|
|
129
114
|
|
|
130
115
|
|
|
131
116
|
if __name__ == "__main__":
|
|
132
|
-
|
|
117
|
+
app = BaseCLIApp(
|
|
118
|
+
app_info=_create_app_info(),
|
|
119
|
+
agent_configs=AGENT_CONFIGS,
|
|
120
|
+
settings=get_settings(),
|
|
121
|
+
)
|
|
122
|
+
asyncio.run(app.run())
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
# Research Demo
|
|
2
|
+
|
|
3
|
+
A demonstration CLI application showcasing all P0/P1 features of the agentic-cli framework.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
The Research Demo is a research assistant that helps you explore topics while demonstrating:
|
|
8
|
+
|
|
9
|
+
- **Memory System**: Session-scoped working memory + persistent long-term memory
|
|
10
|
+
- **Task Planning**: Hierarchical task graphs with dependencies
|
|
11
|
+
- **File Operations**: Save, read, and compare research findings
|
|
12
|
+
- **Shell Commands**: Safe command execution with blocking of dangerous patterns
|
|
13
|
+
- **Human-in-the-Loop (HITL)**: Approval gates and review checkpoints
|
|
14
|
+
|
|
15
|
+
## Running the Demo
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# From the project root
|
|
19
|
+
conda run -n agenticcli python -m examples.research_demo
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Features
|
|
23
|
+
|
|
24
|
+
### Memory
|
|
25
|
+
|
|
26
|
+
The agent can store and recall information across two tiers:
|
|
27
|
+
|
|
28
|
+
**Working Memory (Session)**
|
|
29
|
+
- Stores context for the current session
|
|
30
|
+
- Cleared when the app exits
|
|
31
|
+
- Use `/memory` to view current state
|
|
32
|
+
|
|
33
|
+
**Long-term Memory (Persistent)**
|
|
34
|
+
- Stores learnings, facts, preferences, and references
|
|
35
|
+
- Persists to `~/.research_demo/memory/longterm.json`
|
|
36
|
+
- Survives across sessions
|
|
37
|
+
|
|
38
|
+
### Planning
|
|
39
|
+
|
|
40
|
+
The agent can create structured research plans:
|
|
41
|
+
|
|
42
|
+
- Tasks with descriptions and dependencies
|
|
43
|
+
- Status tracking (pending, in_progress, completed, failed)
|
|
44
|
+
- Visual progress display via `/plan` command
|
|
45
|
+
|
|
46
|
+
### File Operations
|
|
47
|
+
|
|
48
|
+
- Save research findings to `~/.research_demo/findings/`
|
|
49
|
+
- Compare document versions with diff
|
|
50
|
+
- List and read saved files
|
|
51
|
+
|
|
52
|
+
### Shell Commands
|
|
53
|
+
|
|
54
|
+
- Run safe shell commands (ls, cat, grep, etc.)
|
|
55
|
+
- Dangerous commands are blocked (rm -rf, etc.)
|
|
56
|
+
- Timeout protection (30 seconds default)
|
|
57
|
+
|
|
58
|
+
### HITL
|
|
59
|
+
|
|
60
|
+
- Approval rules for sensitive operations
|
|
61
|
+
- Auto-approve patterns for safe commands
|
|
62
|
+
- Checkpoints for reviewing agent outputs
|
|
63
|
+
|
|
64
|
+
## Commands
|
|
65
|
+
|
|
66
|
+
| Command | Aliases | Description |
|
|
67
|
+
|---------|---------|-------------|
|
|
68
|
+
| `/memory` | `/mem`, `/m` | Show working and long-term memory |
|
|
69
|
+
| `/plan` | `/tasks`, `/p` | Show current task graph |
|
|
70
|
+
| `/files` | `/ls`, `/f` | List files in workspace |
|
|
71
|
+
| `/approvals` | `/approve`, `/a` | Show pending approvals |
|
|
72
|
+
| `/checkpoints` | `/cp`, `/review` | Show checkpoints awaiting review |
|
|
73
|
+
| `/clear-memory` | `/clearmem` | Clear working memory |
|
|
74
|
+
| `/clear-plan` | `/clearplan` | Clear task plan |
|
|
75
|
+
| `/help` | `/h`, `/?` | Show all commands |
|
|
76
|
+
| `/settings` | `/s` | View/change settings |
|
|
77
|
+
| `/exit` | `/quit`, `/q` | Exit the application |
|
|
78
|
+
|
|
79
|
+
## Example Session
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
>>> Research the history of Python programming language
|
|
83
|
+
|
|
84
|
+
[Agent creates a task plan, stores context, and begins researching]
|
|
85
|
+
|
|
86
|
+
>>> /plan
|
|
87
|
+
|
|
88
|
+
Progress: 2/5 completed, 1 in progress
|
|
89
|
+
|
|
90
|
+
✓ Gather initial sources
|
|
91
|
+
✓ Review key events (depends on: Gather initial)
|
|
92
|
+
◐ Document milestones (depends on: Review key events)
|
|
93
|
+
☐ Write summary (depends on: Document milestones)
|
|
94
|
+
☐ Create final report (depends on: Write summary)
|
|
95
|
+
|
|
96
|
+
>>> /memory
|
|
97
|
+
|
|
98
|
+
Working Memory (Session)
|
|
99
|
+
┌─────────────────┬───────────────────────┬─────────┐
|
|
100
|
+
│ Key │ Value │ Tags │
|
|
101
|
+
├─────────────────┼───────────────────────┼─────────┤
|
|
102
|
+
│ research_topic │ Python history │ planning│
|
|
103
|
+
│ current_task │ Document milestones │ │
|
|
104
|
+
└─────────────────┴───────────────────────┴─────────┘
|
|
105
|
+
|
|
106
|
+
Long-term Memory (Persistent)
|
|
107
|
+
┌──────────┬──────────┬────────────────────────────────────────────┬──────┐
|
|
108
|
+
│ ID │ Type │ Content │ Tags │
|
|
109
|
+
├──────────┼──────────┼────────────────────────────────────────────┼──────┤
|
|
110
|
+
│ a1b2c3d4 │ fact │ Python was created by Guido van Rossum... │ │
|
|
111
|
+
│ e5f6g7h8 │ learning │ Python 2.0 introduced list comprehensions │ │
|
|
112
|
+
└──────────┴──────────┴────────────────────────────────────────────┴──────┘
|
|
113
|
+
|
|
114
|
+
>>> /files
|
|
115
|
+
|
|
116
|
+
Files in findings/
|
|
117
|
+
┌─────────────────────────┬──────┬─────────────┐
|
|
118
|
+
│ Name │ Type │ Size │
|
|
119
|
+
├─────────────────────────┼──────┼─────────────┤
|
|
120
|
+
│ python_history_draft.md │ file │ 2,456 bytes │
|
|
121
|
+
│ key_milestones.txt │ file │ 1,234 bytes │
|
|
122
|
+
└─────────────────────────┴──────┴─────────────┘
|
|
123
|
+
Total: 2 items
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Architecture
|
|
127
|
+
|
|
128
|
+
```
|
|
129
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
130
|
+
│ ResearchDemoApp │
|
|
131
|
+
│ (extends BaseCLIApp) │
|
|
132
|
+
├─────────────────────────────────────────────────────────────┤
|
|
133
|
+
│ Commands: │ Agent Tools: │
|
|
134
|
+
│ /memory - show memory state │ remember_context() │
|
|
135
|
+
│ /plan - show task graph │ recall_info() │
|
|
136
|
+
│ /approvals - pending list │ create_research_plan() │
|
|
137
|
+
│ /checkpoints - review list │ update_task_status() │
|
|
138
|
+
│ /files - list artifacts │ save_finding() │
|
|
139
|
+
│ /clear-memory │ compare_versions() │
|
|
140
|
+
│ /clear-plan │ run_safe_command() │
|
|
141
|
+
└─────────────────────────────────────────────────────────────┘
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Configuration
|
|
145
|
+
|
|
146
|
+
Settings are loaded from environment variables or `~/.research_demo/.env`:
|
|
147
|
+
|
|
148
|
+
- `GOOGLE_API_KEY` or `ANTHROPIC_API_KEY` - LLM provider API key
|
|
149
|
+
- `RESEARCH_DEMO_WORKSPACE_DIR` - Workspace directory (default: `~/.research_demo`)
|
|
150
|
+
|
|
151
|
+
## Files
|
|
152
|
+
|
|
153
|
+
| File | Purpose |
|
|
154
|
+
|------|---------|
|
|
155
|
+
| `app.py` | Main CLI application class |
|
|
156
|
+
| `settings.py` | Demo app settings |
|
|
157
|
+
| `agents.py` | Agent configuration with tools |
|
|
158
|
+
| `tools.py` | Tools wrapping new features |
|
|
159
|
+
| `commands.py` | Status commands |
|
|
160
|
+
| `__main__.py` | Entry point |
|