Skip to content

Commit 6fd31b3

Browse files
authored
feat: implement a PID-style closed-loop agent cognition. (#24)
Signed-off-by: wiseaidev <oss@wiseai.dev>
1 parent 4dc4f40 commit 6fd31b3

26 files changed

Lines changed: 2437 additions & 261 deletions

.bumpversion.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ replace = "version: v'{new_version}'"
2525
search = lmm = "{current_version}"
2626
replace = lmm = "{new_version}"
2727

28+
[bumpversion:file:AGENT.md]
29+
search = lmm = { version = "{current_version}", features = ["agent"] }
30+
replace = lmm = { version = "{new_version}", features = ["agent"] }
31+
2832
[bumpversion:file:WASM.md]
2933
search = lmm = { version = "{current_version}", default-features = false, features = ["wasm-net"] }
3034
replace = lmm = { version = "{new_version}", default-features = false, features = ["wasm-net"] }
35+
36+
[bumpversion:file:lmm-agent/README.md]
37+
search = lmm = { version = "{current_version}", features = ["agent"] }
38+
replace = lmm = { version = "{new_version}", features = ["agent"] }

AGENT.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Or as a feature of the root `lmm` crate:
1414

1515
```toml
1616
[dependencies]
17-
lmm = { version = "0.1", features = ["agent"] }
17+
lmm = { version = "0.2.0", features = ["agent"] }
1818
```
1919

2020
## 🏗️ Core Architecture
@@ -113,7 +113,7 @@ let agent = LmmAgent::builder()
113113
| `LmmAgent` | Core agent struct (memory, tools, planner, knowledge, etc.) |
114114
| `LmmAgentBuilder` | Fluent builder for `LmmAgent` |
115115
| `Message` | A chat message with `role` + `content` |
116-
| `Status` | `Idle`, `Active`, `InUnitTesting`, `Completed` |
116+
| `Status` | `Idle`, `Active`, `InUnitTesting`, `Completed`, `Thinking` |
117117
| `Knowledge` | Map of fact keys to natural-language descriptions |
118118
| `Planner` | Ordered list of `Goal`s with priorities and completion flags |
119119
| `Profile` | Agent personality traits and behavioural script |
@@ -129,6 +129,7 @@ The `Auto` derive macro generates:
129129
// All below methods are generated automatically
130130
async fn generate(&mut self, prompt: &str) -> Result<String>;
131131
async fn search(&self, query: &str) -> Result<Vec<LiteSearchResult>>;
132+
async fn think(&mut self, goal: &str) -> Result<ThinkResult>;
132133
async fn save_ltm(&mut self, msg: Message) -> Result<()>;
133134
async fn get_ltm(&self) -> Result<Vec<Message>>;
134135
async fn ltm_context(&self) -> Result<String>;
@@ -138,7 +139,8 @@ async fn ltm_context(&self) -> Result<String>;
138139

139140
```sh
140141
Idle → [execute() called] → Active → [task done] → Completed
141-
↘ [testing] → InUnitTesting
142+
↘ [think() called] → Thinking → Completed
143+
↘ [testing] → InUnitTesting
142144
```
143145

144146
## 📎 Further Reading

0 commit comments

Comments
 (0)