agentic-cli 0.1.2__tar.gz → 0.3.0__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.
Files changed (106) hide show
  1. agentic_cli-0.3.0/CHANGELOG.md +127 -0
  2. agentic_cli-0.3.0/PKG-INFO +517 -0
  3. agentic_cli-0.3.0/README.md +478 -0
  4. {agentic_cli-0.1.2 → agentic_cli-0.3.0}/examples/hello_agent.py +24 -23
  5. agentic_cli-0.3.0/examples/hello_langgraph.py +122 -0
  6. agentic_cli-0.3.0/examples/research_demo/README.md +160 -0
  7. agentic_cli-0.3.0/examples/research_demo/__init__.py +21 -0
  8. agentic_cli-0.3.0/examples/research_demo/__main__.py +18 -0
  9. agentic_cli-0.3.0/examples/research_demo/agents.py +165 -0
  10. agentic_cli-0.3.0/examples/research_demo/app.py +233 -0
  11. agentic_cli-0.3.0/examples/research_demo/commands.py +359 -0
  12. agentic_cli-0.3.0/examples/research_demo/settings.py +46 -0
  13. agentic_cli-0.3.0/examples/research_demo/tools.py +139 -0
  14. {agentic_cli-0.1.2 → agentic_cli-0.3.0}/pyproject.toml +9 -1
  15. {agentic_cli-0.1.2 → agentic_cli-0.3.0}/src/agentic_cli/__init__.py +26 -7
  16. {agentic_cli-0.1.2 → agentic_cli-0.3.0}/src/agentic_cli/cli/__init__.py +2 -0
  17. {agentic_cli-0.1.2 → agentic_cli-0.3.0}/src/agentic_cli/cli/app.py +247 -54
  18. agentic_cli-0.3.0/src/agentic_cli/cli/builtin_commands.py +115 -0
  19. agentic_cli-0.3.0/src/agentic_cli/cli/settings.py +50 -0
  20. agentic_cli-0.3.0/src/agentic_cli/cli/settings_command.py +63 -0
  21. agentic_cli-0.3.0/src/agentic_cli/cli/settings_introspection.py +180 -0
  22. {agentic_cli-0.1.2 → agentic_cli-0.3.0}/src/agentic_cli/config.py +129 -50
  23. agentic_cli-0.3.0/src/agentic_cli/config_mixins.py +119 -0
  24. agentic_cli-0.3.0/src/agentic_cli/hitl/__init__.py +29 -0
  25. agentic_cli-0.3.0/src/agentic_cli/hitl/approval.py +226 -0
  26. agentic_cli-0.3.0/src/agentic_cli/hitl/checkpoints.py +149 -0
  27. agentic_cli-0.3.0/src/agentic_cli/hitl/config.py +47 -0
  28. agentic_cli-0.3.0/src/agentic_cli/memory/__init__.py +28 -0
  29. agentic_cli-0.3.0/src/agentic_cli/memory/longterm.py +302 -0
  30. agentic_cli-0.3.0/src/agentic_cli/memory/manager.py +139 -0
  31. agentic_cli-0.3.0/src/agentic_cli/memory/tools.py +251 -0
  32. agentic_cli-0.3.0/src/agentic_cli/memory/working.py +121 -0
  33. agentic_cli-0.3.0/src/agentic_cli/planning/__init__.py +27 -0
  34. agentic_cli-0.3.0/src/agentic_cli/planning/task_graph.py +391 -0
  35. agentic_cli-0.3.0/src/agentic_cli/settings_persistence.py +127 -0
  36. agentic_cli-0.3.0/src/agentic_cli/tools/__init__.py +135 -0
  37. agentic_cli-0.3.0/src/agentic_cli/tools/file_ops.py +358 -0
  38. agentic_cli-0.3.0/src/agentic_cli/tools/hitl_tools.py +212 -0
  39. agentic_cli-0.3.0/src/agentic_cli/tools/memory_tools.py +199 -0
  40. agentic_cli-0.3.0/src/agentic_cli/tools/planning_tools.py +281 -0
  41. {agentic_cli-0.1.2 → agentic_cli-0.3.0}/src/agentic_cli/tools/registry.py +3 -0
  42. agentic_cli-0.3.0/src/agentic_cli/tools/shell.py +181 -0
  43. {agentic_cli-0.1.2 → agentic_cli-0.3.0}/src/agentic_cli/tools/standard.py +1 -1
  44. agentic_cli-0.3.0/src/agentic_cli/workflow/__init__.py +92 -0
  45. agentic_cli-0.3.0/src/agentic_cli/workflow/adk/__init__.py +18 -0
  46. agentic_cli-0.1.2/src/agentic_cli/workflow/manager.py → agentic_cli-0.3.0/src/agentic_cli/workflow/adk_manager.py +254 -152
  47. agentic_cli-0.3.0/src/agentic_cli/workflow/base_manager.py +335 -0
  48. {agentic_cli-0.1.2 → agentic_cli-0.3.0}/src/agentic_cli/workflow/config.py +2 -2
  49. agentic_cli-0.3.0/src/agentic_cli/workflow/context.py +90 -0
  50. agentic_cli-0.3.0/src/agentic_cli/workflow/langgraph/__init__.py +42 -0
  51. agentic_cli-0.3.0/src/agentic_cli/workflow/langgraph/manager.py +850 -0
  52. agentic_cli-0.3.0/src/agentic_cli/workflow/langgraph/persistence/__init__.py +21 -0
  53. agentic_cli-0.3.0/src/agentic_cli/workflow/langgraph/persistence/checkpointers.py +152 -0
  54. agentic_cli-0.3.0/src/agentic_cli/workflow/langgraph/persistence/stores.py +159 -0
  55. agentic_cli-0.3.0/src/agentic_cli/workflow/langgraph/state.py +181 -0
  56. agentic_cli-0.3.0/src/agentic_cli/workflow/langgraph/tools/__init__.py +28 -0
  57. agentic_cli-0.3.0/src/agentic_cli/workflow/langgraph/tools/file_search.py +251 -0
  58. agentic_cli-0.3.0/src/agentic_cli/workflow/langgraph/tools/shell.py +364 -0
  59. agentic_cli-0.3.0/src/agentic_cli/workflow/langgraph_manager.py +34 -0
  60. agentic_cli-0.3.0/src/agentic_cli/workflow/langgraph_state.py +54 -0
  61. agentic_cli-0.3.0/src/agentic_cli/workflow/settings.py +152 -0
  62. {agentic_cli-0.1.2 → agentic_cli-0.3.0}/tests/test_config.py +22 -0
  63. agentic_cli-0.3.0/tests/test_hitl.py +250 -0
  64. agentic_cli-0.3.0/tests/test_langgraph.py +611 -0
  65. agentic_cli-0.3.0/tests/test_memory.py +596 -0
  66. agentic_cli-0.3.0/tests/test_planning.py +359 -0
  67. agentic_cli-0.3.0/tests/test_tools.py +1114 -0
  68. {agentic_cli-0.1.2 → agentic_cli-0.3.0}/tests/test_workflow.py +29 -29
  69. agentic_cli-0.1.2/CHANGELOG.md +0 -59
  70. agentic_cli-0.1.2/PKG-INFO +0 -72
  71. agentic_cli-0.1.2/README.md +0 -40
  72. agentic_cli-0.1.2/src/agentic_cli/cli/builtin_commands.py +0 -262
  73. agentic_cli-0.1.2/src/agentic_cli/cli/settings_command.py +0 -68
  74. agentic_cli-0.1.2/src/agentic_cli/config_mixins.py +0 -123
  75. agentic_cli-0.1.2/src/agentic_cli/tools/__init__.py +0 -62
  76. agentic_cli-0.1.2/src/agentic_cli/workflow/__init__.py +0 -48
  77. agentic_cli-0.1.2/src/agentic_cli/workflow/event_processor.py +0 -175
  78. agentic_cli-0.1.2/src/agentic_cli/workflow/memory.py +0 -164
  79. agentic_cli-0.1.2/src/agentic_cli/workflow/retry.py +0 -168
  80. agentic_cli-0.1.2/src/agentic_cli/workflow/session_handler.py +0 -93
  81. agentic_cli-0.1.2/tests/test_tools.py +0 -605
  82. {agentic_cli-0.1.2 → agentic_cli-0.3.0}/.gitignore +0 -0
  83. {agentic_cli-0.1.2 → agentic_cli-0.3.0}/LICENSE +0 -0
  84. {agentic_cli-0.1.2 → agentic_cli-0.3.0}/environment.yml +0 -0
  85. {agentic_cli-0.1.2 → agentic_cli-0.3.0}/requirements-dev.txt +0 -0
  86. {agentic_cli-0.1.2 → agentic_cli-0.3.0}/requirements.txt +0 -0
  87. {agentic_cli-0.1.2 → agentic_cli-0.3.0}/src/agentic_cli/cli/commands.py +0 -0
  88. {agentic_cli-0.1.2 → agentic_cli-0.3.0}/src/agentic_cli/knowledge_base/__init__.py +0 -0
  89. {agentic_cli-0.1.2 → agentic_cli-0.3.0}/src/agentic_cli/knowledge_base/embeddings.py +0 -0
  90. {agentic_cli-0.1.2 → agentic_cli-0.3.0}/src/agentic_cli/knowledge_base/manager.py +0 -0
  91. {agentic_cli-0.1.2 → agentic_cli-0.3.0}/src/agentic_cli/knowledge_base/models.py +0 -0
  92. {agentic_cli-0.1.2 → agentic_cli-0.3.0}/src/agentic_cli/knowledge_base/sources.py +0 -0
  93. {agentic_cli-0.1.2 → agentic_cli-0.3.0}/src/agentic_cli/knowledge_base/vector_store.py +0 -0
  94. {agentic_cli-0.1.2 → agentic_cli-0.3.0}/src/agentic_cli/logging.py +0 -0
  95. {agentic_cli-0.1.2 → agentic_cli-0.3.0}/src/agentic_cli/persistence/__init__.py +0 -0
  96. {agentic_cli-0.1.2 → agentic_cli-0.3.0}/src/agentic_cli/persistence/artifacts.py +0 -0
  97. {agentic_cli-0.1.2 → agentic_cli-0.3.0}/src/agentic_cli/persistence/session.py +0 -0
  98. {agentic_cli-0.1.2 → agentic_cli-0.3.0}/src/agentic_cli/resolvers.py +0 -0
  99. {agentic_cli-0.1.2 → agentic_cli-0.3.0}/src/agentic_cli/tools/executor.py +0 -0
  100. {agentic_cli-0.1.2 → agentic_cli-0.3.0}/src/agentic_cli/workflow/events.py +0 -0
  101. {agentic_cli-0.1.2 → agentic_cli-0.3.0}/src/agentic_cli/workflow/thinking.py +0 -0
  102. {agentic_cli-0.1.2 → agentic_cli-0.3.0}/tests/__init__.py +0 -0
  103. {agentic_cli-0.1.2 → agentic_cli-0.3.0}/tests/conftest.py +0 -0
  104. {agentic_cli-0.1.2 → agentic_cli-0.3.0}/tests/test_commands.py +0 -0
  105. {agentic_cli-0.1.2 → agentic_cli-0.3.0}/tests/test_knowledge_base.py +0 -0
  106. {agentic_cli-0.1.2 → agentic_cli-0.3.0}/tests/test_persistence.py +0 -0
