Skip to content

Commit cf1792e

Browse files
committed
Merge branch 'staging' into fix/logs-files
2 parents 36e6133 + 0ca25bb commit cf1792e

File tree

43 files changed

+1925
-345
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1925
-345
lines changed

apps/docs/components/icons.tsx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5462,3 +5462,24 @@ export function EnrichSoIcon(props: SVGProps<SVGSVGElement>) {
54625462
</svg>
54635463
)
54645464
}
5465+
5466+
export function AgentSkillsIcon(props: SVGProps<SVGSVGElement>) {
5467+
return (
5468+
<svg
5469+
{...props}
5470+
xmlns='http://www.w3.org/2000/svg'
5471+
width='16'
5472+
height='16'
5473+
viewBox='0 0 16 16'
5474+
fill='none'
5475+
>
5476+
<path
5477+
d='M8 1L14.0622 4.5V11.5L8 15L1.93782 11.5V4.5L8 1Z'
5478+
stroke='currentColor'
5479+
strokeWidth='1.5'
5480+
fill='none'
5481+
/>
5482+
<path d='M8 4.5L11 6.25V9.75L8 11.5L5 9.75V6.25L8 4.5Z' fill='currentColor' />
5483+
</svg>
5484+
)
5485+
}

apps/docs/content/docs/en/skills/index.mdx

Lines changed: 57 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ This means you can attach many skills to an agent without bloating its context w
1818

1919
## Creating Skills
2020

21-
Go to **Settings** (gear icon) and select **Skills** under the Tools section.
21+
Go to **Settings** and select **Skills** under the Tools section.
22+
23+
![Manage Skills](/static/skills/manage-skills.png)
2224

2325
Click **Add** to create a new skill with three fields:
2426

