Agent Control
Memory
BaseLLM stores conversation history, summarizes long conversations, and gives the model the user's recent days and the project's approved rules. Session, daily and project memory, plus two caches, are enabled per project.
Session, daily and project memory
| Memory | What it does | Default / range |
|---|---|---|
| Session | Keeps history; summarizes long conversations | Last 6 messages (2–50); 30 days (1–365) |
| Daily | Summarizes the user's recent days, once a day | Last 7 days (1–30); 1,000 tokens |
| Project | Items an admin has approved and published | 2,000 tokens; up to 10 suggestions a day |
# Request (1–128 characters)
X-FFM-Session: <session-id>
# Response
X-FFM-Memory: session=continued; summarized=14; kept=6
X-FFM-Cache: SHADOW
Caches
| Response cache mode | Behavior |
|---|---|
| Off | Every request goes to the model |
| Shadow (default) | The request goes to the model; potential savings are logged |
| On | Repeated requests are served from the cache at zero cost |
The response cache applies only to identical requests with a temperature of 0. Retention ranges from 5 minutes to 7 days; the default is 1 hour. The X-FFM-Cache header carries HIT, MISS, SHADOW or BYPASS.
For provider prompt caching, the cached token count is read from OpenAI, Anthropic, Gemini, OpenRouter and vLLM, and reflected in the budget. BaseLLM adds the cache marker to Claude requests itself, so your application doesn't need any changes.
Measurements and personal data safeguards
| Measurement | Result | Conditions |
|---|---|---|
| Prompt cache savings | gpt-5-mini 77%; Claude Haiku 4.5 89% | Real provider, repeated prompt |
| Cache hit rate with memory | Claude 99.3%; OpenAI 97.9% | Real provider, 4-turn conversation |
| Response cache hit | p50 ~0.5 ms; p99 ~1.8 ms | Test environment |
| Session memory, 56 messages | p50 1.0 ms | Test environment |
- No raw personal data is written to Redis; text is masked and values are encrypted
- With protection off, nothing is written to Redis
- If a response contains personal data, the response cache doesn't store it
- If Redis is unreachable, requests still go through