⚙️ lmm-derive
lmm-deriveis the procedural macro crate for thelmmworkspace. It provides the#[derive(Auto)]macro that generates fullAgent,Functions, andAsyncFunctionsimplementations for any custom agent struct.
🤔 What does this crate provide?
The single export is the Auto derive macro. Placing #[derive(Auto)] on a struct that contains the required fields automatically generates:
impl Agent for MyAgent: delegatespersona(),behavior(),status(),memory(), etc. to the inneragent: LmmAgentfield.impl Functions for MyAgent: delegatesget_agent()andget_agent_mut().#[async_trait] impl AsyncFunctions for MyAgent: providesgenerate,search,save_ltm,get_ltm,ltm_contextbacked by the equation engine and DuckDuckGo.
No LLM provider, no API key, no training.
📦 Installation
This crate is automatically pulled in when you use lmm-agent:
[]
= "0.0.1"
If you need the macro standalone (unusual):
[]
= "0.0.1"
🚀 Usage
Minimal required fields
Your struct must contain these five fields with exactly these names and types:
use *;
That's the entire boilerplate. The macro takes care of the rest.
Custom task logic
You only need to implement Executor:
🔍 What the macro generates
For a struct called MyAgent the macro emits approximately:
📄 License
Licensed under the MIT License.