Quick answer: PsyFiGPT runs multi-step clinical workflows through a tool-use framework. The model picks typed actions like get_scribe_transcript mid-conversation, executes them inside the PsyFi-controlled environment, and streams results back. A June 2026 fix preserved multi-line content through the streaming pipeline, making tool output usable in real clinical workflows. The live tool set is small but growing.
The shift from "AI chatbot" to "AI agent" in clinical settings
For most of the past two years, the AI tools available to behavioral health practitioners have been chatbots. You ask a question, the AI answers from its training data, and the conversation ends. This works fine if you want a general explanation or a brainstorm prompt, but it does not work for clinical reasoning that requires current data.
In 2026, AI is shifting toward the agent model. An agent is not just a chatbot that talks — it is a tool-using system that can pick actions, execute them, get results, and use those results to reason further. When you ask "summarize my 2 PM session," an agent can recognize that it needs fresh session data, reach into your practice's systems to fetch the transcript, and then answer using real, current information.
This matters profoundly in clinical workflows because it keeps PHI inside the controlled environment. With a chatbot model, if you need a transcript and the AI cannot access it, you copy the transcript and paste it into the chat. That move — across systems and through your clipboard — expands the data's exposure, and if the second window happens to be consumer ChatGPT rather than a BAA-covered tool, it becomes a compliance problem in its own right. An agent model eliminates the handoff. The AI reaches for what it needs, gets it from inside the secure environment, and never asks you to be the data courier.
The framework that makes this possible is deceptively simple: a set of registered functions the model can invoke, with input validation and output capture. This post walks through what that looks like, what is live today, and why the June 2026 fix that made this actually usable matters more than it sounds.
What a @tool is, in plain language
A tool is a named action with a typed signature. The model can ask to invoke it when it recognizes that a request requires information it does not already have in the chat. Here is what one looks like under the hood:
@tool(display_name="Get Scribe session transcript")
def get_scribe_transcript(date: str) -> dict:
"""Fetch the transcript of a completed PsyFi Scribe session."""
return {"transcript": "...", "summary": "..."}
If you are not a programmer, that just means: "this is a function named get_scribe_transcript, it takes one input (a date), and it returns data (a transcript and summary)." The @tool part is a marker that tells the PsyFiGPT system "the model is allowed to invoke this."
From a clinician's perspective, here is how it works in practice. You open a chat and ask "summarize my 2 PM session." PsyFiGPT reads your request, recognizes that it needs session content to answer accurately, and invokes the get_scribe_transcript tool with the date you mentioned. The tool runs, retrieves the transcript from your Scribe account, and passes it back to the model. The model then reads the transcript and answers your question. All in one conversation, no copy-paste required.
The tool does not run on some third-party server. It runs inside PsyFi's infrastructure, using your authenticated session, and the transcript never transits through any external LLM provider's logging systems. This is what makes tools the right architectural choice for clinical AI.
The live tool set today
We ship tools when they are clinically useful, not when they are flashy. The current production set is small and deliberate.
get_scribe_transcript — The headline tool. If you have a completed PsyFi Scribe session, you can pull its transcript into a PsyFiGPT chat by date or session ID. This is the tool that makes the cross-product workflow real: record with Scribe, reason about it with PsyFiGPT, all without leaving the PsyFi environment. For the full story on what this enables, see PsyFiGPT Now Reads Your PsyFi Scribe Sessions.
get_current_time — A utility canary. Returns the server's current time. This sounds small, but it matters for clinical reasoning. When the AI needs to anchor an answer to "now" — like "which of these past sessions happened most recently?" — it can get the exact current time rather than guessing based on training data cutoff or chat context. Small tools are often the most reliable.
Assessment-tool parsers (BASC and others) — In active rollout. BASC (Behavior Assessment System for Children) assessment forms can be parsed directly into structured clinical data. This is Phase 2 of a larger migration of assessment-tool parsers from a deprecated system into PsyFiGPT. The BASC PRS (Parent Rating Scale) form parser is live now; nine more assessment instruments are planned for Phase 3.
This is a lean set. Some teams might expect a dozen tools by now. We chose depth over breadth. Each tool is tested, audited, and documented because each one touches PHI inside the clinical workflow. A tool that is 90% useful and 10% broken is worse than no tool at all in a clinical context. Better to ship two tools that work flawlessly than ten tools where one of them sometimes fails silently.
The multi-line SSE fix as a worked example of engineering transparency
In late May 2026, we deployed tool-use capability to production and immediately hit a problem that only shows up when you use tools in real workflows.
When a tool returned multi-line content — like a transcript that spans dozens of lines — the text would arrive at the model as a single run-on line, with newlines stripped. A Scribe transcript that should have looked like this:
Patient: I've been feeling more anxious about work.
Clinician: Can you tell me more about what's changed?
Patient: My boss reorganized the team...
Would instead arrive as:
Patient: I've been feeling more anxious about work. Clinician: Can you tell me more about what's changed? Patient: My boss reorganized the team...
This is not a trivial UI glitch. For a therapeutic transcript, losing the line breaks loses the structure that makes it readable and useful. The model would try to reason about the session based on a jumbled one-liner, and the output would degrade accordingly.
The root cause was in the server-sent events (SSE) pipeline that streams responses from PsyFiGPT back to your browser. When tool output containing newlines was wrapped in SSE format, the newlines were being interpreted as SSE event terminators rather than content. We traced it to apps/tools/integration.py:102, fixed it to route multi-line output through the proper SSE encoder (the same encoder the legacy non-tool path uses), and deployed the fix in PR #381 (commit 202152e, merged June 2, 2026).
This is the kind of plumbing bug that you only find when you use the system in real clinical workflows. It would not show up in unit tests (which test small pieces in isolation). It would not show up in demos (which typically use short, single-line tool outputs). It only appeared because real clinicians started pulling real multi-line transcripts. We found it, fixed it, and re-validated end-to-end on production.
Why mention this in a blog post? Because clinical AI tools have to work on real workflows, not just look good in demos. The fix is technical, but the principle is not: we test everything end-to-end before claiming it works, and we are transparent when something does not.
An example workflow — what tools enable today
Let me walk through a concrete scenario using the tools that are live now.
Scenario: You finished a session this morning at 9 AM where the patient described a meaningful shift in their primary concern. What was anxiety about social situations is now complicated by work stress. Your 90-day-old treatment plan does not reflect this shift — the classic stale treatment plan problem. You want to draft an updated treatment plan that captures the new clinical picture.
Step 1: Open PsyFiGPT and describe what you need. You write: "Pull my 9 AM session this morning and draft a treatment plan update."
Step 2: The model recognizes it needs the transcript. PsyFiGPT reads your request and understands that to draft an accurate treatment plan update, it needs to see what was actually discussed. It invokes get_scribe_transcript with the date and time context you provided.
Step 3: The tool runs and returns the transcript. The get_scribe_transcript function queries your Scribe account for the session at 9 AM today. It returns the full transcript, along with a brief session summary. This happens server-to-server inside the PsyFi-controlled environment — the transcript data never leaves.
Step 4: The model uses the transcript to draft the update. Now the model can see what was actually said in the session. It notices the shift from social anxiety to work stress, recognizes the functional impact the patient described, and drafts a treatment plan update that reflects the new focus. The draft includes:
- Updated presenting concern
- Revised treatment goal language
- New or adjusted interventions targeting the emerging focus
- Any changes to the measurement strategy
Step 5: You review and refine. You read the draft, perhaps edit for your voice or clinical framework, and paste the final version into your EHR. If you are still working out where AI drafts belong in your charting flow, see Adding AI Notes to Your EHR Workflow Without Breaking What Already Works.
The entire workflow — from "I want an updated treatment plan" to a clinically sound draft — happens in one chat. PHI never left the PsyFi system. The audit trail shows exactly when you pulled the transcript and for what purpose.
This is the goal of the tools framework: to collapse multi-step, multi-system workflows into a single, auditable action within the clinical AI environment.
Practical notes for getting reliable tool calls
A few things help the framework work the way you expect, based on how the live tools behave today.
Be specific about time when you can. "Pull the session from this morning at 9 AM" gives get_scribe_transcript a clean target. "Pull last week's session with the patient who mentioned the custody hearing" works less reliably, because the tool resolves sessions by time window and recency, not by transcript content.
Expect a "not found" rather than a guess. If you ask for a session outside your retention window (90 days by default), the tool returns a "not found" response and PsyFiGPT will tell you so. A tool that admits it has nothing is doing its job — the failure mode we designed against is an AI that confidently reasons about a session it never actually fetched.
Tool activity is reviewable. Every invocation is logged with timestamp and tool name, and practice administrators can review that activity the same way they review other access to clinical data. If your practice runs periodic compliance reviews, tool calls are part of the record, not a blind spot.
What's coming next — honest roadmap signal
We are working on more tools. The category is clear: clinical data that lives inside PsyFi systems and that clinicians currently have to manually extract for use in reasoning.
- Search-my-notes — Find past progress notes or assessment results by keyword or date range, pull them into chat.
- Draft-from-template — Some team prompts will be wired to invoke tools that load template content or fetch patient-specific data (demographics, previous diagnoses, medication list) to seed the draft.
- More assessment-tool parsers — The BASC parser is Phase 2. Phase 3 will include parsers for CESD, SCARED, DASS-21, and other validated instruments commonly used in behavioral health.
We have no specific ship dates to announce. What we will do: only ship tools that are tested end-to-end with real data, audit-logged for compliance, and documented for clinicians. If you have a workflow that you manually repeat and that involves pulling data from inside PsyFi, tell us — that is a tool candidate.
On the longer-term roadmap: custom tool support, where a practice can define its own tools (for example, "fetch patient from our practice EHR by ID"). That is not coming soon, but it is something we are thinking about.
This is part of our complete guide to HIPAA-compliant AI for behavioral health practices. For the cross-product story behind the headline get_scribe_transcript tool, see PsyFiGPT Now Reads Your PsyFi Scribe Sessions.
PsyFiGPT is HIPAA-compliant clinical documentation software backed by a Business Associate Agreement. For questions about implementation in your practice, contact our onboarding team at hello@psyfigpt.com.