Forjinn Docs

Development Platform

Documentation v2.0
Made with
by Forjinn

Memory Management

Learn about memory management and how to implement it effectively.

3 min read
🆕Recently updated
Last updated: 12/9/2025

Memory Management in Intelligent Workflows

Memory nodes bring true context-awareness to Forjinn chatflows and agents, enabling conversational history, dynamic context accumulation, and persistent knowledge between or within sessions. This guide covers types of memory, best practices for using them, and common troubleshooting tips.


Why Memory Matters

  • Provides continuity in conversations (the agent “remembers”)
  • Improves output quality with accumulated context/history
  • Enables complex reasoning, multi-step planning, and RAG workflows

Supported Memory Types/Nodes

1. Buffer Memory

  • Stores the entire conversation/session up to a limit (all user/agent messages)
  • Used for simple chatbots, retrieval, short-to-medium contexts

2. Window Memory

  • Keeps only the last N messages, discarding the oldest beyond the window
  • Optimizes for short context/small models; reduces token cost

3. Conversation Summary Memory

  • Condenses all past interactions into a summary (created by LLM)
  • Allows for unlimited-length conversations (history is “compressed” as it grows)
  • Useful for long-running agents, multi-session use

4. Conversation Summary Buffer

  • Combines buffer and summary: uses buffer up to a max token threshold, then auto-summarizes when limit is exceeded

5. Ephemeral Memory

  • Used for stateless/one-shot tasks; clears history for every new conversation or run
  • Recommended for flows where privacy/regulations prohibit storing chats

How to Use

  • Drag appropriate Memory node (Buffer, Window, Summary, etc) into your chatflow or select memory type in agent node config
  • Link to LLM/agent nodes; configure size/summary parameters
  • Choose between per-session (ephemeral), persistent (workspace/user), or external DB-backed memory as needed

Configuration & Parameters

  • Window size: Number of messages for sliding window
  • Max token limit: For summary buffer; triggers summarize step
  • Summary prompt: Optionally customize the summarization for domain-specific workflows

Example Flow

  1. Start Node → LLM Node (Enable Memory: Buffer, size=50)
  2. User and agent messages accumulate in memory
  3. After 50 turns, oldest messages are dropped, new messages added at end

Best Practices

  • For long conversations, prefer Summary or Summary Buffer for optimal cost/quality
  • Set memory to “ephemeral” for regulatory/compliance-required flows (auto-wipe after run)
  • Tune buffer size/token limit for your use case (small for quick tasks, big for research, RAG, etc)
  • Inspect/debug current memory at any step using variable inspector or logs

Troubleshooting

  • "agent forgets conversation": Memory may be too small, use a larger size or switch to Summary
  • Excessive cost/long responses: Reduce buffer/window, or use token limit
  • Privacy/compliance concern: Use ephemeral memory nodes or always clear on workflow completion
  • Memory not updating: Check node wiring, agent settings, or workspace memory policy

Smart memory design is the secret to robust, helpful, and context-aware AI assistants—mix and match as your application grows!