Tin

Examples · learn/15-first-agent · 210 of 339

memory

examples/learn/15-first-agent/memory.tintin run examples/learn/15-first-agent/memory.tin
agent Echo { model: "mock" }

fn main() {
  print(Echo("my name is Ada"))
  print(Echo("what is my name?"))    // a real model would see both messages and answer "Ada"
  print("model calls so far: {Echo.turns()}")
  Echo.reset()                        // forget the conversation: the next call starts fresh
  print(Echo("what is my name?"))
}