@@ -52,11 +54,22 @@ Use when the user asks you to write, optimize, or debug SQL queries.
5254
...
5355
```
5456

57+
**Recommended structure:**
58+
- **When to use** — Specific triggers and scenarios
59+
- **Instructions** — Step-by-step guidance with numbered lists
60+
- **Examples** — Input/output samples showing expected behavior
61+
- **Common Patterns** — Reusable approaches for frequent tasks
62+
- **Edge Cases** — Gotchas and special considerations
63+
64+
Keep skills focused and under 500 lines. If a skill grows too large, split it into multiple specialized skills.
65+
5566
## Adding Skills to an Agent
5667

5768
Open any **Agent** block and find the **Skills** dropdown below the tools section. Select the skills you want the agent to have access to.
5869

59-
Selected skills appear as chips that you can click to edit or remove.
70+
![Add Skill](/static/skills/add-skill.png)
71+
72+
Selected skills appear as cards that you can click to edit or remove.
6073

6174
### What Happens at Runtime
6275

@@ -69,12 +82,50 @@ When the workflow runs:
6982

7083
This works across all supported LLM providers — the `load_skill` tool uses standard tool-calling, so no provider-specific configuration is needed.
7184

72-
## Tips
85+
## Common Use Cases
86+
87+
Skills are most valuable when agents need specialized knowledge or multi-step workflows:
88+
89+
**Domain Expertise**
90+
- `api-integration-expert` — Best practices for calling specific APIs (authentication, rate limiting, error handling)
91+
- `data-transformation` — ETL patterns, data cleaning, and validation rules
92+
- `code-reviewer` — Code review guidelines specific to your team's standards
93+
94+
**Workflow Templates**
95+
- `bug-investigation` — Step-by-step debugging methodology (reproduce → isolate → test → fix)
96+
- `feature-implementation` — Development workflow from requirements to deployment
97+
- `document-generator` — Templates and formatting rules for technical documentation
98+
99+
**Company-Specific Knowledge**
100+
- `our-architecture` — System architecture diagrams, service dependencies, and deployment processes
101+
- `style-guide` — Brand guidelines, writing tone, UI/UX patterns
102+
- `customer-onboarding` — Standard procedures and common customer questions
103+
104+
**When to use skills vs. agent instructions:**
105+
- Use **skills** for knowledge that applies across multiple workflows or changes frequently
106+
- Use **agent instructions** for task-specific context that's unique to a single agent
107+
108+
## Best Practices
109+
110+
**Writing Effective Descriptions**
111+
- **Be specific and keyword-rich** — Instead of "Helps with SQL", write "Write optimized SQL queries for PostgreSQL, MySQL, and SQLite, including index recommendations and query plan analysis"
112+
- **Include activation triggers** — Mention specific words or phrases that should prompt the skill (e.g., "Use when the user mentions PDFs, forms, or document extraction")
113+
- **Keep it under 200 words** — Agents scan descriptions quickly; make every word count
73114

74-
- **Keep descriptions actionable** — Instead of "Helps with SQL", write "Write optimized SQL queries for PostgreSQL, MySQL, and SQLite, including index recommendations and query plan analysis"
115+
**Skill Scope and Organization**
75116
- **One skill per domain** — A focused `sql-expert` skill works better than a broad `database-everything` skill
76-
- **Use markdown structure** — Headers, lists, and code blocks help the agent parse and follow instructions
77-
- **Test iteratively** — Run your workflow and check if the agent activates the skill when expected
117+
- **Limit to 5-10 skills per agent** — More skills = more decision overhead; start small and add as needed
118+
- **Split large skills** — If a skill exceeds 500 lines, break it into focused sub-skills
119+
120+
**Content Structure**
121+
- **Use markdown formatting** — Headers, lists, and code blocks help agents parse and follow instructions
122+
- **Provide examples** — Show input/output pairs so agents understand expected behavior
123+
- **Be explicit about edge cases** — Don't assume agents will infer special handling
124+
125+
**Testing and Iteration**
126+
- **Test activation** — Run your workflow and verify the agent loads the skill when expected
127+
- **Check for false positives** — Make sure skills aren't activating when they shouldn't
128+
- **Refine descriptions** — If a skill isn't loading when needed, add more keywords to the description
78129

79130
## Learn More
80131

apps/docs/content/docs/en/tools/airweave.mdx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,21 @@ import { BlockInfoCard } from "@/components/ui/block-info-card"
1010
color="#6366F1"
1111
/>
1212

13+
{/* MANUAL-CONTENT-START:intro */}
14+
[Airweave](https://airweave.ai/) is an AI-powered semantic search platform that helps you discover and retrieve knowledge across all your synced data sources. Built for modern teams, Airweave enables fast, relevant search results using neural, hybrid, or keyword-based strategies tailored to your needs.
15+
16+
With Airweave, you can:
17+
18+
- **Search smarter**: Use natural language queries to uncover information stored across your connected tools and databases
19+
- **Unify your data**: Seamlessly access content from sources like code, docs, chat, emails, cloud files, and more
20+
- **Customize retrieval**: Select between hybrid (semantic + keyword), neural, or keyword search strategies for optimal results
21+
- **Boost recall**: Expand search queries with AI to find more comprehensive answers
22+
- **Rerank results using AI**: Prioritize the most relevant answers with powerful language models
23+
- **Get instant answers**: Generate clear, AI-powered responses synthesized from your data
24+
25+
In Sim, the Airweave integration empowers your agents to search, summarize, and extract insights from all your organization’s data via a single tool. Use Airweave to drive rich, contextual knowledge retrieval within your workflows—whether answering questions, generating summaries, or supporting dynamic decision-making.
26+
{/* MANUAL-CONTENT-END */}
27+
1328
## Usage Instructions
1429

1530
Search across your synced data sources using Airweave. Supports semantic search with hybrid, neural, or keyword retrieval strategies. Optionally generate AI-powered answers from search results.
27.9 KB
Loading
56.2 KB
Loading

apps/sim/app/api/copilot/chat/route.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,14 @@ export async function POST(req: NextRequest) {
285285
apiVersion: 'preview',
286286
endpoint: env.AZURE_OPENAI_ENDPOINT,
287287
}
288+
} else if (providerEnv === 'azure-anthropic') {
289+
providerConfig = {
290+
provider: 'azure-anthropic',
291+
model: envModel,
292+
apiKey: env.AZURE_ANTHROPIC_API_KEY,
293+
apiVersion: env.AZURE_ANTHROPIC_API_VERSION,
294+
endpoint: env.AZURE_ANTHROPIC_ENDPOINT,
295+
}
288296
} else if (providerEnv === 'vertex') {
289297
providerConfig = {
290298
provider: 'vertex',

apps/sim/app/api/function/execute/route.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -845,6 +845,8 @@ export async function POST(req: NextRequest) {
845845
contextVariables,
846846
timeoutMs: timeout,
847847
requestId,
848+
ownerKey: `user:${auth.userId}`,
849+
ownerWeight: 1,
848850
})
849851

850852
const executionTime = Date.now() - startTime

apps/sim/app/api/guardrails/validate/route.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,16 @@ export async function POST(request: NextRequest) {
2323
topK,
2424
model,
2525
apiKey,
26+
azureEndpoint,
27+
azureApiVersion,
28+
vertexProject,
29+
vertexLocation,
30+
vertexCredential,
31+
bedrockAccessKeyId,
32+
bedrockSecretKey,
33+
bedrockRegion,
2634
workflowId,
35+
workspaceId,
2736
piiEntityTypes,
2837
piiMode,
2938
piiLanguage,
@@ -110,7 +119,18 @@ export async function POST(request: NextRequest) {
110119
topK,
111120
model,
112121
apiKey,
122+
{
123+
azureEndpoint,
124+
azureApiVersion,
125+
vertexProject,
126+
vertexLocation,
127+
vertexCredential,
128+
bedrockAccessKeyId,
129+
bedrockSecretKey,
130+
bedrockRegion,
131+
},
113132
workflowId,
133+
workspaceId,
114134
piiEntityTypes,
115135
piiMode,
116136
piiLanguage,
@@ -178,7 +198,18 @@ async function executeValidation(
178198
topK: string | undefined,
179199
model: string,
180200
apiKey: string | undefined,
201+
providerCredentials: {
202+
azureEndpoint?: string
203+
azureApiVersion?: string
204+
vertexProject?: string
205+
vertexLocation?: string
206+
vertexCredential?: string
207+
bedrockAccessKeyId?: string
208+
bedrockSecretKey?: string
209+
bedrockRegion?: string
210+
},
181211
workflowId: string | undefined,
212+
workspaceId: string | undefined,
182213
piiEntityTypes: string[] | undefined,
183214
piiMode: string | undefined,
184215
piiLanguage: string | undefined,
@@ -219,7 +250,9 @@ async function executeValidation(
219250
topK: topK ? Number.parseInt(topK) : 10, // Default topK is 10
220251
model: model,
221252
apiKey,
253+
providerCredentials,
222254
workflowId,
255+
workspaceId,
223256
requestId,
224257
})
225258
}

apps/sim/app/api/workflows/[id]/execute/route.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,11 @@ export async function POST(req: NextRequest, { params }: { params: Promise<{ id:
325325
requestId
326326
)
327327

328+
// Client-side sessions and personal API keys bill/permission-check the
329+
// authenticated user, not the workspace billed account.
330+
const useAuthenticatedUserAsActor =
331+
isClientSession || (auth.authType === 'api_key' && auth.apiKeyType === 'personal')
332+
328333
const preprocessResult = await preprocessExecution({
329334
workflowId,
330335
userId,
@@ -334,6 +339,7 @@ export async function POST(req: NextRequest, { params }: { params: Promise<{ id:
334339
checkDeployment: !shouldUseDraftState,
335340
loggingSession,
336341
useDraftState: shouldUseDraftState,
342+
useAuthenticatedUserAsActor,
337343
})
338344

339345
if (!preprocessResult.success) {

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/skill-input/skill-input.tsx

Lines changed: 37 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -130,39 +130,52 @@ export function SkillInput({
130130
onOpenChange={setOpen}
131131
/>
132132

133-
{selectedSkills.length > 0 && (
134-
<div className='flex flex-wrap gap-[4px]'>
135-
{selectedSkills.map((stored) => {
136-
const fullSkill = workspaceSkills.find((s) => s.id === stored.skillId)
137-
return (
133+
{selectedSkills.length > 0 &&
134+
selectedSkills.map((stored) => {
135+
const fullSkill = workspaceSkills.find((s) => s.id === stored.skillId)
136+
return (
137+
<div
138+
key={stored.skillId}
139+
className='group relative flex flex-col overflow-hidden rounded-[4px] border border-[var(--border-1)] transition-all duration-200 ease-in-out'
140+
>
138141
<div
139-
key={stored.skillId}
140-
className='flex cursor-pointer items-center gap-[4px] rounded-[4px] border border-[var(--border-1)] bg-[var(--surface-5)] px-[6px] py-[2px] font-medium text-[12px] text-[var(--text-secondary)] hover:bg-[var(--surface-6)]'
142+
className='flex cursor-pointer items-center justify-between gap-[8px] rounded-t-[4px] bg-[var(--surface-4)] px-[8px] py-[6.5px]'
141143
onClick={() => {
142144
if (fullSkill && !disabled && !isPreview) {
143145
setEditingSkill(fullSkill)
144146
}
145147
}}
146148
>
147-
<AgentSkillsIcon className='h-[10px] w-[10px] text-[var(--text-tertiary)]' />
148-
<span className='max-w-[140px] truncate'>{resolveSkillName(stored)}</span>
149-
{!disabled && !isPreview && (
150-
<button
151-
type='button'
152-
onClick={(e) => {
153-
e.stopPropagation()
154-
handleRemove(stored.skillId)
155-
}}
156-
className='ml-[2px] rounded-[2px] p-[1px] text-[var(--text-tertiary)] hover:bg-[var(--surface-7)] hover:text-[var(--text-secondary)]'
149+
<div className='flex min-w-0 flex-1 items-center gap-[8px]'>
150+
<div
151+
className='flex h-[16px] w-[16px] flex-shrink-0 items-center justify-center rounded-[4px]'
152+
style={{ backgroundColor: '#e0e0e0' }}
157153
>
158-
<XIcon className='h-[10px] w-[10px]' />
159-
</button>
160-
)}
154+
<AgentSkillsIcon className='h-[10px] w-[10px] text-[#333]' />
155+
</div>
156+
<span className='truncate font-medium text-[13px] text-[var(--text-primary)]'>
157+
{resolveSkillName(stored)}
158+
</span>
159+
</div>
160+
<div className='flex flex-shrink-0 items-center gap-[8px]'>
161+
{!disabled && !isPreview && (
162+
<button
163+
type='button'
164+
onClick={(e) => {
165+
e.stopPropagation()
166+
handleRemove(stored.skillId)
167+
}}
168+
className='flex items-center justify-center text-[var(--text-tertiary)] transition-colors hover:text-[var(--text-primary)]'
169+
aria-label='Remove skill'
170+
>
171+
<XIcon className='h-[13px] w-[13px]' />
172+
</button>
173+
)}
174+
</div>
161175
</div>
162-
)
163-
})}
164-
</div>
165-
)}
176+
</div>
177+
)
178+
})}
166179
</div>
167180

168181
<SkillModal

0 commit comments

Comments
 (0)