@@ -0,0 +1,127 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.3.0] - 2025-01-27
9
+
10
+ ### Added
11
+
12
+ - **Memory System** with 3-tier architecture:
13
+ - `WorkingMemory` - Session-scoped context with tags and serialization
14
+ - `LongTermMemory` - Persistent memory with knowledge base references
15
+ - `MemoryManager` - Unified interface for working and long-term memory
16
+ - Memory tools (`working_memory_tool`, `long_term_memory_tool`)
17
+ - **Planning System**:
18
+ - `TaskGraph` - Work plan management with dependencies and status tracking
19
+ - `TaskStatus` enum for pending/in_progress/completed/blocked states
20
+ - `Task` dataclass with subtasks, dependencies, and metadata
21
+ - **Human-in-the-Loop (HITL) System**:
22
+ - `ApprovalManager` - Configurable approval gates with auto-approve patterns
23
+ - `CheckpointManager` - Review checkpoints with continue/edit/regenerate/abort actions
24
+ - `HITLConfig` and `ApprovalRule` for configuration
25
+ - **New Tools**:
26
+ - `shell_executor` with safety controls (blocks dangerous commands)
27
+ - `file_manager` with read/write/list/copy/move/delete operations
28
+ - `diff_compare` with unified/side-by-side/summary modes
29
+ - New tool categories: `MEMORY`, `PLANNING`, `SYSTEM`
30
+ - Framework-provided tools with auto-detection
31
+ - Layered JSON settings persistence with organized mixins
32
+ - `research_demo` example showcasing memory, planning, and file operations
33
+
34
+ ### Changed
35
+
36
+ - **LangGraph Module Reorganization**:
37
+ - Moved to dedicated `workflow/langgraph/` submodule
38
+ - Added `persistence/` for checkpointers and stores
39
+ - Added `tools/` for shell and file search utilities
40
+ - **Simplified LangGraphWorkflowManager**:
41
+ - Removed dead middleware module (~400 lines)
42
+ - Use explicit provider instantiation (GenAI for Gemini, not VertexAI)
43
+ - Simplified model creation with thinking support for Claude and Gemini
44
+ - **BaseCLIApp Simplification**:
45
+ - Constructor-based configuration instead of method overrides
46
+ - `AppInfo` is now a constructor parameter
47
+
48
+ ### Fixed
49
+
50
+ - LangGraph no longer requires `langchain-google-vertexai` package
51
+ - Explicit provider detection prevents VertexAI initialization errors
52
+
53
+ ## [0.2.0] - 2025-01-25
54
+
55
+ ### Added
56
+
57
+ - LangGraph as pluggable orchestration backend (`LangGraphWorkflowManager`)
58
+ - `create_workflow_manager_from_settings()` factory function for auto-selecting orchestrator
59
+ - Thinking level support for LangGraphWorkflowManager (Anthropic and Google models)
60
+ - `log_activity` setting for optional conversation activity logging
61
+ - `hello_langgraph.py` example demonstrating LangGraph orchestration
62
+ - Comprehensive README documentation with architecture, examples, and API reference
63
+
64
+ ### Changed
65
+
66
+ - Renamed `WorkflowManager` to `GoogleADKWorkflowManager` for clarity
67
+ - Replaced custom retry logic with framework built-in mechanisms (ADK HttpRetryOptions, LangGraph RetryPolicy)
68
+ - Removed `ConversationMemory` in favor of native framework session/state management
69
+ - Gemini 3 Pro thinking level now falls back to HIGH when MEDIUM is requested (Pro only supports LOW/HIGH)
70
+
71
+ ### Fixed
72
+
73
+ - LangGraph compatibility issues with content block extraction
74
+ - Thinking level configuration for Gemini 3 Pro models
75
+
76
+ ## [0.1.2] - 2026-01-24
77
+
78
+ ### Added
79
+
80
+ - Added `apply_settings()` method to `BaseCLIApp` for centralized settings application
81
+ - Added `settings_command.py` module for cleaner separation of concerns
82
+ - Added `resolvers.py` with centralized model/embedding resolution logic
83
+ - Added `config_mixins.py` with reusable config traits (ModelConfigMixin, EmbeddingConfigMixin)
84
+ - Added `workflow/event_processor.py` for focused event handling
85
+ - Added `workflow/session_handler.py` for session management
86
+ - Added `workflow/retry.py` for retry logic with backoff
87
+ - Added `workflow/memory.py` for conversation memory management
88
+ - Added `SlashCommandCompleter` for improved CLI autocomplete (only triggers on `/`)
89
+
90
+ ### Changed
91
+
92
+ - Refactored `SettingsCommand` to use `SettingsDialog` with `DropdownItem` and `InlineSelectItem`
93
+ - Extracted `SettingsCommand` from `builtin_commands.py` to dedicated `settings_command.py`
94
+ - Refactored `WorkflowManager` into focused helper classes
95
+ - Moved `llm/thinking.py` to `workflow/thinking.py`
96
+ - Settings dialog now shows descriptions for model and thinking effort options
97
+ - CLI now uses `complete_while_typing` for responsive autocomplete
98
+ - Sorted command completions alphabetically
99
+
100
+ ### Fixed
101
+
102
+ - Fixed settings dialog display issues (cursor position, screen artifacts)
103
+
104
+ ### Removed
105
+
106
+ - Removed `tools/resilience.py` (unused retry/circuit breaker code)
107
+ - Removed `tools/search.py` (unused web search client - use `google_search_tool` from ADK)
108
+ - Removed `WebSearchSource` from knowledge_base (use `google_search_tool` directly)
109
+ - Removed `llm/` package (consolidated into workflow)
110
+ - Removed short command aliases (h, ?, cls, st, q) to reduce completion noise
111
+ - Removed custom `DIALOG_STYLE` in favor of `thinking-prompt` built-in dialog styling
112
+
113
+ ## [0.1.1] - 2025-01-20
114
+
115
+ ### Added
116
+
117
+ - Initial public release with core CLI framework
118
+ - `BaseCLIApp` for building agentic CLI applications
119
+ - `WorkflowManager` for Google ADK integration
120
+ - Knowledge base with vector search
121
+ - Safe Python executor for code execution
122
+
123
+ ## [0.1.0] - 2025-01-15
124
+
125
+ ### Added
126
+
127
+ - Initial development release
@@ -0,0 +1,517 @@
1
+ Metadata-Version: 2.4
2
+ Name: agentic-cli
3
+ Version: 0.3.0
4
+ Summary: A framework for building domain-specific agentic CLI applications
5
+ Project-URL: Homepage, https://github.com/shoom1/agentic-cli
6
+ Project-URL: Repository, https://github.com/shoom1/agentic-cli
7
+ Author: Andrey Shiryaev
8
+ License-Expression: MIT
9
+ License-File: LICENSE
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Requires-Python: >=3.12
17
+ Requires-Dist: feedparser>=6.0.0
18
+ Requires-Dist: google-adk[genai]>=0.4.0
19
+ Requires-Dist: httpx>=0.27.0
20
+ Requires-Dist: numpy>=1.26.0
21
+ Requires-Dist: prompt-toolkit>=3.0.0
22
+ Requires-Dist: pydantic-settings>=2.0.0
23
+ Requires-Dist: pydantic>=2.0.0
24
+ Requires-Dist: rich>=13.0.0
25
+ Requires-Dist: structlog>=24.0.0
26
+ Requires-Dist: thinking-prompt>=0.2.0
27
+ Provides-Extra: dev
28
+ Requires-Dist: pytest-asyncio>=0.24.0; extra == 'dev'
29
+ Requires-Dist: pytest-cov>=6.0.0; extra == 'dev'
30
+ Requires-Dist: pytest>=8.0.0; extra == 'dev'
31
+ Provides-Extra: langgraph
32
+ Requires-Dist: langchain-anthropic>=0.2.0; extra == 'langgraph'
33
+ Requires-Dist: langchain-core>=0.3.0; extra == 'langgraph'
34
+ Requires-Dist: langchain-google-genai>=2.0.0; extra == 'langgraph'
35
+ Requires-Dist: langchain-openai>=0.2.0; extra == 'langgraph'
36
+ Requires-Dist: langchain>=0.3.0; extra == 'langgraph'
37
+ Requires-Dist: langgraph>=0.2.0; extra == 'langgraph'
38
+ Description-Content-Type: text/markdown
39
+
40
+ # Agentic CLI
41
+
42
+ A framework for building domain-specific agentic CLI applications powered by LLM agents.
43
+
44
+ ## Overview
45
+
46
+ Agentic CLI provides the core infrastructure for building interactive CLI applications that leverage LLM agents for complex tasks. It offers:
47
+
48
+ - **Pluggable Orchestration**: Choose between Google ADK or LangGraph for agent workflows
49
+ - **Rich Terminal UI**: Thinking boxes, markdown rendering, and streaming responses via `thinking-prompt`
50
+ - **Declarative Agents**: Define agents with simple configuration objects
51
+ - **Built-in Tools**: Python execution, knowledge base search, web search
52
+ - **Session Persistence**: Save and restore conversation sessions
53
+ - **Type-safe Configuration**: Settings management with pydantic-settings
54
+
55
+ ## Architecture
56
+
57
+ ```
58
+ ┌─────────────────────────────────────────────────────────────────────┐
59
+ │ BaseCLIApp │
60
+ │ - Terminal UI (thinking-prompt) │
61
+ │ - Command registry (/help, /status, /clear, etc.) │
62
+ │ - Message history │
63
+ └─────────────────────────────────────────────────────────────────────┘
64
+
65
+
66
+ ┌─────────────────────────────────────────────────────────────────────┐
67
+ │ BaseWorkflowManager │
68
+ │ - Agent orchestration │
69
+ │ - Event streaming │
70
+ │ - Session management │
71
+ ├─────────────────────────────┬───────────────────────────────────────┤
72
+ │ GoogleADKWorkflowManager │ LangGraphWorkflowManager │
73
+ │ (Default) │ (Optional: langgraph extra) │
74
+ └─────────────────────────────┴───────────────────────────────────────┘
75
+
76
+
77
+ ┌─────────────────────────────────────────────────────────────────────┐
78
+ │ AgentConfig[] │
79
+ │ - name, prompt, tools, sub_agents, description │
80
+ └─────────────────────────────────────────────────────────────────────┘
81
+ ```
82
+
83
+ ## Requirements
84
+
85
+ - Python 3.12+
86
+ - Google API key (for Gemini models) or Anthropic API key (for Claude models)
87
+
88
+ ## Installation
89
+
90
+ ### Basic Installation (Google ADK)
91
+
92
+ ```bash
93
+ pip install agentic-cli
94
+ ```
95
+
96
+ ### With LangGraph Support
97
+
98
+ ```bash
99
+ pip install agentic-cli[langgraph]
100
+ ```
101
+
102
+ ### Development Installation
103
+
104
+ ```bash
105
+ git clone https://github.com/shoom1/agentic-cli.git
106
+ cd agentic-cli
107
+ pip install -e ".[dev]"
108
+ ```
109
+
110
+ ### Using Conda
111
+
112
+ ```bash
113
+ conda env create -f environment.yml
114
+ conda run -n agenticcli pip install -e .
115
+ ```
116
+
117
+ ## Quick Start
118
+
119
+ Create a minimal CLI application in just a few lines:
120
+
121
+ ```python
122
+ import asyncio
123
+ from agentic_cli import BaseCLIApp, BaseSettings
124
+ from agentic_cli.cli import AppInfo
125
+ from agentic_cli.workflow import AgentConfig
126
+
127
+ # Define your tools
128
+ def greet(name: str) -> dict:
129
+ """Greet a person by name."""
130
+ return {"greeting": f"Hello, {name}!"}
131
+
132
+ # Configure your agent
133
+ AGENTS = [
134
+ AgentConfig(
135
+ name="assistant",
136
+ prompt="You are a helpful assistant. Use the greet tool when asked to greet someone.",
137
+ tools=[greet],
138
+ ),
139
+ ]
140
+
141
+ # Create and run your app
142
+ if __name__ == "__main__":
143
+ app = BaseCLIApp(
144
+ app_info=AppInfo(name="My App", version="0.1.0"),
145
+ agent_configs=AGENTS,
146
+ settings=BaseSettings(),
147
+ )
148
+ asyncio.run(app.run())
149
+ ```
150
+
151
+ Run with your API key:
152
+
153
+ ```bash
154
+ export GOOGLE_API_KEY="your-api-key"
155
+ python my_app.py
156
+ ```
157
+
158
+ ## Workflow Managers
159
+
160
+ ### GoogleADKWorkflowManager (Default)
161
+
162
+ Uses Google's Agent Development Kit for orchestration. Best for:
163
+ - Simple agent hierarchies
164
+ - Google Gemini models with native thinking support
165
+ - Quick prototyping
166
+
167
+ ```python
168
+ from agentic_cli import GoogleADKWorkflowManager
169
+
170
+ manager = GoogleADKWorkflowManager(
171
+ agent_configs=AGENTS,
172
+ settings=settings,
173
+ model="gemini-2.0-flash", # Optional: auto-detected from API keys
174
+ )
175
+ ```
176
+
177
+ ### LangGraphWorkflowManager
178
+
179
+ Uses LangGraph for orchestration. Best for:
180
+ - Cyclical workflows (self-validation, iterative refinement)
181
+ - Model-agnostic operation (OpenAI, Anthropic, Google via GenAI)
182
+ - State checkpointing and time-travel debugging
183
+ - Complex multi-agent coordination
184
+
185
+ ```python
186
+ from agentic_cli.workflow.langgraph import LangGraphWorkflowManager
187
+
188
+ manager = LangGraphWorkflowManager(
189
+ agent_configs=AGENTS,
190
+ settings=settings,
191
+ checkpointer="memory", # "memory", "postgres", "sqlite", or None
192
+ )
193
+ ```
194
+
195
+ Features:
196
+ - **Explicit provider support**: Uses `langchain-google-genai` for Gemini (not VertexAI)
197
+ - **Thinking mode**: Native support for Claude and Gemini thinking/reasoning
198
+ - **Retry policies**: Automatic retry with exponential backoff
199
+ - **Event streaming**: Real-time workflow events via `WorkflowEvent`
200
+
201
+ Requires: `pip install agentic-cli[langgraph]`
202
+
203
+ ### Comparison
204
+
205
+ | Feature | Google ADK | LangGraph |
206
+ |---------|------------|-----------|
207
+ | Setup complexity | Simple | Moderate |
208
+ | Cyclical workflows | Limited | Native |
209
+ | Multi-provider | Google only | OpenAI, Anthropic, Google (GenAI) |
210
+ | State persistence | In-memory | Memory, PostgreSQL, or SQLite |
211
+ | Thinking support | Native (Gemini) | Native (Claude & Gemini) |
212
+ | Retry handling | Manual | Built-in with backoff |
213
+
214
+ ### Auto-selection via Settings
215
+
216
+ ```python
217
+ from agentic_cli import create_workflow_manager_from_settings
218
+
219
+ settings = BaseSettings(orchestrator="langgraph") # or "adk"
220
+ manager = create_workflow_manager_from_settings(agent_configs=AGENTS, settings=settings)
221
+ ```
222
+
223
+ ## Configuration
224
+
225
+ ### BaseSettings
226
+
227
+ All settings can be configured via environment variables with the `AGENTIC_` prefix or in a `.env` file:
228
+
229
+ ```python
230
+ from agentic_cli import BaseSettings
231
+
232
+ class MySettings(BaseSettings):
233
+ model_config = SettingsConfigDict(
234
+ env_file=".env",
235
+ env_prefix="MYAPP_", # Custom prefix
236
+ )
237
+ app_name: str = "my_app"
238
+ workspace_dir: Path = Path.home() / ".my_app"
239
+ ```
240
+
241
+ ### Key Settings
242
+
243
+ | Setting | Env Variable | Default | Description |
244
+ |---------|--------------|---------|-------------|
245
+ | `google_api_key` | `GOOGLE_API_KEY` | None | Google API key for Gemini |
246
+ | `anthropic_api_key` | `ANTHROPIC_API_KEY` | None | Anthropic API key for Claude |
247
+ | `default_model` | `AGENTIC_DEFAULT_MODEL` | Auto | Model to use |
248
+ | `thinking_effort` | `AGENTIC_THINKING_EFFORT` | "medium" | Thinking level: none, low, medium, high |
249
+ | `orchestrator` | `AGENTIC_ORCHESTRATOR` | "adk" | Orchestrator: adk or langgraph |
250
+ | `workspace_dir` | `AGENTIC_WORKSPACE_DIR` | ~/.agentic | Storage directory |
251
+ | `log_level` | `AGENTIC_LOG_LEVEL` | "warning" | Logging level |
252
+
253
+ ### Settings Context
254
+
255
+ For multi-tenant or isolated contexts:
256
+
257
+ ```python
258
+ from agentic_cli import SettingsContext
259
+
260
+ with SettingsContext(custom_settings):
261
+ # All code here uses custom_settings
262
+ result = my_tool()
263
+ ```
264
+
265
+ ## Agent Configuration
266
+
267
+ Agents are defined declaratively using `AgentConfig`:
268
+
269
+ ```python
270
+ from agentic_cli import AgentConfig
271
+
272
+ # Simple agent
273
+ assistant = AgentConfig(
274
+ name="assistant",
275
+ prompt="You are a helpful assistant.",
276
+ tools=[my_tool],
277
+ )
278
+
279
+ # Agent with dynamic prompt
280
+ def get_prompt():
281
+ return f"Today is {datetime.now().strftime('%Y-%m-%d')}. Help the user."
282
+
283
+ dynamic_agent = AgentConfig(
284
+ name="dynamic",
285
+ prompt=get_prompt, # Callable for dynamic prompts
286
+ tools=[tool_a, tool_b],
287
+ )
288
+
289
+ # Coordinator with sub-agents
290
+ coordinator = AgentConfig(
291
+ name="coordinator",
292
+ prompt="Route requests to the appropriate specialist.",
293
+ tools=[],
294
+ sub_agents=["researcher", "analyst"], # Names of other agents
295
+ description="Routes work to specialists",
296
+ )
297
+
298
+ researcher = AgentConfig(
299
+ name="researcher",
300
+ prompt="Research topics thoroughly.",
301
+ tools=[web_search],
302
+ )
303
+
304
+ analyst = AgentConfig(
305
+ name="analyst",
306
+ prompt="Analyze data and provide insights.",
307
+ tools=[calculate],
308
+ )
309
+
310
+ # Pass all configs to workflow manager
311
+ configs = [coordinator, researcher, analyst]
312
+ ```
313
+
314
+ ### AgentConfig Fields
315
+
316
+ | Field | Type | Description |
317
+ |-------|------|-------------|
318
+ | `name` | str | Unique identifier |
319
+ | `prompt` | str \| Callable | System instruction |
320
+ | `tools` | list[Callable] | Available tool functions |
321
+ | `sub_agents` | list[str] | Names of agents this one can delegate to |
322
+ | `description` | str | Short description for routing |
323
+ | `model` | str \| None | Model override (defaults to manager's model) |
324
+
325
+ ## Tools
326
+
327
+ ### Creating Tools
328
+
329
+ Tools are regular Python functions with type hints and docstrings:
330
+
331
+ ```python
332
+ def search_database(query: str, limit: int = 10) -> dict:
333
+ """Search the database for matching records.
334
+
335
+ Args:
336
+ query: Search query string
337
+ limit: Maximum number of results (default: 10)
338
+
339
+ Returns:
340
+ Dict with results and count
341
+ """
342
+ results = db.search(query, limit=limit)
343
+ return {"results": results, "count": len(results)}
344
+ ```
345
+
346
+ ### Built-in Tools
347
+
348
+ #### SafePythonExecutor
349
+
350
+ Execute Python code in a sandboxed environment:
351
+
352
+ ```python
353
+ from agentic_cli.tools import SafePythonExecutor
354
+
355
+ executor = SafePythonExecutor(default_timeout=30)
356
+ result = executor.execute("""
357
+ import numpy as np
358
+ data = np.array([1, 2, 3, 4, 5])
359
+ np.mean(data)
360
+ """)
361
+ # result = {"success": True, "result": "3.0", "output": "", "error": ""}
362
+ ```
363
+
364
+ Allowed modules: numpy, pandas, scipy, math, json, datetime, collections, itertools, re, random
365
+
366
+ #### KnowledgeBaseManager
367
+
368
+ Semantic search over documents:
369
+
370
+ ```python
371
+ from agentic_cli.knowledge_base import KnowledgeBaseManager, SourceType
372
+
373
+ kb = KnowledgeBaseManager(settings=settings)
374
+
375
+ # Ingest a document
376
+ doc = kb.ingest_document(
377
+ content="Machine learning is...",
378
+ title="ML Introduction",
379
+ source_type=SourceType.WEB,
380
+ source_url="https://example.com/ml",
381
+ )
382
+
383
+ # Search
384
+ results = kb.search("neural networks", top_k=5)
385
+ ```
386
+
387
+ ## CLI Commands
388
+
389
+ Built-in slash commands available in all apps:
390
+
391
+ | Command | Aliases | Description |
392
+ |---------|---------|-------------|
393
+ | `/help` | | Show available commands |
394
+ | `/status` | | Show session and workflow status |
395
+ | `/clear` | | Clear the screen |
396
+ | `/exit` | `/quit` | Exit the application |
397
+
398
+ ### Adding Custom Commands
399
+
400
+ ```python
401
+ from agentic_cli.cli.commands import Command, CommandCategory
402
+
403
+ class MyCommand(Command):
404
+ def __init__(self):
405
+ super().__init__(
406
+ name="mycommand",
407
+ description="Do something custom",
408
+ category=CommandCategory.GENERAL,
409
+ )
410
+
411
+ async def execute(self, args: str, app: Any) -> None:
412
+ app.session.add_response(f"Executed with args: {args}")
413
+
414
+ # In your app
415
+ class MyApp(BaseCLIApp):
416
+ def get_custom_commands(self) -> list[Command]:
417
+ return [MyCommand()]
418
+ ```
419
+
420
+ ## Events
421
+
422
+ WorkflowEvent types for UI integration:
423
+
424
+ | EventType | Description | Metadata |
425
+ |-----------|-------------|----------|
426
+ | `TEXT` | Final text response | session_id |
427
+ | `THINKING` | Model reasoning | session_id |
428
+ | `TOOL_CALL` | Tool invocation | tool_name, tool_args |
429
+ | `TOOL_RESULT` | Tool result | tool_name, result, success |
430
+ | `CODE_EXECUTION` | Code execution result | outcome |
431
+ | `ERROR` | Error message | recoverable, error_code |
432
+ | `USER_INPUT_REQUIRED` | Tool needs user input | request_id, prompt |
433
+
434
+ ### Processing Events
435
+
436
+ ```python
437
+ async for event in manager.process(message, user_id="user1"):
438
+ if event.type == EventType.TEXT:
439
+ print(event.content)
440
+ elif event.type == EventType.THINKING:
441
+ print(f"[Thinking] {event.content}")
442
+ elif event.type == EventType.TOOL_CALL:
443
+ print(f"Calling: {event.metadata['tool_name']}")
444
+ elif event.type == EventType.TOOL_RESULT:
445
+ print(f"Result: {event.metadata['result']}")
446
+ ```
447
+
448
+ ## Examples
449
+
450
+ See the `examples/` directory for complete working examples:
451
+
452
+ - **hello_agent.py** - Simple assistant using Google ADK
453
+ - **hello_langgraph.py** - Same assistant using LangGraph orchestration
454
+ - **research_demo/** - Full-featured research assistant with memory, planning, and file operations
455
+
456
+ Run examples:
457
+
458
+ ```bash
459
+ export GOOGLE_API_KEY="your-key"
460
+ python examples/hello_agent.py
461
+
462
+ # Or with LangGraph (requires langgraph extra)
463
+ pip install agentic-cli[langgraph]
464
+ python examples/hello_langgraph.py
465
+
466
+ # Research demo (full features)
467
+ python -m examples.research_demo
468
+ ```
469
+
470
+ ## Development
471
+
472
+ ### Running Tests
473
+
474
+ ```bash
475
+ # With conda
476
+ conda run -n agenticcli python -m pytest tests/ -v
477
+
478
+ # With pip
479
+ pytest tests/ -v
480
+
481
+ # With coverage
482
+ pytest tests/ -v --cov=agentic_cli
483
+ ```
484
+
485
+ ### Project Structure
486
+
487
+ ```
488
+ agentic-cli/
489
+ ├── src/agentic_cli/
490
+ │ ├── __init__.py # Package exports
491
+ │ ├── config.py # BaseSettings, SettingsContext
492
+ │ ├── cli/
493
+ │ │ ├── app.py # BaseCLIApp
494
+ │ │ └── commands.py # Command, CommandRegistry
495
+ │ ├── workflow/
496
+ │ │ ├── events.py # WorkflowEvent, EventType
497
+ │ │ ├── config.py # AgentConfig
498
+ │ │ ├── adk_manager.py # GoogleADKWorkflowManager
499
+ │ │ └── langgraph/ # LangGraph submodule
500
+ │ │ ├── manager.py # LangGraphWorkflowManager
501
+ │ │ ├── state.py # AgentState, CheckpointData
502
+ │ │ ├── persistence/ # Checkpointers and stores
503
+ │ │ └── tools/ # Shell, file search tools
504
+ │ ├── tools/
505
+ │ │ └── executor.py # SafePythonExecutor
506
+ │ └── knowledge_base/
507
+ │ └── manager.py # KnowledgeBaseManager
508
+ ├── examples/
509
+ │ ├── hello_agent.py
510
+ │ ├── hello_langgraph.py
511
+ │ └── research_demo/ # Full-featured example
512
+ └── tests/
513
+ ```
514
+
515
+ ## License
516
+
517
+ MIT