Skip to content

GPT-5 “Thinking” + Memory

Choose a tag to compare

@Da3dalusCode Da3dalusCode released this 15 Oct 00:19
· 75 commits to main since this release

Headline features

First-class GPT-5 Thinking support. Automatic model detection and routing through the Responses API, with correct token parameter mapping for both Responses and Chat paths. Future-proofs the agent for upcoming model variants.

Streaming polish for reasoning models. Configurable minimum characters before first token and an optional early “Got it — saved.” confirmation to smooth HA TTS, without regressing non-streaming behavior.

Integrated memory tools. Calls your FastAPI memory service via configurable /memories/write and /memories/search paths. Normalizes “remember…” phrasing, redacts sensitive details, respects per-turn snippet budgets, and backs off gracefully when the service is unhealthy (circuit-breaker).

Router, context & dry-run upgrades. Force deterministic memory.write / memory.search on matched phrases; proactively retrieve small, budgeted context (profile + scratchpad + hits); and use dry-run to inspect routing, budgets, and tool decisions without hitting OpenAI.

Quality & compatibility

Broader test coverage across streaming, router enforcement, memory budgets, redaction, and circuit-breaker behavior to lock in the new GPT-5 + memory flow.
OpenAI SDK: bumped to openai>=2.3.0 to use the latest Responses features. (If you pin older environments, please upgrade.)

Install / Upgrade

HACS → Custom Repositories: add Da3dalusCode/extended_openai_conversation (Integration).
Install this release (tag) and Restart Home Assistant.
Configure in Devices & Services → Extended OpenAI Conversation → Configure:
    Model strategy: Auto (prefer Responses)
    Model: your GPT-5 Thinking variant (low reasoning)
    Streaming: ON; Min chars: start at 90 (tune 60–120)
    Memory: base URL, /memories/write, /memories/search, API key header
    Proactivity budgets: Profile ~250, Scratchpad ~200, Retrieved ~600; k=3, min_score=0.70
    Router: enable force tools for “remember…” / “what’s my…”; tool-call cap ~8–10
    Optional: Early ack text (“Got it — saved.”)

Quick smoke test

“Remember that my favorite tea is yerba mate.” → early confirmation + memory.write tool call.
“What’s my favorite tea?” → forced memory.search, grounded answer.
“Turn on the office lights.” → handled locally (no LLM call).
“Recommend a tea for this afternoon.” → proactive memory search pulls your preference.

Known notes / troubleshooting

tool_choice errors on some GPT-5 variants: auto-retry once with auto and log a WARN. If persistent, temporarily disable forced tools in Options.
Long time-to-first-audio: raise Streaming min chars or lower temperature on tool-heavy turns; keep injected context ~900–1,100 tokens.
Memory outages: circuit-breaker temporarily skips proactive search (forced writes/search still attempt). Logged at DEBUG.

Changelog highlights

Model capability heuristics & correct max token mapping (max_output_tokens for Responses; max_completion_tokens for reasoning Chat; max_tokens for classic Chat).
Streaming safeguards, early confirmation (optional), detailed telemetry.
Stronger normalization/redaction, snippet budgeting, and circuit-breaker for memory service.
Router tests, streaming tests, tool-cap hardening (>=), and docs/options updates.