Skip to content

feat: store explanations and votes on them in an Azure table - #215

Merged
andig merged 1 commit into
feat/explainfrom
feat/explain-feedback
Oct 16, 2026
Merged

andig merged 1 commit into
feat/explainfrom
feat/explain-feedback

Conversation

@andig

@andig andig commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

on top of #214, pairs with evcc-io/evcc#34926

Lets the caller vote on an explanation, so the prompt can be tuned from what users found wrong. The service stays stateless until a user votes: /optimize/explain stores nothing and answers with the explanation alone.

  • POST /optimize/explain/feedback takes the same payload as /optimize/explain plus explanation, vote: up|down and an optional comment, and stores that as one row: the digest the model saw (gzip, split below the 64 KiB property limit), prompt hash, model, answer, vote, comment, language, plan features to group by (status, steps, horizon, vehicles, batteries, strategy, departure masses, goals, demands) and the sponsor subject as a hash. 503 without a store, 502 when the store fails.
  • Storage is an Azure table, explanations in a new stoptimizerfeedback account; the container app writes with its managed identity (Storage Table Data Contributor), OPTIMIZER_FEEDBACK_TABLE_ENDPOINT in the bicep. OPTIMIZER_FEEDBACK_CONNECTION_STRING for Azurite and local runs. Nothing to put in the key vault.
  • feedback.rows() reads the table back with the digests unpacked, for the analysis tooling.
  • Go client regenerated for the new route, azure-data-tables and azure-identity added.

Tests cover the round trip of long digests, the stored row, incomplete votes, that explain stores nothing, unconfigured store, store failure. The bicep builds.

🤖 Generated with Claude Code

@andig andig added the enhancement New feature or request label Oct 15, 2026
@naltatis

naltatis commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Stores every explanation

Lets make this less intrusive and only store explanations (+ data) where the user intentionally provided feedback. This is more in line with expected user expectation since the optimizer is otherwise stateless and we otherwise store nothing without explicit consent.

@andig

andig commented Oct 16, 2026

Copy link
Copy Markdown
Member Author

Done in 8e15737: /optimize/explain stores nothing and returns no id any more. /optimize/explain/feedback takes the explain payload plus explanation, vote and comment, and only that is stored. evcc side in evcc-io/evcc#34926.

🤖 Generated with Claude Code

@andig
andig force-pushed the feat/explain-feedback branch from 8e15737 to d6f1185 Compare October 16, 2026 12:23
The service stays stateless until a user votes. /optimize/explain/feedback takes the explain
payload plus the explanation, the vote and a comment, and stores that as one row in the table
explanations of the storage account stoptimizerfeedback.
@andig
andig force-pushed the feat/explain-feedback branch from d6f1185 to 07e9b97 Compare October 16, 2026 12:25
@andig
andig merged commit 40eb42f into feat/explain Oct 16, 2026
@andig
andig deleted the feat/explain-feedback branch October 16, 2026 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants