Skip to main content

DOCS

Help & Community

FAQ, further reading, quotas, release notes and the glossary.

Two ways to read the conversation: prevMessage and history(start, end)

When you design a chat workflow, Asgard gives you two common ways to read what the user has said: prevMessage and history(start, end). Both read the conversation, but they suit different situations and differ in how flexible they are.

  1. 🔹 prevMessage​

    • What it does: returns the previous message
    • Simple syntax and easy to use, which suits a single-turn exchange
    • Typical use:
    prevMessage
    • Where it fits:
      • An echo bot replying with the previous message
      • A quick response to a single command or a one-turn query
  2. 🔸 history(start, end)​

    • What it does: returns the whole conversation history, or a section of it
    • Flexible syntax, with a start and an end position, which suits multi-turn conversations and reasoning over context
    • Example:
    // the full history
    history(0, -1)

    // the last three messages
    history(-3, -1)
    • Where it fits:
      • An LLM chatbot whose answer depends on the context
      • Multi-turn interaction, tasks that need memory, summarising, analysis

Ready to get started?

Want to see how Asgard fits your team? Talk to us.

Contact us