Spec: Doc ask hamiz spec — "AskHamiz is an agentic chatbot that is capable of communicating with every I/O in the website, such as changing tasks, removing, adding, manipulating recurring tasks, manipulating class data, and automating notes."
Current state
agent/base-agent.ts is a ToolLoopAgent on gemini-2.5-flash-lite with tools: {} — no tools at all. It is a plain chat responder with a generic prompt, not an agent over app data.
Scope
- Define a tool surface over the app's real operations, each backed by the existing service layer rather than reimplemented:
- Notes: search, read, create, update
- Classes: read details, update fields
- Calendar: create / update / delete events, including recurring ones
- Flashcards and quizzes: generate, list, open
- Study: start a timer, start a review session
- Every tool must resolve the acting user server-side from the session and scope its query to that user. The user id must never be a model-supplied parameter — that is a direct path to cross-account data access.
- Destructive tools (delete an event, overwrite a note) require explicit user confirmation in the UI before executing. The model proposes; the user commits.
- Stream tool calls to the client so the user sees what the agent is doing, not just a final answer.
- Rewrite the system prompt for the TaskMaster domain — the current one explicitly says "avoid domain assumptions," which is backwards for this feature.
Blocked on
Acceptance criteria
Spec: Doc ask hamiz spec — "AskHamiz is an agentic chatbot that is capable of communicating with every I/O in the website, such as changing tasks, removing, adding, manipulating recurring tasks, manipulating class data, and automating notes."
Current state
agent/base-agent.ts is a
ToolLoopAgentongemini-2.5-flash-litewithtools: {}— no tools at all. It is a plain chat responder with a generic prompt, not an agent over app data.Scope
Blocked on
/api/chathas no session guard (see the auth issue) — this must land first. Adding data-mutating tools to an unauthenticated endpoint would expose every user's data.Acceptance criteria