Skip to content

Commit 86486d5

Browse files
authored
v0.7.51: hybrid search for knowledgebases, ui improvements, db perf improvements, claude managed agents tools, realtime files and tables
v0.7.51: hybrid search for knowledgebases, ui improvements, db perf improvements, claude managed agents tools, realtime files and tables
2 parents 19d929b + 06506bb commit 86486d5

342 files changed

Lines changed: 60000 additions & 3226 deletions

File tree

Some content is hidden

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

.devcontainer/docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ services:
1919
- BETTER_AUTH_SECRET=${BETTER_AUTH_SECRET:-your_auth_secret_here}
2020
- ENCRYPTION_KEY=${ENCRYPTION_KEY:-your_encryption_key_here}
2121
- COPILOT_API_KEY=${COPILOT_API_KEY}
22+
- NEXT_PUBLIC_CHAT_DISABLED=${NEXT_PUBLIC_CHAT_DISABLED:-}
2223
- SIM_AGENT_API_URL=${SIM_AGENT_API_URL}
2324
- OLLAMA_URL=${OLLAMA_URL:-http://localhost:11434}
2425
- NEXT_PUBLIC_SOCKET_URL=${NEXT_PUBLIC_SOCKET_URL:-}

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ jobs:
252252
echo "ERROR: DEV_TRIGGER_ACCESS_TOKEN and TRIGGER_PROJECT_ID repo secrets must both be set" >&2
253253
exit 1
254254
fi
255-
bunx trigger.dev@4.4.3 deploy --env preview --branch dev-sim
255+
bunx trigger.dev@4.5.7 deploy --env preview --branch dev-sim
256256
257257
# Main/staging: build AMD64 images and push sha-tagged images to ECR + GHCR.
258258
# Runs in parallel with tests — only immutable sha tags are pushed here, and

apps/docs/content/docs/en/integrations/knowledge.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ Search for similar content in a knowledge base using vector similarity
4343
| `query` | string | No | Search query text \(optional when using tag filters\) |
4444
| `topK` | number | No | Number of most similar results to return \(1-100\) |
4545
| `tagFilters` | array | No | Array of tag filters with tagName and tagValue properties |
46+
| `searchMode` | string | No | Retrieval mode: 'vector' \(default\) uses semantic similarity only, 'hybrid' also runs a full-text leg and fuses both |
4647
| `rerankerEnabled` | boolean | No | Whether to apply Cohere reranking to vector search results |
4748
| `rerankerModel` | string | No | Cohere rerank model to use \(one of: rerank-v4.0-pro, rerank-v4.0-fast, rerank-v3.5\) |
4849
| `rerankerInputCount` | number | No | Number of vector results sent to the Cohere reranker \(1–100\). Defaults to topK × 4 capped at 100. |

apps/docs/content/docs/en/integrations/managed_agent.mdx

Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,200 @@ Open a Claude Platform Managed Agent session and return the assistant response a
6464
| `inputTokens` | number | Cumulative input tokens for the session. |
6565
| `outputTokens` | number | Cumulative output tokens for the session. |
6666

67+
### `managed_agent_create_session`
68+
69+
Create a Claude Platform Managed Agent session and return its id without waiting for a reply.
70+
71+
#### Input
72+
73+
| Parameter | Type | Required | Description |
74+
| --------- | ---- | -------- | ----------- |
75+
| `agent` | string | Yes | Managed-agent id inside the linked Claude workspace. |
76+
| `environment` | string | Yes | Environment id inside the linked Claude workspace. |
77+
| `environmentType` | string | No | Environment execution model hint \('cloud' \| 'self_hosted'\). |
78+
| `userMessage` | string | No | Optional first message; seeds initial_events and starts the agent immediately. |
79+
| `vaults` | array | No | Zero or more vault ids for MCP tool auth. |
80+
| `vaultsAck` | boolean | No | Acknowledgement that the author may use the attached vaults. |
81+
| `memoryStoreId` | string | No | Optional Agent Memory Store id. |
82+
| `memoryAccess` | string | No | Memory store access mode: 'read_write' \(default\) or 'read_only'. |
83+
| `memoryInstructions` | string | No | Per-attachment guidance for how the agent should use the memory store. |
84+
| `files` | array | No | File attachments \(cloud envs only\), as \[\{fileId, mountPath?\}\]. |
85+
| `sessionParameters` | object | No | Key/value session metadata forwarded to the session. |
86+
87+
#### Output
88+
89+
| Parameter | Type | Description |
90+
| --------- | ---- | ----------- |
91+
| `sessionId` | string | Anthropic session id \(sesn_...\). |
92+
| `started` | boolean | True when a first message was seeded, so the agent is already running. |
93+
94+
### `managed_agent_send_message`
95+
96+
Send a user message to an existing Claude Platform Managed Agent session.
97+
98+
#### Input
99+
100+
| Parameter | Type | Required | Description |
101+
| --------- | ---- | -------- | ----------- |
102+
| `userMessage` | string | Yes | The user message to send to the session. |
103+
104+
#### Output
105+
106+
| Parameter | Type | Description |
107+
| --------- | ---- | ----------- |
108+
| `sessionId` | string | The session the message was sent to. |
109+
| `sent` | boolean | True when the event was accepted by the API. |
110+
111+
### `managed_agent_get_session`
112+
113+
Read a Managed Agent session: status, stop reason, token usage, metadata, and any tool calls awaiting approval.
114+
115+
#### Input
116+
117+
| Parameter | Type | Required | Description |
118+
| --------- | ---- | -------- | ----------- |
119+
120+
#### Output
121+
122+
| Parameter | Type | Description |
123+
| --------- | ---- | ----------- |
124+
| `sessionId` | string | The session that was read. |
125+
| `status` | string | Session status — 'idle', 'running', 'rescheduling', or 'terminated'. |
126+
| `stopReason` | string | Why the session last stopped, e.g. 'end_turn' or 'requires_action'. |
127+
| `requiresAction` | boolean | True when the session is waiting on a tool confirmation or custom tool result. If this is true while pendingTools is empty, the session is blocked but the API named no blocking events — surface it rather than treating the session as done. |
128+
| `pendingTools` | json | Blocking tool calls — \[\{id, eventType, kind, name, input\}\]. Route by kind: 'confirmation' ids go to Respond To Tool Confirmation, 'custom_tool_result' ids go to Respond To Custom Tool. |
129+
| `metadata` | json | Session metadata. |
130+
| `title` | string | Session title. |
131+
| `inputTokens` | number | Cumulative input tokens. |
132+
| `outputTokens` | number | Cumulative output tokens. |
133+
134+
### `managed_agent_list_events`
135+
136+
Read a Managed Agent session's event history and the agent's reply text.
137+
138+
#### Input
139+
140+
| Parameter | Type | Required | Description |
141+
| --------- | ---- | -------- | ----------- |
142+
| `eventTypes` | array | No | Optional event-type filter, e.g. \['agent.message'\]. Omit to return every event. |
143+
| `limit` | number | No | Maximum events to return, keeping the most recent \(default 500\). |
144+
145+
#### Output
146+
147+
| Parameter | Type | Description |
148+
| --------- | ---- | ----------- |
149+
| `sessionId` | string | The session that was read. |
150+
| `events` | json | Session events, oldest first. |
151+
| `count` | number | Number of events returned. |
152+
| `assistantText` | string | Concatenated text of every persisted agent.message, in order. |
153+
| `truncated` | boolean | True when the limit was hit and older events were dropped. |
154+
155+
### `managed_agent_update_session`
156+
157+
Update a Managed Agent session's title or metadata.
158+
159+
#### Input
160+
161+
| Parameter | Type | Required | Description |
162+
| --------- | ---- | -------- | ----------- |
163+
| `title` | string | No | New session title. |
164+
| `sessionParameters` | object | No | Replacement metadata map \(replaces all stored metadata, not merged\). Leaving it empty leaves the stored metadata unchanged — use clearMetadata to remove it. |
165+
| `clearMetadata` | boolean | No | Removes all of the session's stored metadata. Overrides any map supplied above. |
166+
167+
#### Output
168+
169+
| Parameter | Type | Description |
170+
| --------- | ---- | ----------- |
171+
| `sessionId` | string | The session that was updated. |
172+
| `updated` | boolean | True when the update was accepted. |
173+
| `metadata` | json | Metadata after the update. |
174+
| `title` | string | Title after the update. |
175+
176+
### `managed_agent_interrupt_session`
177+
178+
Stop a running Managed Agent session; it stays usable afterwards.
179+
180+
#### Input
181+
182+
| Parameter | Type | Required | Description |
183+
| --------- | ---- | -------- | ----------- |
184+
185+
#### Output
186+
187+
| Parameter | Type | Description |
188+
| --------- | ---- | ----------- |
189+
| `sessionId` | string | The session that was interrupted. |
190+
| `interrupted` | boolean | True when the interrupt was accepted. |
191+
192+
### `managed_agent_respond_tool_confirmation`
193+
194+
Allow or deny the tool calls a Managed Agent session is waiting on before it can continue.
195+
196+
#### Input
197+
198+
| Parameter | Type | Required | Description |
199+
| --------- | ---- | -------- | ----------- |
200+
| `toolUseIds` | array | Yes | Blocking tool-use EVENT ids, from Get Session pendingTools\[\].id where kind is 'confirmation' \(not toolu_ ids\). |
201+
| `decision` | string | Yes | 'allow' to let the tools run, or 'deny' to reject them. |
202+
| `denyMessage` | string | No | Reason surfaced to the agent. Only sent when the decision is deny. |
203+
204+
#### Output
205+
206+
| Parameter | Type | Description |
207+
| --------- | ---- | ----------- |
208+
| `sessionId` | string | The session that was answered. |
209+
| `decision` | string | The decision applied — 'allow' or 'deny'. |
210+
| `confirmedToolUseIds` | json | The tool-use event ids that were answered. |
211+
212+
### `managed_agent_respond_custom_tool`
213+
214+
Return the result of a custom tool a Managed Agent session is waiting on so it can continue.
215+
216+
#### Input
217+
218+
| Parameter | Type | Required | Description |
219+
| --------- | ---- | -------- | ----------- |
220+
| `customToolUseId` | string | Yes | The custom tool-use EVENT id being answered, from Get Session pendingTools\[\].id where kind is 'custom_tool_result'. |
221+
| `result` | string | Yes | The tool's output, returned to the agent as text. |
222+
| `isError` | boolean | No | Mark the result as a failure so the agent can adjust its approach. |
223+
224+
#### Output
225+
226+
| Parameter | Type | Description |
227+
| --------- | ---- | ----------- |
228+
| `sessionId` | string | The session that was answered. |
229+
| `answeredToolUseId` | string | The custom tool-use event id that was answered. |
230+
231+
### `managed_agent_archive_session`
232+
233+
Archive a Managed Agent session, preserving its history. Not reversible.
234+
235+
#### Input
236+
237+
| Parameter | Type | Required | Description |
238+
| --------- | ---- | -------- | ----------- |
239+
240+
#### Output
241+
242+
| Parameter | Type | Description |
243+
| --------- | ---- | ----------- |
244+
| `sessionId` | string | The session that was archived. |
245+
| `archived` | boolean | True when the archive was accepted. |
246+
247+
### `managed_agent_delete_session`
248+
249+
Permanently delete a Managed Agent session, its events, and its sandbox. Not reversible.
250+
251+
#### Input
252+
253+
| Parameter | Type | Required | Description |
254+
| --------- | ---- | -------- | ----------- |
255+
256+
#### Output
257+
258+
| Parameter | Type | Description |
259+
| --------- | ---- | ----------- |
260+
| `sessionId` | string | The session that was deleted. |
261+
| `deleted` | boolean | True when the delete was accepted. |
262+
67263

apps/docs/content/docs/en/knowledgebase/using-in-workflows.mdx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,19 @@ In our example, adding `Department equals "Billing"` makes the search consider o
3737

3838
Filters run before the vector comparison, so they make a search both more precise and cheaper. See [Tags and filtering](/knowledgebase/tags) for the full operator list by tag type.
3939

40+
## Retrieval Mode
41+
42+
**Retrieval Mode** is an advanced setting that chooses how matches are found.
43+
44+
| Mode | What it does |
45+
| --- | --- |
46+
| Vector only | The default. Ranks purely on meaning, as described above. |
47+
| Hybrid | Also runs a keyword search over the same chunks and blends the two rankings. |
48+
49+
Semantic search is strong on paraphrase and weak on literal strings: an error code, a ticket key like `PROJ-1234`, a SKU, or a rare product name carries little meaning for the model, so the chunk containing it may not rank near the top. Hybrid adds a keyword pass that matches those tokens exactly, then merges the two lists so a chunk found by either signal can surface.
50+
51+
Turn it on when your documents are full of identifiers, codes, or names people search for verbatim. Leave it off for prose-heavy bases where questions are asked in natural language. Hybrid costs no extra API calls — the keyword pass runs entirely in the database.
52+
4053
## Rerank Results
4154

4255
**Rerank Results** is an optional second pass. Vector search ranks by raw similarity; reranking re-scores the top matches with a dedicated relevance model (Cohere's rerank models) and reorders them, which sharpens the ordering when the best answer isn't the literal closest vector.
@@ -95,6 +108,7 @@ When the agent's answer is off, the cause is usually in retrieval, not the agent
95108
- **No results, or wrong documents.** A tag filter may be excluding what you want, or the documents may not be indexed yet. A document is only searchable once its processing status is `completed`; while it is `pending`, `processing`, or `failed`, its chunks won't appear.
96109
- **Low similarity scores across the board.** The query is too vague, or the information simply isn't in the base. Rewrite the query to match how the documents phrase things.
97110
- **Right documents, wrong order.** Turn on Rerank Results, or raise Number of Results so the relevant chunk is included.
111+
- **An exact code, ID, or name isn't found.** Switch Retrieval Mode to Hybrid so a keyword pass runs alongside the semantic one.
98112

99113
See [debugging retrieval](/knowledgebase/debugging-retrieval) for the full diagnostic path, and [chunking strategies](/knowledgebase/chunking-strategies) for how chunk boundaries shape what a search can return.
100114

apps/docs/content/docs/en/platform/self-hosting/environment-variables.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ import { Callout } from 'fumadocs-ui/components/callout'
6464
| Variable | Description |
6565
|----------|-------------|
6666
| `API_ENCRYPTION_KEY` | Encrypts stored API keys (32 hex chars): `openssl rand -hex 32` |
67-
| `COPILOT_API_KEY` | API key for copilot features |
67+
| `COPILOT_API_KEY` | API key for Chat. Without it the Sim Chat block, scheduled prompt jobs, and Inbox cannot run |
68+
| `NEXT_PUBLIC_CHAT_DISABLED` | Set to `true` to hide the Chat module: the workspace lands on your first workflow, with no chats list, scheduled tasks, or editor Chat panel. Chat is shown when unset; `bun run setup` sets it for you if you skip the chat key |
6869
| `ADMIN_API_KEY` | Admin API key for GitOps operations |
6970
| `ALLOWED_LOGIN_DOMAINS` | Restrict signups to domains (comma-separated) |
7071
| `ALLOWED_LOGIN_EMAILS` | Restrict signups to specific emails (comma-separated) |

apps/docs/content/docs/en/workflows/blocks/pi.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ The one case neither layer can rescue is a *first* prompt that already exceeds t
211211

212212
### Create PR [#setup-cloud-pr]
213213

214-
Create PR runs in a sandbox image with the Pi CLI and git baked in.
214+
Create PR runs in a sandbox image with the Pi CLI, Git, Node.js, and Bun baked in. Repository dependencies are not preinstalled; Pi can run `bun install` when a repository needs them.
215215

216216
1. **Enable sandbox execution.** On self-hosted Sim, set `E2B_ENABLED=true`, `E2B_API_KEY`, `E2B_PI_TEMPLATE_ID` (the Pi template id), and `NEXT_PUBLIC_E2B_ENABLED=true` (this reveals Create PR, Update PR, and Review Code in the UI). Build the template with `bun run apps/sim/scripts/build-pi-e2b-template.ts`. These modes stay hidden until `NEXT_PUBLIC_E2B_ENABLED` is set.
217217

apps/docs/openapi.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6040,7 +6040,7 @@
60406040
"post": {
60416041
"operationId": "searchKnowledgeBase",
60426042
"summary": "Search Knowledge Base",
6043-
"description": "Perform vector similarity search across one or more knowledge bases. Supports semantic search via query text, tag-based filtering, or a combination of both.",
6043+
"description": "Search across one or more knowledge bases. Supports semantic search via query text, tag-based filtering, or a combination of both. Set `searchMode` to `hybrid` to additionally run a full-text keyword leg and fuse it with the semantic results.",
60446044
"tags": ["Knowledge Bases"],
60456045
"x-codeSamples": [
60466046
{
@@ -6095,14 +6095,21 @@
60956095
"items": {
60966096
"$ref": "#/components/schemas/TagFilter"
60976097
}
6098+
},
6099+
"searchMode": {
6100+
"type": "string",
6101+
"enum": ["vector", "hybrid"],
6102+
"default": "vector",
6103+
"description": "Retrieval strategy. `vector` ranks purely on embedding similarity. `hybrid` also runs a full-text keyword search and fuses the two rankings by reciprocal rank, which retrieves exact tokens — error codes, ticket keys, identifiers, rare product names — that embeddings alone rank poorly. Ignored when only tagFilters are provided."
60986104
}
60996105
}
61006106
},
61016107
"example": {
61026108
"workspaceId": "wsp_abc123",
61036109
"knowledgeBaseIds": ["d2c8f4a6-1b3e-4c5d-9e7f-8a0b2c4d6e1f"],
61046110
"query": "How do I reset my password?",
6105-
"topK": 5
6111+
"topK": 5,
6112+
"searchMode": "hybrid"
61066113
}
61076114
}
61086115
}

apps/realtime/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,12 @@
3333
"@sim/workflow-types": "workspace:*",
3434
"@socket.io/redis-adapter": "8.3.0",
3535
"drizzle-orm": "^0.45.2",
36+
"lib0": "0.2.117",
3637
"postgres": "^3.4.5",
3738
"redis": "5.10.0",
3839
"socket.io": "^4.8.1",
40+
"y-protocols": "1.0.7",
41+
"yjs": "13.6.31",
3942
"zod": "4.3.6"
4043
},
4144
"devDependencies": {

0 commit comments

Comments
 (0)