Skip to content

Commit 1924da7

Browse files
committed
fix(knowledge): persist document tags in agent flows
1 parent fec8b4b commit 1924da7

6 files changed

Lines changed: 615 additions & 25 deletions

File tree

apps/sim/lib/copilot/generated/tool-catalog-v1.ts

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2710,6 +2710,22 @@ export const KnowledgeBase: ToolCatalogEntry = {
27102710
description: 'Document IDs (for batch delete_document)',
27112711
items: { type: 'string' },
27122712
},
2713+
documentTags: {
2714+
type: 'array',
2715+
description:
2716+
'Tag values to persist on a document (optional for update_document). Use tag display names from list_tags.',
2717+
items: {
2718+
type: 'object',
2719+
properties: {
2720+
tagName: {
2721+
type: 'string',
2722+
description: 'Tag display name as returned by list_tags',
2723+
},
2724+
tagValue: { type: ['string', 'number', 'boolean'], description: 'Typed tag value' },
2725+
},
2726+
required: ['tagName', 'tagValue'],
2727+
},
2728+
},
27132729
enabled: {
27142730
type: 'boolean',
27152731
description: 'Enable/disable a document (optional for update_document)',
@@ -2765,6 +2781,42 @@ export const KnowledgeBase: ToolCatalogEntry = {
27652781
'Field type: text, number, date, boolean (optional for create_tag, defaults to text)',
27662782
enum: ['text', 'number', 'date', 'boolean'],
27672783
},
2784+
tagFilters: {
2785+
type: 'array',
2786+
description: 'Tag filters applied to the query. Use tag display names from list_tags.',
2787+
items: {
2788+
type: 'object',
2789+
properties: {
2790+
operator: {
2791+
type: 'string',
2792+
description: 'Comparison operator (defaults to eq)',
2793+
enum: [
2794+
'eq',
2795+
'neq',
2796+
'contains',
2797+
'not_contains',
2798+
'starts_with',
2799+
'ends_with',
2800+
'gt',
2801+
'gte',
2802+
'lt',
2803+
'lte',
2804+
'between',
2805+
],
2806+
},
2807+
tagName: {
2808+
type: 'string',
2809+
description: 'Tag display name as returned by list_tags',
2810+
},
2811+
tagValue: { type: ['string', 'number', 'boolean'], description: 'Typed tag value' },
2812+
valueTo: {
2813+
type: ['string', 'number'],
2814+
description: 'Upper bound required by the between operator',
2815+
},
2816+
},
2817+
required: ['tagName', 'tagValue'],
2818+
},
2819+
},
27682820
topK: {
27692821
type: 'number',
27702822
description: 'Number of results to return (1-50, default: 5)',
@@ -4075,6 +4127,42 @@ export const SearchKnowledgeBase: ToolCatalogEntry = {
40754127
description: 'Knowledge base ID (required for all operations)',
40764128
},
40774129
query: { type: 'string', description: "Search query text (required for 'query')" },
4130+
tagFilters: {
4131+
type: 'array',
4132+
description: 'Tag filters applied to the query. Use tag display names from list_tags.',
4133+
items: {
4134+
type: 'object',
4135+
properties: {
4136+
operator: {
4137+
type: 'string',
4138+
description: 'Comparison operator (defaults to eq)',
4139+
enum: [
4140+
'eq',
4141+
'neq',
4142+
'contains',
4143+
'not_contains',
4144+
'starts_with',
4145+
'ends_with',
4146+
'gt',
4147+
'gte',
4148+
'lt',
4149+
'lte',
4150+
'between',
4151+
],
4152+
},
4153+
tagName: {
4154+
type: 'string',
4155+
description: 'Tag display name as returned by list_tags',
4156+
},
4157+
tagValue: { type: ['string', 'number', 'boolean'], description: 'Typed tag value' },
4158+
valueTo: {
4159+
type: ['string', 'number'],
4160+
description: 'Upper bound required by the between operator',
4161+
},
4162+
},
4163+
required: ['tagName', 'tagValue'],
4164+
},
4165+
},
40784166
topK: {
40794167
type: 'number',
40804168
description: 'Number of results to return (1-50, default: 5)',

apps/sim/lib/copilot/generated/tool-schemas-v1.ts

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2411,6 +2411,25 @@ export const TOOL_RUNTIME_SCHEMAS: Record<string, ToolRuntimeSchemaEntry> = {
24112411
type: 'string',
24122412
},
24132413
},
2414+
documentTags: {
2415+
type: 'array',
2416+
description:
2417+
'Tag values to persist on a document (optional for update_document). Use tag display names from list_tags.',
2418+
items: {
2419+
type: 'object',
2420+
properties: {
2421+
tagName: {
2422+
type: 'string',
2423+
description: 'Tag display name as returned by list_tags',
2424+
},
2425+
tagValue: {
2426+
type: ['string', 'number', 'boolean'],
2427+
description: 'Typed tag value',
2428+
},
2429+
},
2430+
required: ['tagName', 'tagValue'],
2431+
},
2432+
},
24142433
enabled: {
24152434
type: 'boolean',
24162435
description: 'Enable/disable a document (optional for update_document)',
@@ -2473,6 +2492,46 @@ export const TOOL_RUNTIME_SCHEMAS: Record<string, ToolRuntimeSchemaEntry> = {
24732492
'Field type: text, number, date, boolean (optional for create_tag, defaults to text)',
24742493
enum: ['text', 'number', 'date', 'boolean'],
24752494
},
2495+
tagFilters: {
2496+
type: 'array',
2497+
description:
2498+
'Tag filters applied to the query. Use tag display names from list_tags.',
2499+
items: {
2500+
type: 'object',
2501+
properties: {
2502+
operator: {
2503+
type: 'string',
2504+
description: 'Comparison operator (defaults to eq)',
2505+
enum: [
2506+
'eq',
2507+
'neq',
2508+
'contains',
2509+
'not_contains',
2510+
'starts_with',
2511+
'ends_with',
2512+
'gt',
2513+
'gte',
2514+
'lt',
2515+
'lte',
2516+
'between',
2517+
],
2518+
},
2519+
tagName: {
2520+
type: 'string',
2521+
description: 'Tag display name as returned by list_tags',
2522+
},
2523+
tagValue: {
2524+
type: ['string', 'number', 'boolean'],
2525+
description: 'Typed tag value',
2526+
},
2527+
valueTo: {
2528+
type: ['string', 'number'],
2529+
description: 'Upper bound required by the between operator',
2530+
},
2531+
},
2532+
required: ['tagName', 'tagValue'],
2533+
},
2534+
},
24762535
topK: {
24772536
type: 'number',
24782537
description: 'Number of results to return (1-50, default: 5)',
@@ -3753,6 +3812,46 @@ export const TOOL_RUNTIME_SCHEMAS: Record<string, ToolRuntimeSchemaEntry> = {
37533812
type: 'string',
37543813
description: "Search query text (required for 'query')",
37553814
},
3815+
tagFilters: {
3816+
type: 'array',
3817+
description:
3818+
'Tag filters applied to the query. Use tag display names from list_tags.',
3819+
items: {
3820+
type: 'object',
3821+
properties: {
3822+
operator: {
3823+
type: 'string',
3824+
description: 'Comparison operator (defaults to eq)',
3825+
enum: [
3826+
'eq',
3827+
'neq',
3828+
'contains',
3829+
'not_contains',
3830+
'starts_with',
3831+
'ends_with',
3832+
'gt',
3833+
'gte',
3834+
'lt',
3835+
'lte',
3836+
'between',
3837+
],
3838+
},
3839+
tagName: {
3840+
type: 'string',
3841+
description: 'Tag display name as returned by list_tags',
3842+
},
3843+
tagValue: {
3844+
type: ['string', 'number', 'boolean'],
3845+
description: 'Typed tag value',
3846+
},
3847+
valueTo: {
3848+
type: ['string', 'number'],
3849+
description: 'Upper bound required by the between operator',
3850+
},
3851+
},
3852+
required: ['tagName', 'tagValue'],
3853+
},
3854+
},
37563855
topK: {
37573856
type: 'number',
37583857
description: 'Number of results to return (1-50, default: 5)',

0 commit comments

Comments
 (0)