lingshu-sdk 0.10.0

Lingshu SDK — build autonomous AI agents in Rust
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use lingshu_sdk::prelude::*;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let agent = SdkAgent::new("copilot/gpt-5-mini")?;
    let memory = agent.memory();

    memory
        .write("memory", "User prefers concise answers")
        .await?;
    let content = memory.read("memory").await?;
    println!("Memory contents:\n{content}");

    let entries = memory.entries("memory").await?;
    println!("Entry count: {}", entries.len());
    Ok(())
}