跳转到内容

Memory Configuration

此内容尚不支持你的语言。

Askimo keeps track of everything you say in a conversation so the AI can answer follow-up questions and recall earlier context. For long sessions this history grows large and eventually uses more tokens than the model can fit in one request. Askimo handles this automatically by summarizing older parts of the conversation — but how aggressively it does so is configurable.

Every chat message is stored in memory and sent to the AI with each new request. When the accumulated history approaches the model’s context-window limit, Askimo:

  1. Protects the most recent messages so the AI always has full-fidelity context for the current exchange.
  2. Summarizes a batch of older messages into a compact structured summary (key facts, main topics, recent context).
  3. Replaces the raw messages with the summary, freeing token budget for new content.

This summarization cycle repeats automatically. The memory mode controls how early and how aggressively each cycle fires.

flowchart TD
A([User sends a message]) --> B[Add to conversation history]
B --> C{Token count above\nsummarization threshold?}
C -- No --> D[Send full history to AI]
D --> E([AI responds])
C -- Yes --> F[Protect N most-recent turns\nverbatim]
F --> G[Summarize oldest batch\ninto key facts + topics]
G --> H[Replace raw messages\nwith structured summary]
H --> D

Askimo ships with three presets. Selecting a mode replaces the entire memory configuration with that preset’s values.

There is no universally best mode — every choice involves a trade-off between how much you pay (tokens), how much the AI remembers verbatim, and how long your sessions can run before the context window fills up. The right mode depends on your model, session length, and what kind of accuracy you need.

Summarization fires early and prunes aggressively. Older messages are compressed quickly, which keeps token usage low and allows very long sessions to continue without hitting context limits. The downside is that nuance and exact wording from earlier in the conversation are lost sooner — the AI works from summaries rather than verbatim history. Good for brainstorming, research, or long-running tasks where the overall direction matters more than recalling specific earlier phrasing.

The default. Summarization fires at a moderate threshold and prunes a reasonable fraction each cycle. You get a meaningful amount of verbatim history at the cost of moderate token usage. This mode works well for most everyday conversations and is the safest starting point if you are unsure which mode to pick.

Summarization fires late and prunes conservatively. The AI holds more of the conversation verbatim for longer, which improves accuracy on follow-up questions and reduces the chance of the AI misremembering something you said earlier. The trade-off is higher token consumption per request and shorter maximum session length before the context window fills. Best suited for coding sessions, technical deep-dives, or any task where exact recall of earlier messages matters.

Mode Token Cost Context Quality Best For
Compact Low Less detail Long sessions, cost-sensitive or rate-limited models
Balanced Medium Good trade-off General use — the default
Detail High High fidelity Short sessions, coding, precise recall
Parameter Compact Balanced Detail
Summarization threshold 25 % 40 % 60 %
Protected recent turns 3 6 10
Summarization prune fraction 80 % 65 % 50 %
Max key facts 15 30 50
Max main topics 8 15 25
Max summary length 1 000 chars 2 000 chars 4 000 chars
Memory budget fraction 30 % 40 % 50 %
  1. Open Settings from the sidebar.
  2. Select Advanced.
  3. Find the Memory Mode dropdown.
  4. Choose Compact, Balanced, or Detail.
  5. The change takes effect immediately — no session restart required.

The fraction of the memory budget at which a summarization cycle is triggered.

  • Lower → fires earlier, keeps token usage flat, more frequent AI summarization calls
  • Higher → fires later, allows more verbatim history but risks hitting the context limit

Example: 0.40 means summarization starts when the in-memory token count reaches 40 % of the allocated memory budget.

The number of most-recent message pairs (user + assistant) that are never included in a summarization batch. They are always sent to the AI verbatim, ensuring the current exchange always has full context.

The fraction of eligible (non-protected) messages that are compressed and removed in each summarization cycle, oldest first.

  • Higher → more messages pruned per cycle, more breathing room before the next trigger
  • Lower → lighter pruning, cycles happen more frequently

The maximum number of distinct facts tracked in the structured summary. Facts are stored with LRU-by-relevance eviction: facts that reappear in recent cycles stay; facts not seen recently are dropped when the cap is exceeded.

The maximum number of distinct topic labels tracked across summary merges. The most recently observed topics are kept; older ones that no longer appear are dropped.

Character cap for the fallback extractive summary used when AI summarization is unavailable (network error or no utility model configured). This is plain text and requires no AI call.

The fraction of the model’s total context window reserved for conversation history. The remaining window is split between the live request and the AI response.

Example: 0.40 on a 128 K-token model allocates ≈ 51 200 tokens to history.

The AI forgot something from earlier in the conversation

Section titled “The AI forgot something from earlier in the conversation”

This is expected behaviour when the memory is in Compact mode or when a long session has triggered many summarization cycles. Verbatim messages are replaced with structured summaries over time.

To reduce memory loss:

  • Switch to Detail mode for sessions that need precise recall.
  • Keep sessions shorter and open a new chat for unrelated topics.

There are two common causes:

The memory mode is too aggressive for your use case. Try switching to Balanced or Detail mode. Detail raises the summarization threshold and prunes less per cycle, so the AI holds more verbatim history before compressing.

Your local model has a small default context window. Providers like Docker Model Runner and LM Studio often default to a low context window (e.g. 2 048 or 4 096 tokens) even when the underlying model supports much more. Askimo calculates the memory budget from this reported window — if it is small, the threshold is hit quickly and summarization fires constantly.

To fix this, increase the context window in the provider’s settings:

  • LM Studio: In the model settings panel, find Context Length and raise it (e.g. to 32768 or higher, up to the model’s maximum).
  • Docker Model Runner: Pass --context-size when starting the model, or set it in the run configuration.
  • Ollama: Set num_ctx in a Modelfile or pass it as a parameter when running the model.

After increasing the context window, restart the provider and reload Askimo. Summarization should fire less often.

Summarization never fires even in long sessions

Section titled “Summarization never fires even in long sessions”

Check that a Utility Model is configured for your active AI provider (see AI Model Configuration). Askimo uses the utility model to run summarization. If none is set, it falls back to a basic extractive summary capped at the Max Summary Length value.