Same local model. Same question. Real before vs after.

Qwen2.5-0.5B-Instruct running through LLM Foundry's memory layer — no API calls, all local.

model=Qwen/Qwen2.5-0.5B-Instruct HF backend Local embeddings + memory vault No cloud APIs
9715 ms
Before latency
raw prompt only
7007 ms
After latency
+ memory context
1798 MB
Peak RAM
both runs

BEFORE — raw prompt + instructions

No memory, no compression, no retrieval

Why is the sky blue during the day but red at sunset?

Answer in 3 clear bullet points.
Use plain English, not physics jargon.
No preamble — just the bullets.
Keep each bullet under 20 words.

BEFORE output

Why is the sky blue during the day but red at sunset?

Answer in 3 clear bullet points.
Use plain English, not physics jargon.
No preamble — just the bullets.
Keep each bullet under 20 words. The sky appears blue because of scattering of sunlight by tiny water droplets in the atmosphere. As the sun sets, these droplets scatter more light towards the ground, making the sky appear blue. At sunrise, the sky becomes red due to absorption of shorter wavelengths of light by gases and dust in the atmosphere. This causes the visible light from the sun to be absorbed and scattered back into the Earth's surface, resulting in a reddish appearance. Additionally, the Earth's curvature also

AFTER — same prompt + memory context

Same instructions, plus compressed memory context

Why is the sky blue during the day but red at sunset?

Answer in 3 clear bullet points.
Use plain English, not physics jargon.
No preamble — just the bullets.
Keep each bullet under 20 words.

CONTEXT:
MEMORY SUMMARY:
Why is the sky blue during the day but red at sunset? Answer in 3 clear bullet points. Use plain English, not physics jargon. Keep each bullet under 20 words.

AFTER output

Why is the sky blue during the day but red at sunset?

Answer in 3 clear bullet points.
Use plain English, not physics jargon.
No preamble — just the bullets.
Keep each bullet under 20 words.

CONTEXT:
MEMORY SUMMARY:
Why is the sky blue during the day but red at sunset? Answer in 3 clear bullet points. Use plain English, not physics jargon. Keep each bullet under 20 words. No preamble.

1. **Light Absorption and Reflection:**
   - The primary reason for the color of the sky is light absorption by gases like nitrogen (N₂) and oxygen (O₂), which scatter sunlight.
   - During the day, when there are more clouds or water droplets, these gases absorb most of the sunlight's energy, causing it to be scattered rather than absorbed.
   - This scattering results in a bluish appearance due to the shorter wavelength of

Delta table

BeforeValueAfterValueChange
Before latency9715msAfter latency7007ms+-2708.2
Before tokens47After tokens94-100.0
Peak RAM1798MB+0.0

Repo retrieval hits (science + atmosphere)

src/llm_foundry/memory.py | 0.316 | max_chars = max(64, target_tokens * 4)
        return current[:max_chars]
src/llm_foundry/agent.py | 0.290 | class _HTMLTextExtractor(HTMLParser):
    def __init__(self) -> None:
        super().__init__()
        self._parts: list[str] = []