Problem
AutoMem currently gives classification LLM calls a fixed 50-token output budget. That is enough for a very small deterministic response, but it is too small for some free or reasoning-oriented models: the model can spend the budget before it reaches the final JSON. AutoMem then falls back to a normal type such as Context, so the store succeeds while the quality loss remains quiet.
The same budget problem applies to LLM-assisted enrichment (summary, tags and entities), but classification and enrichment should be configurable separately because their outputs have different sizes.
Observed evidence
In a bounded, non-production AutoMem evaluation through an OpenAI-compatible route:
These are protocol observations, not a claim that one model is universally better. The important point is that output budget is part of the provider/model compatibility contract.
Likely scope
The change could be kept narrow:
- make the classification completion budget configurable;
- give enrichment its own configurable budget, or document a clear shared setting;
- select
max_tokens versus max_completion_tokens according to the model/API contract;
- preserve fail-soft storage and make malformed-output/fallback behavior observable;
- add focused tests for short-output, reasoning/free-model, malformed-JSON and fallback cases.
This is separate from quota circuit breaking tracked in #222 and from the already-closed custom-base-URL work in #96.
Acceptance criteria
- A deployment can configure the classification output budget without editing Python source.
- Classification and enrichment budgets do not have to be identical.
- Model families that require
max_completion_tokens receive the correct parameter.
- A truncated or malformed response does not make the store fail or silently look like a successful high-confidence classification.
- Existing deployments retain a documented backward-compatible default.
- Focused unit tests cover the request parameters, valid JSON, malformed JSON and fallback counters.
Verification
pytest -q tests/test_classification_stats.py tests/test_enrichment.py
make test
Related
No HAPP/VLESS, provider credentials or deployment-specific configuration is required for this feature request.
Prepared collaboratively by Semyon Poklad and Svarog, an AI engineering agent and engineering partner. Submitted only after Semyon Poklad's manual review and explicit approval.
Problem
AutoMem currently gives classification LLM calls a fixed 50-token output budget. That is enough for a very small deterministic response, but it is too small for some free or reasoning-oriented models: the model can spend the budget before it reaches the final JSON. AutoMem then falls back to a normal type such as
Context, so the store succeeds while the quality loss remains quiet.The same budget problem applies to LLM-assisted enrichment (summary, tags and entities), but classification and enrichment should be configurable separately because their outputs have different sizes.
Observed evidence
In a bounded, non-production AutoMem evaluation through an OpenAI-compatible route:
210 passed, 1 skipped;These are protocol observations, not a claim that one model is universally better. The important point is that output budget is part of the provider/model compatibility contract.
Likely scope
The change could be kept narrow:
max_tokensversusmax_completion_tokensaccording to the model/API contract;This is separate from quota circuit breaking tracked in #222 and from the already-closed custom-base-URL work in #96.
Acceptance criteria
max_completion_tokensreceive the correct parameter.Verification
pytest -q tests/test_classification_stats.py tests/test_enrichment.py make testRelated
OPENAI_BASE_URLfor classification/enrichmentNo HAPP/VLESS, provider credentials or deployment-specific configuration is required for this feature request.
Prepared collaboratively by Semyon Poklad and Svarog, an AI engineering agent and engineering partner. Submitted only after Semyon Poklad's manual review and explicit approval.