Skip to main content
Every Synthetiq app can include an in-app AI agent that understands and can interact with the app’s API surface, data model, and connected services. The agent always assumes the scopes and permissions of the user using it, as defined in scopes.json (see Add access control). The framework handles the agent loop, tool execution, chat history, context compaction, streaming, and scope enforcement. It auto-generates system prompts from the app’s procedures, database schema, and connected services. You simply provide the LLM integration and customize the agent’s instructions.

LLM integration

The AI agent needs an LLM service. Install the Anthropic service client:
Configure it in src/server/lib/agentLLM.ts (this file is scaffolded when you create the app):
The client handles authentication automatically using platform-managed credentials — app code never sees API keys.

System prompt

Customize the agent’s personality for the task tracker in src/server/lib/appSystemPrompt.ts:
The framework automatically appends the API manifest, database schema, and service metadata to this prompt — so the agent knows about every procedure, table, and service tool without you listing them manually.

Scope-aware tool access

The agent only sees and can access procedures that the authenticated user has permission to call. A user with the tasks:viewAll scope sees the getAllTasks tool; a regular user only sees getMyTasks. This filtering happens automatically based on the user’s roles. Additionally, you can give the AI agent direct access to service tools. For example, to let admins with the slack:post scope ask the agent to post Slack messages, add the scope and update the services section of scopes.json:
The requiredScopes array gates access to the entire Slack service — only users with the slack:post scope can use any Slack tools through the AI agent. You can also gate specific tools individually via the tools object. For more details, see the Access control reference.

Chat UI

The framework provides all the components needed to build an in-app AI chat. Here’s an example:
The useAgentChat hook manages sessions, message history, streaming, and state. The framework provides ChatMessageComponent, ChatInput, ToolCallsPanel, and ProcessingStage — you arrange and style them as needed.

Capabilities

With the task tracker’s procedures, database schema, and connected services, users can now ask the agent things like:
  • “What tasks do I have this week?”
  • “Create a high-priority task called ‘Update API docs’”
  • “Mark the ‘Fix login bug’ task as completed”
  • “How many active tasks do I have?”
Admins with additional scopes can also ask:
  • “Show me all tasks across the team”
  • “Who has the most overdue tasks?”
  • “Post a summary of today’s completed tasks to Slack” (requires slack:post scope)