@@ -27,6 +27,8 @@ A modern, secure, and modular Rust-based command-line interface for interacting
27
27
- ** Workflow Engine** : DAG-based execution with proper timing and retry logic
28
28
- ** String Replace Editor** : Surgical file editing with comprehensive test coverage
29
29
- ** MCP Integration** : Full Model Context Protocol client and server support
30
+ - ** Self-Reflection Engine** : Advanced learning and strategy adjustment capabilities
31
+ - ** State Management** : Execution context persistence with checkpoint/restore functionality
30
32
31
33
### 📊 ** Quality & Testing**
32
34
@@ -62,6 +64,15 @@ A modern, secure, and modular Rust-based command-line interface for interacting
62
64
- ** Memory System** : SQLite-based persistent memory with performance optimization
63
65
- ** Security Sandboxing** : Rate limiting, input validation, and secure execution environment
64
66
67
+ ### 🧠 ** Self-Reflection & Learning System**
68
+
69
+ - ** Multi-Type Reflection** : Routine, triggered, deep, meta, and crisis reflection modes
70
+ - ** Strategy Adjustment** : Automatic strategy optimization based on performance analysis
71
+ - ** Learning Retention** : Experience-based learning with configurable retention periods
72
+ - ** Pattern Recognition** : Success and failure pattern identification and application
73
+ - ** Performance Metrics** : Comprehensive performance tracking and confidence assessment
74
+ - ** State Persistence** : Execution context and learning experience persistence
75
+
65
76
### 🔒 ** Security & Quality Features**
66
77
67
78
- ** Comprehensive Input Validation** : Protection against injection attacks and malicious input
@@ -114,14 +125,18 @@ fluent openai "Complex analysis task" --cache
114
125
#### Agent Commands
115
126
116
127
``` bash
117
- # Interactive agent session
118
- fluent agent --interactive
128
+ # Interactive agent session (requires API keys)
129
+ fluent openai agent
119
130
120
- # Agentic mode with specific goal
121
- fluent agent --agentic --goal " Build a simple web server" --max-iterations 10
131
+ # Agentic mode with specific goal (requires API keys)
132
+ fluent openai --agentic --goal " Build a simple web server" --max-iterations 10 --enable-tools
122
133
123
- # Agent with tools enabled
124
- fluent agent --tools --config agent_config.json
134
+ # Agent with MCP capabilities (requires API keys)
135
+ fluent agent-mcp --engine openai --task " Analyze codebase" --mcp-servers " filesystem:mcp-server-filesystem"
136
+
137
+ # Note: Set appropriate API keys before running:
138
+ # export OPENAI_API_KEY="your-api-key-here"
139
+ # export ANTHROPIC_API_KEY="your-api-key-here"
125
140
```
126
141
127
142
#### Pipeline Commands
@@ -219,17 +234,73 @@ steps:
219
234
prompt : " Analyze this code and suggest improvements: {{previous_output}}"
220
235
` ` `
221
236
237
+ ### Self-Reflection Configuration
238
+
239
+ Configure the agent's self-reflection and learning capabilities:
240
+
241
+ ` ` ` yaml
242
+ # reflection_config.yaml
243
+ reflection :
244
+ reflection_frequency : 5 # Reflect every 5 iterations
245
+ deep_reflection_frequency : 20 # Deep reflection every 20 reflections
246
+ learning_retention_days : 30 # Keep learning experiences for 30 days
247
+ confidence_threshold : 0.6 # Trigger reflection if confidence < 0.6
248
+ performance_threshold : 0.7 # Trigger adjustment if performance < 0.7
249
+ enable_meta_reflection : true # Enable reflection on reflection process
250
+ strategy_adjustment_sensitivity : 0.8 # How readily to adjust strategy (0.0-1.0)
251
+
252
+ state_management :
253
+ state_directory : " ./agent_state" # Directory for state persistence
254
+ auto_save_enabled : true # Enable automatic state saving
255
+ auto_save_interval_seconds : 30 # Save state every 30 seconds
256
+ max_checkpoints : 50 # Maximum checkpoints to retain
257
+ backup_retention_days : 7 # Keep backups for 7 days
258
+ ` ` `
259
+
260
+ ### Agent Configuration
261
+
262
+ Complete agent configuration with all capabilities:
263
+
264
+ ` ` ` yaml
265
+ # agent_config.yaml
266
+ agent :
267
+ max_iterations : 20
268
+ enable_tools : true
269
+ memory_enabled : true
270
+ reflection_enabled : true
271
+
272
+ reasoning :
273
+ engine : " openai"
274
+ model : " gpt-4"
275
+ temperature : 0.7
276
+
277
+ tools :
278
+ string_replace_editor :
279
+ allowed_paths : ["./src", "./docs", "./examples"]
280
+ create_backups : true
281
+ case_sensitive : false
282
+ max_file_size : 10485760 # 10MB
283
+
284
+ filesystem :
285
+ allowed_paths : ["./"]
286
+ max_file_size : 10485760
287
+
288
+ shell :
289
+ allowed_commands : ["cargo", "git", "ls", "cat"]
290
+ timeout_seconds : 30
291
+ ` ` `
292
+
222
293
## 🤖 Experimental Features
223
294
224
295
### Agent Mode
225
296
226
297
Interactive agent sessions with basic memory and tool access:
227
298
228
299
` ` ` bash
229
- # Start an interactive agent session
300
+ # Start an interactive agent session (requires OPENAI_API_KEY)
230
301
fluent openai agent
231
302
232
- # Agent with specific goal (experimental )
303
+ # Agent with specific goal (requires OPENAI_API_KEY )
233
304
fluent openai --agentic --goal "Analyze project structure" --enable-tools
234
305
```
235
306
@@ -325,13 +396,16 @@ export GOOGLE_API_KEY="your-key"
325
396
- ** Advanced Tool System** : ✅ Production-ready file operations and code analysis
326
397
- ** String Replace Editor** : ✅ Surgical file editing with precision targeting
327
398
- ** Memory System** : ✅ SQLite-based persistent memory with optimization
399
+ - ** Self-Reflection Engine** : ✅ Advanced learning and strategy adjustment
400
+ - ** State Management** : ✅ Execution context persistence with checkpoint/restore
328
401
329
402
### Planned Features
330
403
331
- - Enhanced agent capabilities
404
+ - Enhanced multi-modal capabilities
332
405
- Expanded tool ecosystem
333
- - Advanced MCP client/server features
334
- - Improved memory and learning systems
406
+ - Advanced workflow orchestration
407
+ - Real-time collaboration features
408
+ - Plugin system for custom tools
335
409
336
410
## 🧪 Development
337
411
@@ -354,6 +428,26 @@ cargo test --package fluent-agent
354
428
355
429
# Run integration tests
356
430
cargo test --test integration
431
+
432
+ # Run reflection system tests
433
+ cargo test -p fluent-agent reflection
434
+ ```
435
+
436
+ ### Running Examples
437
+
438
+ ``` bash
439
+ # Run the self-reflection and strategy adjustment demo
440
+ cargo run --example reflection_demo
441
+
442
+ # Run the state management demo
443
+ cargo run --example state_management_demo
444
+
445
+ # Run the string replace editor demo
446
+ cargo run --example string_replace_demo
447
+
448
+ # Run other available examples
449
+ cargo run --example real_agentic_demo
450
+ cargo run --example working_agentic_demo
357
451
```
358
452
359
453
### Quality Assurance Tools
0 commit comments