Built-in Flows
| Flow | Description | Containers Queried |
|---|---|---|
| Chat with My Data | Ask questions across all your personal data. Runs 5 parallel queries and combines results. | chatlog, userfavorites, feedback, usersettings, usernotifications |
| Chat with My History | Deep-dive into your conversation history with full message content. | chatlog |
#/admin/bootstrap]).
How It Works
The flows use a specialcosmos_internal tool provider that connects directly to the application’s own Cosmos DB — not an external data connection. The execution path:
- Flow defines a tool node with
toolIdpointing to thecosmos_internaltool - Flow orchestrator routes by
providerId: 'cosmos_internal'to a dedicated handler - Handler calls
getContainer()from the app’s own Cosmos module (same connection used by all server routes) - Partition key (
{{user.email}}) is resolved from the authenticated user’s session and passed directly to the Cosmos SDK query options - Results are fed into a prompt template and presented by the LLM
Security
- Partition key isolation — The Cosmos SDK physically restricts queries to the user’s partition. Even a
SELECT * FROM conly returns their data. - Server-enforced email — The partition key is resolved server-side from
req.user.upn.toLowerCase(), not from client input. - Container allowlist — Only 6 email-partitioned containers are permitted:
chatlog,feedback,usersettings,userfavorites,usernotifications,usernotificationpreferences. - Read-only — The tool is configured as read-only with a 30-second timeout and 100-row default limit.
Admin Setup
These flows depend on the Internal Cosmos DB Query tool (cosmos_internal). An administrator must enable both the tool and the flows before users can chat with their data.
- Bootstrap the tool — Navigate to Admin → Bootstrap Assets ([
#/admin/bootstrap]) and click Bootstrap Tools (or Bootstrap All). This registers theInternal Cosmos DB Querytool in the tools registry. - Enable the tool — Go to Admin → Tools ([
#/admin/tool]) and verify the Internal Cosmos DB Query tool is toggled on. It is enabled by default after bootstrapping, but an admin can disable it at any time to revoke access. - Bootstrap the flows — From Admin → Bootstrap Assets ([
#/admin/bootstrap]), click Bootstrap Flows (or Bootstrap All). The two flows will appear under the Personal History group in the Flow Designer. - Attach a flow to a chat — On any chat configuration, set
flowEngineEnabled: trueand select the desired flow from the Flow dropdown (or setflowEngineFlowIddirectly to the flow’s ID).
Note: If the Internal Cosmos DB Query tool is disabled or not bootstrapped, the personal data flows will fail at the tool execution step. Re-enable the tool to restore access.