diff --git a/apps/desktop/native/computer-use/ComputerUse.swift b/apps/desktop/native/computer-use/ComputerUse.swift index f3129047b73..67a01aae22e 100644 --- a/apps/desktop/native/computer-use/ComputerUse.swift +++ b/apps/desktop/native/computer-use/ComputerUse.swift @@ -116,10 +116,10 @@ func holdsFocus(_ focused: CFTypeRef, _ element: AXUIElement) -> Bool { } return false } -/// Whether typed characters land as text: a text, combo or date control, or anything with an editable -/// text selection. Buttons, lists and web areas take characters as commands instead. +/// Whether typed characters land as text: a text, combo, date or time control (`AXDateTimeArea` is an +/// NSDatePicker's field), or anything with an editable text selection. Buttons, lists and web areas take characters as commands instead. func takesText(_ element: AXUIElement) -> Bool { - if [kAXTextFieldRole, kAXTextAreaRole, kAXComboBoxRole, kAXDateFieldRole, kAXTimeFieldRole].contains(attribute(element, kAXRoleAttribute) as? String ?? "") { return true } + if [kAXTextFieldRole, kAXTextAreaRole, kAXComboBoxRole, kAXDateFieldRole, kAXTimeFieldRole, "AXDateTimeArea"].contains(attribute(element, kAXRoleAttribute) as? String ?? "") { return true } var settable: DarwinBoolean = false return AXUIElementIsAttributeSettable(element, kAXSelectedTextRangeAttribute as CFString, &settable) == .success && settable.boolValue } diff --git a/apps/desktop/native/computer-use/README.md b/apps/desktop/native/computer-use/README.md index 3c8d22e8537..c3971b54d70 100644 --- a/apps/desktop/native/computer-use/README.md +++ b/apps/desktop/native/computer-use/README.md @@ -14,7 +14,7 @@ Coordinates in action inputs are window-local points; node frames are global scr AXPress and AXSetValue are direct semantic operations. Keyboard events target the app PID. Cmd+A uses the focused editor's writable accessibility selection range where supported. Coordinate mouse input requires the target app in front; `activate_app` makes that focus change explicit and confirms it. Click/drag/scroll validate the foreground process, unchanged window geometry and the app that receives the point; the topmost window-list entry is not the click target because Notification Center and the Dock keep full-screen click-through windows. A hit on a window's own background counts as that window. Background tabs and minimized windows share bounds with the window in front, so they take no coordinate input. An action that opens UI (AXPress, AXPick, AXShowMenu) and times out while the app shows a sheet, modal or menu (`cannotComplete`) counts as dispatched; any other action that times out fails as uncertain. A menu-item press that leaves the item's own menu open with the app highlighting that item (Calendar on macOS 26) is completed with Return. Sheets, including Go to Folder and out-of-process open and save panels whose contents report no window, count as the window they are attached to. Menu item labels carry their shortcuts (for example ⇧⌘N). Some apps ignore background keyboard events. `dispatched:true,verified:false` means only dispatch succeeded; the agent must observe again to establish the outcome. No foreground activation fallback is hidden inside the helper. Native key codes currently assume the US layout for shortcuts; literal text uses Unicode events. Unsupported shortcuts fail explicitly. -`type_text` and `input_sequence` target a text control (text fields and areas, terminals, combo boxes, date fields, or anything with an editable text selection), or a container whose focused editor already holds keyboard focus, such as a web composer; keystrokes are sent only while focus is in a text input. `input_sequence` executes 1–32 key/text steps against one such element. It validates every step before dispatch and checks the same editor, window, and secure-input ancestry between steps. Enter can continue into another step when the same editor and window retain focus. Actual focus loss, Tab, or navigation shortcuts end the sequence before later input. Explicit `activateFirst: true` activates the target app inside the batch before input; it never enables automatic refocusing between steps. Partial execution reports completed steps and an error; callers must observe before retrying. Every mutation is followed by fresh state under the same authorization and queue entry; `observeAfter` optionally requests a screenshot. Observation failure is reported separately so the mutation is never replayed. The model receives a compact, bounded projection of the native snapshot; omitted nodes are reported explicitly. +`type_text` and `input_sequence` target a text control (text fields and areas, terminals, combo boxes, date and time pickers, or anything with an editable text selection), or a container whose focused editor already holds keyboard focus, such as a web composer; keystrokes are sent only while focus is in a text input. `input_sequence` executes 1–32 key/text steps against one such element. It validates every step before dispatch and checks the same editor, window, and secure-input ancestry between steps. Enter can continue into another step when the same editor and window retain focus. Actual focus loss, Tab, or navigation shortcuts end the sequence before later input. Explicit `activateFirst: true` activates the target app inside the batch before input; it never enables automatic refocusing between steps. Partial execution reports completed steps and an error; callers must observe before retrying. Every mutation is followed by fresh state under the same authorization and queue entry; `observeAfter` optionally requests a screenshot. Observation failure is reported separately so the mutation is never replayed. The model receives a compact, bounded projection of the native snapshot; omitted nodes are reported explicitly. ## Cancellation diff --git a/apps/desktop/native/computer-use/tests/Fixture.swift b/apps/desktop/native/computer-use/tests/Fixture.swift index 9e934a8ee93..6445f5bbbfb 100644 --- a/apps/desktop/native/computer-use/tests/Fixture.swift +++ b/apps/desktop/native/computer-use/tests/Fixture.swift @@ -13,6 +13,7 @@ final class FixtureDelegate: NSObject, NSApplicationDelegate { var count = 0 let counter = NSTextField(labelWithString: "Count: 0") let scrollCounter = NSTextField(labelWithString: "Scroll: 0") + let timeLabel = NSTextField(labelWithString: "Time: 10:15") func applicationDidFinishLaunching(_ notification: Notification) { NSEvent.addLocalMonitorForEvents(matching: [.leftMouseDown, .leftMouseDragged, .leftMouseUp, .scrollWheel]) { event in print("fixture-event type=\(event.type.rawValue) window=\(event.windowNumber) x=\(event.locationInWindow.x) y=\(event.locationInWindow.y)"); fflush(stdout) @@ -31,6 +32,8 @@ final class FixtureDelegate: NSObject, NSApplicationDelegate { let secure = NSSecureTextField(string: "fixture-only-secret"); secure.setAccessibilityIdentifier("fixture-password"); secure.setAccessibilityLabel("Fixture password") let button = NSButton(title: "Increment", target: self, action: #selector(increment)); button.setAccessibilityIdentifier("fixture-increment") let slider = NSSlider(value: 25, minValue: 0, maxValue: 100, target: nil, action: nil); slider.setAccessibilityLabel("Fixture slider") + let time = NSDatePicker(); time.datePickerStyle = .textField; time.datePickerElements = .hourMinute; time.setAccessibilityLabel("Fixture time") + time.dateValue = Calendar.current.date(bySettingHour: 10, minute: 15, second: 0, of: Date()) ?? Date(); time.target = self; time.action = #selector(timeChanged(_:)) let marker = MarkerView(); marker.setAccessibilityElement(false) marker.translatesAutoresizingMaskIntoConstraints = false let scroll = NSScrollView(); scroll.hasVerticalScroller = true @@ -40,7 +43,7 @@ final class FixtureDelegate: NSObject, NSApplicationDelegate { scroll.documentView = document scroll.contentView.postsBoundsChangedNotifications = true NotificationCenter.default.addObserver(self, selector: #selector(scrolled(_:)), name: NSView.boundsDidChangeNotification, object: scroll.contentView) - for view in [field, secure, button, counter, slider, marker, scrollCounter, scroll] { stack.addArrangedSubview(view) } + for view in [field, secure, button, counter, slider, time, timeLabel, marker, scrollCounter, scroll] { stack.addArrangedSubview(view) } window.contentView!.addSubview(stack) NSLayoutConstraint.activate([stack.leadingAnchor.constraint(equalTo: window.contentView!.leadingAnchor, constant: 30), stack.trailingAnchor.constraint(equalTo: window.contentView!.trailingAnchor, constant: -30), stack.topAnchor.constraint(equalTo: window.contentView!.topAnchor, constant: 30), field.widthAnchor.constraint(equalTo: stack.widthAnchor), secure.widthAnchor.constraint(equalTo: stack.widthAnchor), slider.widthAnchor.constraint(equalTo: stack.widthAnchor), scroll.widthAnchor.constraint(equalTo: stack.widthAnchor), scroll.heightAnchor.constraint(equalToConstant: 230), marker.widthAnchor.constraint(equalToConstant: 100), marker.heightAnchor.constraint(equalToConstant: 70)]) window.makeKeyAndOrderFront(nil) @@ -49,6 +52,10 @@ final class FixtureDelegate: NSObject, NSApplicationDelegate { print("fixture-ready"); fflush(stdout) } @objc func increment() { count += 1; counter.stringValue = "Count: \(count)" } + @objc func timeChanged(_ picker: NSDatePicker) { + let time = Calendar.current.dateComponents([.hour, .minute], from: picker.dateValue) + timeLabel.stringValue = "Time: \(time.hour ?? 0):\(String(format: "%02d", time.minute ?? 0))" + } @objc func scrolled(_ notification: Notification) { guard let clip = notification.object as? NSClipView else { return } scrollCounter.stringValue = "Scroll: \(Int(clip.bounds.origin.y))" diff --git a/apps/desktop/native/computer-use/tests/live.py b/apps/desktop/native/computer-use/tests/live.py index 0a3bacb4eab..f6ddf624952 100644 --- a/apps/desktop/native/computer-use/tests/live.py +++ b/apps/desktop/native/computer-use/tests/live.py @@ -119,6 +119,9 @@ def coordinate(snapshot, node, fx=0.5, fy=0.5): assert error['code'] == 'unsupported_action' and error['dispatchState'] == 'not_started', error assert find(state(), role='AXSlider')['value'] == slider['value'], 'Text reached a control that does not take text' snapshot = state() + snapshot = mutate('click', snapshot, **coordinate(snapshot, find(snapshot, role='AXDateTimeArea'), 0.15)) + snapshot = mutate('type_text', snapshot, elementId=find(snapshot, role='AXDateTimeArea')['elementId'], text='3') + assert any(node.get('value', node.get('label', '')) == 'Time: 3:15' for node in snapshot['nodes']), 'Typing did not reach the date picker' snapshot = mutate('click', snapshot, elementId=find(snapshot, role='AXTextField', label='Fixture editable text')['elementId']) snapshot = mutate('type_text', snapshot, elementId=find(snapshot, role='AXWindow')['elementId'], text=' window') assert find(snapshot, role='AXTextField', label='Fixture editable text')['value'].endswith(' window'), 'Window target did not type into its focused editor' @@ -127,7 +130,7 @@ def coordinate(snapshot, node, fx=0.5, fy=0.5): button = find(snapshot, role='AXButton', label='Increment') snapshot = mutate('perform_action', snapshot, elementId=button['elementId'], accessibilityAction='AXPress') assert any(f'Count: {baseline + 2}' in node.get('value', '') or f'Count: {baseline + 2}' in node.get('label', '') for node in snapshot['nodes']), 'Explicit AX action did not increment' - print('PASS: real fixture state, secure suppression, AX click/set/action, Unicode typing, keyboard chord, coordinate drag and scrolling, text refused by a slider, a window target typing into its focused editor, a title-bar click; every mutation verified in fresh state; screenshot=' + ('verified' if permissions['screenRecording'] else 'BLOCKED')) + print('PASS: real fixture state, secure suppression, AX click/set/action, Unicode typing, keyboard chord, coordinate drag and scrolling, text refused by a slider, typing into a date picker, a window target typing into its focused editor, a title-bar click; every mutation verified in fresh state; screenshot=' + ('verified' if permissions['screenRecording'] else 'BLOCKED')) finally: if fixture: fixture.terminate() diff --git a/apps/sim/content/library/best-crewai-alternatives-2026/index.mdx b/apps/sim/content/library/best-crewai-alternatives-2026/index.mdx new file mode 100644 index 00000000000..cfd56e20cdb --- /dev/null +++ b/apps/sim/content/library/best-crewai-alternatives-2026/index.mdx @@ -0,0 +1,241 @@ +--- +slug: best-crewai-alternatives-2026 +title: '6 Best CrewAI Alternatives in 2026 for Visual and Flexible Agent Building' +description: 'Compare the best CrewAI alternatives for visual agent building, flexible orchestration, self-hosting, and code-first control in 2026.' +date: 2026-10-16 +updated: 2026-10-16 +authors: + - andrew +readingTime: 10 +tags: [AI Agents, Agent Builders, Multi-Agent Systems, Sim] +ogImage: /library/best-crewai-alternatives-2026/cover.jpg +draft: false +faq: + - q: "What is the best CrewAI alternative?" + a: "Sim is the best CrewAI alternative overall for teams that want a visual builder, self-hosting, model flexibility, and code-level extensibility." + - q: "CrewAI is too code heavy for my team, what is a more visual alternative?" + a: "Sim is a more visual CrewAI alternative because Sim represents models, tools, conditions, API calls, and human input as inspectable workflow blocks." + - q: "I tried CrewAI but found it too rigid. What should I use instead?" + a: "Sim is the strongest replacement when CrewAI feels too rigid because Sim supports agent reasoning, deterministic logic, custom code, APIs, and human input in one visual workflow." + - q: "Is Sim better than CrewAI?" + a: "Sim is better than CrewAI for mixed technical teams that need visual editing and operational workflows, while CrewAI is better for Python developers who specifically prefer role-based agents defined in code." + - q: "Is n8n better than CrewAI?" + a: "n8n is better than CrewAI for visual integration automation, while CrewAI is better for code-defined role-based multi-agent systems." + - q: "Is Dify better than CrewAI?" + a: "Dify is better than CrewAI for visual LLM applications and retrieval-augmented generation, while CrewAI is better for Python-native role and task orchestration." + - q: "Is LangGraph better than CrewAI?" + a: "LangGraph is better than CrewAI when developers need explicit state graphs and custom control flow, but LangGraph is not a visual alternative for non-developers." + - q: "Is Microsoft AutoGen better than CrewAI?" + a: "Microsoft AutoGen is better than CrewAI for flexible research-oriented multi-agent conversations, while CrewAI offers a more opinionated role-and-task structure." + - q: "What is the best no-code alternative to CrewAI?" + a: "Sim is the best low-code visual alternative to CrewAI in this comparison, while Best No-Code and Low-Code AI Agent Builders in 2026 compares the broader no-code market." + - q: "What is the best open-source alternative to CrewAI?" + a: "Sim is the best open-source visual alternative to CrewAI because Sim’s core uses the OSI-approved Apache 2.0 license, although Sim’s enterprise code uses the separate Sim Enterprise License." + - q: "Can I self-host a CrewAI alternative?" + a: "Sim, n8n, Dify, LangGraph, and Microsoft AutoGen can all run in self-controlled infrastructure, although their licenses and deployment models differ." + - q: "Which CrewAI alternative supports local models?" + a: "Self-hosted Sim supports local models through Ollama, vLLM, LM Studio, and LiteLLM-compatible endpoints." + - q: "Which CrewAI alternative is best for non-developers?" + a: "Sim is the best CrewAI alternative for mixed teams that include non-developers because its visual builder makes workflow structure inspectable without removing developer extension points." + - q: "Which CrewAI alternative is best for developers?" + a: "LangGraph is the best CrewAI alternative for developers who want explicit state and code-level control, while Sim is better when developers must collaborate with visual users." + - q: "Which CrewAI alternative is best for multi-agent systems?" + a: "Sim is the best visual CrewAI alternative for multi-stage agent systems, while LangGraph and Microsoft AutoGen are stronger choices for teams that want to implement multi-agent behavior primarily in code." + - q: "Which CrewAI alternative is best for business process automation?" + a: "n8n is the strongest CrewAI alternative for integration-heavy business process automation, while Sim is stronger when AI agents and model-driven decisions are central to the process." + - q: "Which CrewAI alternative is best for RAG?" + a: "Dify is the most specialized CrewAI alternative for visual RAG applications, while Sim is stronger when retrieval is one stage inside a broader operational workflow." + - q: "Can Sim use my own model API keys?" + a: "Sim Cloud supports workspace-level bring-your-own-key access on every plan, and organization-level keys are available on Pro for Teams, Max for Teams, and Enterprise." + - q: "Is Sim free and open source?" + a: "Sim’s core is open source under Apache 2.0, while code in apps/sim/ee uses the separate Sim Enterprise License and requires an active Enterprise subscription for production use." + - q: "Is n8n open source?" + a: "n8n is source-available under the Sustainable Use License, not OSI-approved open source." + - q: "What is the best AI agent builder?" + a: "Sim ranks first for the visual and flexible CrewAI-replacement use case, while Best AI Agent Platforms and Builders in 2026 owns the broader best AI agent builder comparison." + - q: "Do I need to rewrite all my CrewAI code to migrate?" + a: "A CrewAI migration usually requires rebuilding orchestration, but teams can often reuse prompts, tool implementations, API contracts, test cases, and model configuration." + - q: "Should I replace CrewAI with a visual builder or another Python framework?" + a: "Sim is the better replacement when collaboration and visual inspection are the priority, while LangGraph or Microsoft AutoGen is the better replacement when code-level control is the priority." +--- + +## TL;DR + +CrewAI alternatives such as Sim, n8n, Dify, LangGraph, Microsoft AutoGen, and Make give teams different ways to replace CrewAI’s code-first orchestration model. **Sim is the best overall CrewAI alternative for teams that want a visual builder without giving up self-hosting, model choice, or extensibility.** + +[CrewAI remains a strong option for Python developers who want to define role-based agent crews and tasks](https://docs.crewai.com/) in code. The alternatives in this guide are better fits when non-developers need to inspect workflows, when teams want more deployment control, or when CrewAI’s crew-and-task abstractions feel too rigid for the system being built. + +All license, deployment, and billing-basis statements below are current as of October 2026 and link to first-party sources. + +## What are the best CrewAI alternatives in 2026? + +**Sim is the best CrewAI alternative overall, while n8n, Dify, LangGraph, Microsoft AutoGen, and Make lead for narrower visual, application, code-first, research, and automation requirements.** + +| Rank | CrewAI alternative | Best for | Visual builder | Self-hosting | Weighted score | +|---:|---|---|---:|---:|---:| +| 1 | Sim | Visual, flexible AI agent workflows | Yes | Yes | 4.75/5 | +| 2 | [n8n](https://docs.n8n.io/integrations) | Integration-heavy visual automation | Yes | Yes | 4.15/5 | +| 3 | [Dify](https://docs.dify.ai/en/self-host/use-dify/workspace/plugins) | Visual LLM applications and RAG | Yes | Yes | 3.75/5 | +| 4 | [LangGraph](https://github.com/langchain-ai/langgraph) | Custom stateful agent systems | No | Yes | 3.70/5 | +| 5 | [Microsoft AutoGen](https://microsoft.github.io/autogen/stable/user-guide/agentchat-user-guide/index.html) | Experimental multi-agent conversations | No | Yes | 3.40/5 | +| 6 | [Make](https://www.make.com/en/pricing) | SaaS automation with visual branching | Yes | No general self-hosted edition | 3.35/5 | + +The short answer is: + +- Choose **Sim** when the team wants a visual builder, an open-source core with [separately licensed enterprise features](https://github.com/simstudioai/sim/blob/main/apps/sim/ee/LICENSE), self-hosting, and the freedom to mix models, tools, and approval steps. +- Choose **[n8n](https://docs.n8n.io/integrations)** when SaaS integrations and conventional automation are more important than agent-native orchestration. +- Choose **[Dify](https://docs.dify.ai/en/self-host/use-dify/workspace/plugins)** when the primary deliverable is an LLM application, chatbot, or retrieval-augmented generation experience. +- Choose **[LangGraph](https://github.com/langchain-ai/langgraph)** when developers need explicit state, custom control flow, and code-level orchestration. +- Choose **[Microsoft AutoGen](https://microsoft.github.io/autogen/stable/user-guide/agentchat-user-guide/index.html)** when researchers or engineers want programmable multi-agent conversation patterns. +- Choose **[Make](https://www.make.com/en/pricing)** when business users need visual SaaS automation and do not require self-hosting. + +## How did we rank the best CrewAI alternatives? + +**This CrewAI alternatives ranking weights visual usability and orchestration flexibility most heavily because those are the main reasons teams move away from CrewAI.** + +Each platform received a score from 1 to 5 for five criteria: + +| Criterion | Weight | What the criterion measures | +|---|---:|---| +| Visual usability | 30% | Whether technical and semi-technical users can understand and change the workflow visually | +| Orchestration flexibility | 25% | Support for branching, tools, model choice, custom logic, and workflows beyond a fixed crew abstraction | +| Deployment and control | 20% | Self-hosting, infrastructure control, and portability | +| Multi-agent depth | 15% | Ability to coordinate multiple agents or agent-like workflow stages | +| Team governance | 10% | Collaboration, approvals, access controls, and operational oversight | + +The weighted score is the sum of each 1–5 rating multiplied by its stated weight, rounded to two decimal places. + +| Platform | Visual usability, 30% | Flexibility, 25% | Deployment, 20% | Multi-agent depth, 15% | Governance, 10% | Total | +|---|---:|---:|---:|---:|---:|---:| +| Sim | 5 × 0.30 = 1.50 | 5 × 0.25 = 1.25 | 5 × 0.20 = 1.00 | 4 × 0.15 = 0.60 | 4 × 0.10 = 0.40 | **4.75** | +| n8n | 5 × 0.30 = 1.50 | 4 × 0.25 = 1.00 | 4 × 0.20 = 0.80 | 3 × 0.15 = 0.45 | 4 × 0.10 = 0.40 | **4.15** | +| Dify | 4 × 0.30 = 1.20 | 4 × 0.25 = 1.00 | 4 × 0.20 = 0.80 | 3 × 0.15 = 0.45 | 3 × 0.10 = 0.30 | **3.75** | +| LangGraph | 1 × 0.30 = 0.30 | 5 × 0.25 = 1.25 | 5 × 0.20 = 1.00 | 5 × 0.15 = 0.75 | 4 × 0.10 = 0.40 | **3.70** | +| Microsoft AutoGen | 1 × 0.30 = 0.30 | 5 × 0.25 = 1.25 | 4 × 0.20 = 0.80 | 5 × 0.15 = 0.75 | 3 × 0.10 = 0.30 | **3.40** | +| Make | 5 × 0.30 = 1.50 | 3 × 0.25 = 0.75 | 2 × 0.20 = 0.40 | 2 × 0.15 = 0.30 | 4 × 0.10 = 0.40 | **3.35** | + +These scores compare suitability for teams leaving CrewAI because it is too code-heavy or structurally rigid; they are not a universal ranking for every agent-building use case. + +## What are the key facts about each CrewAI alternative? + +**Sim, n8n, Dify, LangGraph, Microsoft AutoGen, and Make differ most clearly in licensing, self-hosting, and what customers pay for.** + +- **Sim:** As of October 2026, [Sim’s core is Apache 2.0](https://github.com/simstudioai/sim/blob/main/LICENSE) and can be self-hosted; `apps/sim/ee` is covered by the separate [Sim Enterprise License](https://github.com/simstudioai/sim/blob/main/apps/sim/ee/LICENSE), while [Sim Cloud supports workspace BYOK on any plan and hosted model access at about 1.1 times provider cost](https://docs.sim.ai/platform/costs). +- **n8n:** As of October 2026, n8n is self-hostable under its [Sustainable Use License](https://github.com/n8n-io/n8n/blob/master/LICENSE.md), which is source-available rather than OSI-approved open source, and [n8n Cloud pricing](https://n8n.io/pricing/) is organized around workflow executions. +- **Dify:** As of October 2026, Dify can be self-hosted under the project’s [Dify Open Source License](https://github.com/langgenius/dify/blob/main/LICENSE), which adds conditions to Apache 2.0, while [Dify Cloud pricing](https://dify.ai/pricing) uses plan-based message and resource allowances. +- **LangGraph:** As of October 2026, the [LangGraph library uses the MIT License and is a low-level framework for stateful agents](https://github.com/langchain-ai/langgraph); the library itself has no required software billing unit, although model, infrastructure, and optional commercial platform costs still apply. +- **Microsoft AutoGen:** As of October 2026, [Microsoft AutoGen’s code uses the MIT License](https://github.com/microsoft/autogen/blob/main/LICENSE-CODE) and runs in infrastructure controlled by the adopter; the framework has no required software fee, leaving model and infrastructure usage as the main cost units. +- **Make:** As of October 2026, [Make is offered as a cloud-based SaaS platform rather than a general self-hosted edition](https://www.make.com/en/blog/cloud-vs-self-hosted-automation), and [Make pricing](https://www.make.com/en/pricing) measures plan usage through credits. + +## Is Sim the best visual CrewAI alternative? + +**Sim is the best visual CrewAI alternative for teams that want visual composition, code-level escape hatches, and self-hosting in one workspace.** + +Sim is the open-source AI workspace where teams build, deploy, and manage AI agents. Its visual builder exposes model calls, tools, conditions, API requests, human input, and other workflow stages as inspectable blocks, making the execution path easier to review than a Python-only CrewAI project. + +Sim is especially suitable when a workflow needs to combine agent reasoning with deterministic steps. A team can use models where judgment is useful, explicit conditions where rules are safer, and human input where approval is required. Developers can still extend the system instead of forcing every use case into a fixed no-code abstraction. + +[Self-hosted Sim supports local models through Ollama, vLLM, LM Studio, or LiteLLM-compatible endpoints](https://docs.sim.ai/platform/self-hosting/docker). [Sim Cloud supports workspace-level bring-your-own-key access on every plan, while organization-level keys require Pro for Teams, Max for Teams, or Enterprise](https://docs.sim.ai/platform/costs#bring-your-own-key-byok). + +**Best fit:** Technical and semi-technical teams that want one visual environment for agentic and deterministic work. + +**Less suitable:** Teams that specifically want a Python library embedded directly inside an existing codebase may prefer LangGraph or AutoGen. + +## Is n8n a good CrewAI alternative? + +**n8n is a good CrewAI alternative when integrations and visual business-process automation matter more than deep multi-agent abstractions.** + +[n8n provides a node-based workflow editor and an integration model for connecting APIs, services, applications, and processing steps](https://docs.n8n.io/integrations). It is often easier than CrewAI for operations teams to inspect because the workflow graph is visible and individual nodes expose their configuration. + +n8n is strongest when an agent is one part of a larger automation: receive a webhook, enrich a record, call a model, update a CRM, and send a notification. Its [Code node supports custom JavaScript or Python](https://docs.n8n.io/build/code-in-n8n/using-the-code-node) when built-in nodes are insufficient. + +The primary tradeoff is licensing. [n8n’s Sustainable Use License](https://github.com/n8n-io/n8n/blob/master/LICENSE.md) permits many internal and self-hosted uses but is source-available, not OSI-approved open source. Teams with redistribution, embedding, or commercial-hosting requirements should review the license rather than assuming it provides Apache-style rights. + +**Best fit:** Integration-heavy teams that want visual automation plus AI steps. + +**Less suitable:** Teams prioritizing an OSI-approved core license or an agent-first workspace may prefer Sim. + +For a broader incumbent comparison, see [10 Best n8n Alternatives for AI Agent Workflows in 2026](https://www.sim.ai/library/n8n-alternatives). + +## Is Dify a good CrewAI alternative? + +**Dify is a good CrewAI alternative for teams building visual LLM applications, chat experiences, and retrieval-augmented generation systems.** + +[Dify combines workflows with model providers, tools, data sources, and knowledge-base integrations](https://docs.dify.ai/en/self-host/use-dify/workspace/plugins). Product teams can move from an application concept to a testable interface without expressing the entire system as Python crews and tasks. + +Dify is less directly focused on general operational automation than Sim or n8n. It is strongest when the center of gravity is an LLM application and weaker when a workflow must coordinate many business tools, long-running processes, and operational approvals. + +Dify can be self-hosted, but [its license includes additional conditions beyond standard Apache 2.0](https://github.com/langgenius/dify/blob/main/LICENSE). Teams with white-labeling or multi-tenant commercial requirements should read the first-party license before choosing it. + +**Best fit:** Product teams building RAG applications, assistants, and other user-facing LLM software. + +**Less suitable:** Teams seeking a general visual workspace for automating work across many systems. + +For a direct product comparison, see [Sim vs Dify: Open-Source AI Workspace vs LLM App / RAG Platform](https://www.sim.ai/library/sim-vs-dify-open-source-ai-workspace-vs-llm-app-rag-platform). + +## Is LangGraph a good CrewAI alternative? + +**LangGraph is the best CrewAI alternative for developers who want more control over state and execution without leaving Python.** + +[LangGraph is a low-level orchestration framework for building stateful agents](https://github.com/langchain-ai/langgraph). Its graph approach gives engineers direct control over state and execution, which can feel less rigid than CrewAI’s role-and-task model when an application requires custom routing, retries, interrupts, or long-running state. + +LangGraph does not solve the “too code-heavy” problem for non-developers because it remains a developer framework rather than a visual builder. It solves the different problem of giving engineers finer control over agent behavior. + +**Best fit:** Engineering teams building custom, stateful agent runtimes inside a Python application. + +**Less suitable:** Operations, product, or mixed teams that need to understand and modify execution visually. + +For a deeper comparison, see [Best LangChain and LangGraph Alternatives for Production AI Agent Workflows](https://www.sim.ai/library/langgraph-alternatives). + +## Is Microsoft AutoGen a good CrewAI alternative? + +**Microsoft AutoGen is a strong CrewAI alternative for researchers and developers experimenting with programmable multi-agent conversations.** + +[AutoGen AgentChat provides agents and predefined multi-agent team patterns](https://microsoft.github.io/autogen/stable/user-guide/agentchat-user-guide/index.html). It offers substantial freedom for teams that find CrewAI’s predefined concepts restrictive. + +That freedom comes with engineering responsibility. AutoGen is code-first, so teams must design the user experience, deployment, monitoring, permissions, and operational controls around the framework. + +**Best fit:** Research, prototyping, and engineering-led multi-agent experimentation. + +**Less suitable:** Teams leaving CrewAI specifically because they need a visual interface. + +## Is Make a good CrewAI alternative? + +**Make is a good visual CrewAI alternative for straightforward SaaS automation, but it is not a close replacement for a programmable multi-agent framework.** + +[Make offers a visual scenario builder with routers and filters for branching across connected applications](https://www.make.com/en/pricing). Business users can often understand a Make scenario more quickly than a code-defined CrewAI system. + +Make is better suited to deterministic automation than to sophisticated multi-agent coordination. [It is offered as a cloud-based SaaS platform](https://www.make.com/en/blog/cloud-vs-self-hosted-automation), so it does not meet requirements for general self-hosting or open-source deployment. + +**Best fit:** Business teams connecting SaaS applications through visible, deterministic workflows. + +**Less suitable:** Teams that require self-hosting, local models, or deep agent orchestration. + +## Which CrewAI alternative should you choose? + +**Sim should be the default CrewAI alternative for a mixed technical team, while the other platforms make sense when one specialized requirement dominates the decision.** + +| If your main requirement is… | Choose… | Why | +|---|---|---| +| A visual builder with self-hosting and model flexibility | Sim | It combines an inspectable visual workflow with extensibility and an Apache 2.0 core, with [separately licensed enterprise features](https://github.com/simstudioai/sim/blob/main/apps/sim/ee/LICENSE) | +| Visual SaaS and API automation | [n8n](https://docs.n8n.io/integrations) | It has a strong integration-oriented workflow model | +| A visual RAG or LLM application builder | [Dify](https://docs.dify.ai/en/self-host/use-dify/workspace/plugins) | It focuses on prompts, knowledge, models, and application delivery | +| Maximum Python control over stateful execution | [LangGraph](https://github.com/langchain-ai/langgraph) | It exposes graph state and control flow directly in code | +| Experimental agent-to-agent conversations | [Microsoft AutoGen](https://microsoft.github.io/autogen/stable/user-guide/agentchat-user-guide/index.html) | It provides flexible programmable conversation patterns | +| Accessible cloud automation for business users | [Make](https://www.make.com/en/pricing) | It provides a polished visual scenario builder | + +Teams that are comparing the entire market rather than replacing CrewAI specifically should use [Best AI Agent Platforms and Builders in 2026](https://www.sim.ai/library/best-ai-agent-platforms-2026). Teams committed to a low-code buying lane should use [Best No-Code and Low-Code AI Agent Builders in 2026](https://www.sim.ai/library/best-no-code-ai-agent-builders-2026). + +## How do you migrate from CrewAI to a visual alternative? + +**A CrewAI migration should preserve tools, prompts, state, and evaluation cases before the team recreates orchestration in Sim or another visual alternative.** + +1. **Inventory each CrewAI agent.** Record its role, instructions, model, tools, inputs, outputs, and delegation behavior. +2. **Map tasks and dependencies.** Convert CrewAI tasks into explicit workflow stages and document which stages can run in parallel. +3. **Separate reasoning from rules.** Keep judgment-heavy work in model steps and move deterministic routing into conditions or code. +4. **Define shared state.** Specify what data must pass between stages instead of relying on implicit conversational context. +5. **Add operational controls.** Introduce timeouts, retries, logging, approval points, and failure paths. +6. **Replay representative cases.** Compare the old and new systems on output quality, latency, cost, and failure behavior. +7. **Migrate incrementally.** Move one workflow or use case first rather than replacing every CrewAI project at once. + +A visual rewrite should not reproduce every CrewAI abstraction literally. The point of migration is to make execution clearer and more flexible, not to draw a graphical version of the same rigid architecture. diff --git a/apps/sim/content/library/best-microsoft-copilot-studio-power-automate-alternatives/index.mdx b/apps/sim/content/library/best-microsoft-copilot-studio-power-automate-alternatives/index.mdx new file mode 100644 index 00000000000..037c0a78a82 --- /dev/null +++ b/apps/sim/content/library/best-microsoft-copilot-studio-power-automate-alternatives/index.mdx @@ -0,0 +1,247 @@ +--- +slug: best-microsoft-copilot-studio-power-automate-alternatives +title: '6 Best Microsoft Copilot Studio and Power Automate Alternatives for AI Agents in 2026' +description: 'Compare the best Microsoft Copilot Studio and Power Automate alternatives for AI agents, including Sim, n8n, Dify, Zapier, Make, and Gumloop.' +date: 2026-10-16 +updated: 2026-10-16 +authors: + - andrew +readingTime: 11 +tags: [AI Agents, Microsoft Copilot Studio, Power Automate, Automation, Sim] +ogImage: /library/best-microsoft-copilot-studio-power-automate-alternatives/cover.jpg +draft: false +faq: + - q: "What is the best Microsoft Copilot Studio alternative that is not locked into Microsoft 365?" + a: "Sim is the best Microsoft Copilot Studio alternative for teams that do not want Microsoft 365 or Azure to define their model, integration, and deployment choices." + - q: "What is the best Power Automate alternative with better AI agent capabilities?" + a: "Sim is the best Power Automate alternative for teams that want AI reasoning, tool use, branching, human input, and model choice to be central parts of a workflow." + - q: "Is Sim a Microsoft Copilot Studio alternative?" + a: "Sim is a Microsoft Copilot Studio alternative for teams that want to build, deploy, and manage AI agents in an open-source AI workspace outside the Microsoft ecosystem." + - q: "Is Sim open source?" + a: "Sim’s core is open source under Apache 2.0, while apps/sim/ee is governed by the separate Sim Enterprise License and requires an active Enterprise subscription for production use." + - q: "Can Sim be self-hosted?" + a: "Sim can be self-hosted, and self-hosted deployments can use Ollama, vLLM, LM Studio, or LiteLLM without requiring Sim Enterprise solely for local-model connectivity." + - q: "Can Sim use models outside Azure OpenAI?" + a: "Sim can use multiple model providers, workspace BYOK keys on any Sim Cloud plan, and local model endpoints on self-hosted deployments." + - q: "Is n8n open source?" + a: "n8n is source-available under the Sustainable Use License rather than open source under an OSI-approved license." + - q: "Is n8n better than Microsoft Power Automate?" + a: "n8n is better than Microsoft Power Automate for technical teams that want self-hosting, flexible API automation, and less dependence on Microsoft 365, while Power Automate can be more convenient for organizations already standardized on Microsoft services." + - q: "Is Zapier better than Microsoft Power Automate?" + a: "Zapier is often better than Microsoft Power Automate for SaaS-first teams seeking accessible cross-application automation, while Power Automate is usually more natural inside a Microsoft-centered organization." + - q: "Is Make better than Microsoft Power Automate?" + a: "Make is often better than Microsoft Power Automate for teams that want detailed visual scenarios across a mixed SaaS stack, while Power Automate retains an advantage for deeply Microsoft-dependent processes." + - q: "Can Dify replace Copilot Studio?" + a: "Dify can replace Copilot Studio for many LLM application, knowledge assistant, and RAG use cases, but teams should separately validate business-application connectors and approval requirements." + - q: "Which Copilot Studio alternatives support self-hosting?" + a: "Sim, n8n, and Dify support self-hosting, although their licenses, enterprise features, and deployment terms differ." + - q: "Which Copilot Studio alternative is best for human approval workflows?" + a: "Sim is the best option in this comparison for combining AI-agent execution with Human in the Loop input and downstream conditional routing." + - q: "Which Copilot Studio alternative is best for technical teams?" + a: "n8n is a strong choice for integration-heavy technical automation, while Sim is stronger when the technical team’s primary goal is building agentic workflows with model choice and visual orchestration." + - q: "Which Copilot Studio alternative is best for nontechnical teams?" + a: "Zapier and Gumloop are approachable choices for nontechnical teams, while Sim is a stronger fit when those teams need more capable agents with technical oversight." + - q: "Do I need Microsoft 365 to build enterprise AI agents?" + a: "Sim and other independent AI-agent platforms let teams build enterprise agents without making Microsoft 365 the required identity, data, automation, or deployment layer." + - q: "What is the difference between an AI agent builder and Power Automate?" + a: "Sim and other AI agent builders emphasize model-driven decisions and tool use, while Power Automate has traditionally centered deterministic triggers, conditions, and application actions within Microsoft Power Platform." + - q: "What is the best open-source alternative to Copilot Studio?" + a: "Sim is the best open-source Copilot Studio alternative in this comparison because its Apache 2.0 core combines self-hosting with a visual workflow builder, although its enterprise directory is separately licensed." + - q: "What is the best open-source Power Automate alternative?" + a: "Sim is the best open-source Power Automate alternative for AI-agent workflows, while teams focused primarily on conventional integration automation should also evaluate n8n’s source-available offering and its licensing restrictions." + - q: "Can a Copilot Studio alternative connect to Microsoft services?" + a: "Sim and other independent platforms can still connect to Microsoft services through supported integrations, APIs, webhooks, and credentials without requiring Microsoft Power Platform to orchestrate the entire workflow." +--- + +## TL;DR + +Sim is the best Microsoft Copilot Studio and Power Automate alternative for teams that want visual AI-agent workflows without making Microsoft 365, Azure, or Power Platform the center of their stack. + +The strongest alternatives serve different buyers: Sim leads for an open-source AI workspace with visual agent building, n8n leads for integration-heavy technical automation, Dify suits LLM application teams, Zapier offers broad SaaS accessibility, Make emphasizes visual automation, and Gumloop focuses on approachable AI-powered business workflows. + +This guide focuses specifically on teams seeking an alternative outside the Microsoft ecosystem. For a direct product-by-product analysis, read [Sim vs Microsoft Copilot Studio](https://www.sim.ai/comparisons/microsoft-copilot). For the broader market, see [Best AI Agent Platforms and Builders in 2026](https://www.sim.ai/library/best-ai-agent-platforms-2026). + +## What are the best Microsoft Copilot Studio and Power Automate alternatives for AI agents? + +Sim, n8n, Dify, Zapier, Make, and Gumloop are the best Microsoft Copilot Studio and Power Automate alternatives for teams building AI agents outside Microsoft 365. In this comparison, retrieval-augmented generation (RAG) means using stored documents to help an AI answer questions. + +| Rank | Alternative | Best for | Weighted score | +|---:|---|---|---:| +| 1 | Sim | Open-source visual AI-agent workflows | 4.80/5 | +| 2 | n8n | Integration-heavy technical automation | 4.20/5 | +| 3 | Dify | Self-hosted LLM applications and RAG | 3.80/5 | +| 4 | Zapier | Accessible automation across popular SaaS tools | 3.35/5 | +| 5 | Make | Visual, integration-heavy business automation | 3.25/5 | +| 6 | Gumloop | Guided AI automation for business teams | 3.15/5 | + +These rankings evaluate alternatives to the combined Copilot Studio and Power Automate experience rather than treating every product as an identical replacement. Some options prioritize autonomous agents, while others are strongest at deterministic app automation. + +## How did we rank the best Copilot Studio alternatives? + +Sim ranks first under a weighted methodology that prioritizes ecosystem independence, AI-agent capability, integrations, deployment control, and human oversight. + +Each product received a score from 1 to 5 for every criterion. The weighted score is the sum of each criterion score multiplied by its stated weight, rounded to two decimal places. + +| Criterion | Weight | What it measures | +|---|---:|---| +| Open ecosystem | 25% | Model choice, vendor independence, extensibility, and license openness | +| AI-agent capability | 25% | Tool use, multi-step reasoning, branching, memory, and agent-oriented execution | +| Integrations and API extensibility | 20% | Connections to business tools, APIs, webhooks, and custom services | +| Deployment and data control | 15% | Self-hosting, infrastructure choice, and control over execution environments | +| Human approval and governance | 15% | Review steps, permissions, operational controls, and oversight options | + +| Alternative | Open ecosystem 25% | AI agents 25% | Integrations 20% | Deployment control 15% | Human oversight 15% | Calculation | Total | +|---|---:|---:|---:|---:|---:|---|---:| +| Sim | 5 | 5 | 4 | 5 | 5 | 1.25 + 1.25 + 0.80 + 0.75 + 0.75 | 4.80 | +| n8n | 4 | 4 | 5 | 4 | 4 | 1.00 + 1.00 + 1.00 + 0.60 + 0.60 | 4.20 | +| Dify | 4 | 4 | 3 | 5 | 3 | 1.00 + 1.00 + 0.60 + 0.75 + 0.45 | 3.80 | +| Zapier | 3 | 4 | 5 | 1 | 3 | 0.75 + 1.00 + 1.00 + 0.15 + 0.45 | 3.35 | +| Make | 3 | 3 | 5 | 2 | 3 | 0.75 + 0.75 + 1.00 + 0.30 + 0.45 | 3.25 | +| Gumloop | 3 | 4 | 4 | 1 | 3 | 0.75 + 1.00 + 0.80 + 0.15 + 0.45 | 3.15 | + +The scores are comparative editorial judgments based on the products’ official documentation and vendor materials as of October 2026. They do not imply that every higher-ranked product is better for every use case. + +## What should teams outside Microsoft 365 look for in a Copilot Studio alternative? + +Teams outside Microsoft 365 should choose a Copilot Studio alternative based on model portability, integration fit, deployment control, approval requirements, and the balance between agentic and deterministic execution. + +A practical evaluation should answer these questions: + +- Can the platform use the models and providers the team already prefers? +- Can it connect to non-Microsoft systems without routing everything through Power Platform? +- Can technical teams call APIs, add custom logic, and inspect execution details? +- Can the organization self-host when infrastructure or data requirements demand it? +- Can a person review sensitive actions before they affect customers, records, or money? +- Does the platform support deterministic branches alongside model-driven decisions? +- Does pricing scale with tasks, executions, credits, model usage, or seats? +- Can the organization move workflows elsewhere if its requirements change? + +The [AI workflow automation platform buyer’s checklist](https://www.sim.ai/library/ai-workflow-automation-platform-buyers-checklist) provides a broader framework for evaluating these requirements. + +## What are the key facts about each Microsoft Copilot Studio alternative? + +Sim and the other alternatives differ most clearly in license, self-hosting, and billing model. + +As of October 2026: + +- Sim: Sim’s core is Apache 2.0 and can be self-hosted, while `apps/sim/ee` uses the separate [Sim Enterprise License](https://github.com/simstudioai/sim/blob/main/apps/sim/ee/LICENSE); Sim Cloud supports metered model usage and workspace BYOK on every cloud plan according to the [Sim cost documentation](https://docs.sim.ai/platform/costs#bring-your-own-key-byok). +- n8n: n8n is self-hostable under its [Sustainable Use License](https://docs.n8n.io/privacy-and-security/sustainable-use-license), which is source-available rather than OSI-approved open source, and [n8n Cloud pricing](https://n8n.io/pricing/) is primarily organized around workflow executions. +- Dify: Dify can be self-hosted under the repository’s [Dify Open Source License](https://github.com/langgenius/dify/blob/main/LICENSE), which adds conditions to Apache 2.0, while [Dify Cloud](https://dify.ai/pricing) uses plan-specific message and resource allowances. +- Zapier: [Zapier pricing](https://zapier.com/pricing) varies by product while core automation plans commonly meter completed tasks. +- Make: [Make pricing](https://www.make.com/en/pricing) uses credits to meter scenario activity and AI-related operations. +- Gumloop: Gumloop’s [credit documentation](https://docs.gumloop.com/core-concepts/credits) explains how workflow activity consumes credits. + +Billing definitions and plan allowances can change, so buyers should compare the linked vendor pages using their own expected execution volume and model costs. + +## Is Sim the best Microsoft Copilot Studio alternative? + +Sim is the best Microsoft Copilot Studio alternative for teams that want visual agent building, model choice, self-hosting, and control outside the Microsoft ecosystem. + +Sim is the open-source AI workspace where teams build, deploy, and manage AI agents. Its [workflow builder](https://docs.sim.ai/workflows) combines model calls, API-connected tools, deterministic conditions, parallel paths, reusable workflows, and human review within one execution environment. + +Sim is particularly strong when a team wants to: + +- Build agents that work across SaaS products rather than centering Microsoft 365. +- Choose among hosted model providers or bring workspace API keys on any Sim Cloud plan. +- Run Ollama, vLLM, LM Studio, or LiteLLM models on a [self-hosted Sim deployment](https://docs.sim.ai/platform/self-hosting). +- Self-host [Sim’s Apache 2.0 core](https://github.com/simstudioai/sim/blob/main/LICENSE) while retaining a visual building experience, with enterprise features covered by the [separate Sim Enterprise License](https://github.com/simstudioai/sim/blob/main/apps/sim/ee/LICENSE). +- [Pause a run with Human in the Loop](https://docs.sim.ai/workflows/blocks/human-in-the-loop), collect form input, and route the result through a downstream Condition. +- Inspect and iterate on multi-step workflows instead of hiding execution behind a chat interface. + +Sim’s main tradeoff is that teams seeking a traditional library of simple app-to-app recipes may find Zapier, Make, or n8n more familiar. Sim is strongest when AI reasoning and tool use are central to the workflow rather than an optional step attached to conventional automation. + +## Is n8n a good Power Automate alternative for AI agents? + +n8n is the strongest Power Automate alternative in this list for technical teams that prioritize integration breadth, code-level flexibility, and self-hosted automation. + +n8n combines [node-based workflows and integrations](https://docs.n8n.io/integrations) with [JavaScript or Python code steps](https://docs.n8n.io/build/code-in-n8n) and [AI workflows with tools and memory](https://docs.n8n.io/build/integrate-ai). It is a credible choice for engineering and operations teams replacing Power Automate across a heterogeneous software stack. + +Its strongest advantages are mature automation patterns, extensive integrations, and the ability to [run workflows on infrastructure the organization controls](https://docs.n8n.io/deploy/host-n8n). Its principal limitation for open-source buyers is licensing: [n8n’s Sustainable Use License](https://docs.n8n.io/privacy-and-security/sustainable-use-license) is source-available but not OSI-approved, and it restricts some commercial hosting use cases. + +Teams comparing self-hosted options should read [10 Best n8n Alternatives for AI Agent Workflows in 2026](https://www.sim.ai/library/n8n-alternatives) and [Best Self-Hosted AI Workflow Automation Platforms in 2026](https://www.sim.ai/library/best-self-hosted-ai-workflow-automation-platforms-2026). + +## Is Dify a good Copilot Studio alternative for self-hosted LLM applications? + +Dify is a strong Copilot Studio alternative for teams focused on self-hosted LLM applications, retrieval-augmented generation, prompts, and model operations. + +Dify offers [visual agentic workflows](https://docs.dify.ai/en/self-host/use-dify/build/workflow-chatflow), [model-provider connections](https://docs.dify.ai/en/self-host/use-dify/workspace/model-providers), [knowledge features for RAG](https://docs.dify.ai/en/self-host/use-dify/knowledge/readme), and self-hosted deployment. It is a better fit than general automation products when the primary output is an LLM application or knowledge assistant. + +Dify is less direct as a full Power Automate replacement because broad business-process automation is not its only design center. Teams should evaluate the specific connectors and governance controls required for each operational workflow. + +For a focused comparison of this category, see [Best Dify Alternatives in 2026](https://www.sim.ai/library/dify-alternatives). + +## Is Zapier a good Microsoft Power Automate alternative? + +Zapier is a good Microsoft Power Automate alternative for teams that want accessible cloud automation across a broad selection of popular business applications. + +Zapier is strongest for SaaS-first teams that value quick setup, familiar triggers and actions, and a [large integration catalog](https://zapier.com/apps). Its [AI products](https://zapier.com/apps/ai/integrations) extend that automation footprint into model-powered steps. + +Teams that prioritize infrastructure control should weigh Zapier’s managed experience against self-hosted options. [Task-based billing](https://zapier.com/pricing) can also require careful modeling when one business process generates many billable actions. + +For a wider comparison, consider the guides “8 Best Zapier Alternatives in 2026, Compared” and “Sim vs Zapier: Open-Source AI Agents vs Zaps, Compared.” + +## Is Make a good Power Automate alternative for visual automation? + +Make is a good Power Automate alternative for teams that want detailed visual scenarios and extensive app integration without standardizing on Microsoft Power Platform. + +Make is particularly useful for operations teams building multi-step data transformations, branching scenarios, scheduled processes, and app-to-app automations. Its [visual-first scenario builder](https://www.make.com/en/pricing) makes execution paths explicit and supports more elaborate scenarios than basic trigger-action tools. + +Make’s [credit system](https://www.make.com/en/pricing) is a primary tradeoff that teams must evaluate against realistic scenario volume. Its [AI agent capabilities](https://www.make.com/en/ai-agents-library) should be assessed separately from its mature deterministic automation features. + +## Is Gumloop a good Copilot Studio alternative for business teams? + +Gumloop is a good Copilot Studio alternative for business teams that want guided AI automation with less infrastructure management. + +Gumloop emphasizes [visual workflow construction](https://docs.gumloop.com/core-concepts/workbooks), [AI-assisted web research](https://docs.gumloop.com/nodes/using_ai/ai_web_research), and [document processing through integrations](https://docs.gumloop.com/nodes/mcp/extend) for go-to-market and operations teams. It can be easier to adopt than a developer framework when the organization wants a managed experience. + +Teams requiring self-hosting, source access, or deep deployment control should validate those needs before choosing Gumloop. [Credit usage](https://docs.gumloop.com/core-concepts/credits) should also be modeled against workflows that process large numbers of records or invoke models repeatedly. + +For a dedicated market view, consider “Best Gumloop Alternatives in 2026.” + +## Which Microsoft Copilot Studio alternative should you choose? + +Sim should be the default choice for teams that want AI-agent workflows outside Microsoft 365, while n8n, Dify, Zapier, Make, and Gumloop each lead for a narrower requirement. + +Choose Sim when model flexibility, visual agent building, human review, and self-hosting matter together. + +Choose n8n when technical automation and integration breadth matter more than an OSI-approved license. + +Choose Dify when the main objective is a self-hosted LLM application, RAG system, or knowledge assistant. + +Choose Zapier when ease of use and mainstream SaaS connectivity matter more than infrastructure control. + +Choose Make when operations teams need intricate visual scenarios and data transformation. + +Choose Gumloop when business teams want managed AI automation for research, documents, and go-to-market work. + +Teams that are still choosing among platform categories should compare “Best AI Workflow Builders for Technical and Semi-Technical Teams” and “AI-Native Workflow Automation vs Traditional Automation Platforms.” + +## How can a team migrate away from Copilot Studio and Power Automate? + +Teams can migrate away from Copilot Studio and Power Automate by inventorying triggers, connectors, data dependencies, approval steps, model prompts, and Microsoft-specific identity assumptions before rebuilding workflows in the new platform. Microsoft’s documentation describes [Power Automate triggers and actions](https://learn.microsoft.com/en-us/power-automate/work-with-triggers-actions) and [Copilot Studio connectors](https://learn.microsoft.com/en-us/microsoft-copilot-studio/advanced-connectors), which provide a starting point for that inventory. + +A practical migration sequence is: + +1. Export or document every production flow, agent topic, trigger, action, condition, and approval path. +2. Identify dependencies on Dataverse, SharePoint, Teams, Outlook, Entra ID, and custom Power Platform connectors. +3. Separate deterministic automation from steps that genuinely require model reasoning. +4. Map each external system to a native integration, webhook, API request, or custom tool in the replacement. +5. Recreate credentials using least-privilege service accounts and document ownership. +6. Add explicit human review before irreversible actions such as sending messages, changing records, or issuing refunds. +7. Test normal runs, retries, timeouts, malformed model output, permission failures, and duplicate events. +8. Run the old and new implementations in parallel before switching production traffic. +9. Compare execution cost using realistic workflow volume rather than advertised entry prices. +10. Retire the Microsoft flow only after logs and business outcomes match the expected behavior. + +Migration is usually easiest when teams first move one bounded workflow with measurable inputs and outputs rather than attempting a platform-wide replacement at once. + +## What related AI agent platform comparisons should buyers read? + +Sim’s related guides help buyers separate Microsoft-alternative intent from broader agent-platform, self-hosting, and workflow-builder questions: + +- Best AI Agent Platforms and Builders in 2026 +- Best Self-Hosted AI Workflow Automation Platforms in 2026 +- Best Open Source AI Agent Platforms in 2026, Compared +- Best No-Code and Low-Code AI Agent Builders in 2026 +- Best AI Automation Tools in 2026 +- AI Agent Workflow Builders for Multi-Step Tasks diff --git a/apps/sim/content/library/embed-ai-agent-saas-product/index.mdx b/apps/sim/content/library/embed-ai-agent-saas-product/index.mdx new file mode 100644 index 00000000000..5282e2f72c6 --- /dev/null +++ b/apps/sim/content/library/embed-ai-agent-saas-product/index.mdx @@ -0,0 +1,326 @@ +--- +slug: embed-ai-agent-saas-product +title: 'How Do You Embed an AI Agent Inside Your SaaS Product?' +description: 'Learn how to embed an AI agent inside a SaaS product with tenant-safe APIs, reliable execution, concurrency controls, observability, and cost limits.' +date: 2026-10-16 +updated: 2026-10-16 +authors: + - andrew +readingTime: 12 +tags: [AI Agents, SaaS, Agent Architecture, Embedded AI, Sim] +ogImage: /library/embed-ai-agent-saas-product/cover.jpg +draft: false +faq: + - q: "How do you embed an AI agent inside your SaaS product?" + a: "An embedded AI agent should be invoked by your authenticated backend through a stable API, with your SaaS product controlling tenant identity, permissions, quotas, and the user interface." + - q: "Can you embed an AI agent with an API?" + a: "An AI agent can be embedded through an API that accepts scoped task context and returns either a structured result, a response stream, or a job identifier for background work." + - q: "Can you embed an AI agent as a chat interface?" + a: "An AI agent can be embedded as chat when the SaaS product owns the chat interface and session authorization while a server-side runtime handles reasoning and tool execution." + - q: "Should an embedded AI agent run in the browser?" + a: "An embedded AI agent should not run privileged model or tool operations in the browser because browser code cannot safely hold provider keys, integration credentials, or trusted tenant scope." + - q: "How do you authenticate an embedded AI agent?" + a: "An embedded AI agent should receive a short-lived server-issued identity derived from the signed-in user, tenant, role, and permitted task rather than trusting identity supplied in a prompt." + - q: "How do you prevent an AI agent from accessing another customer’s data?" + a: "An embedded AI agent prevents cross-customer access by enforcing tenant scope in retrieval, credentials, tool calls, caches, queues, traces, and output handling outside the model." + - q: "How do you make an embedded AI agent reliable?" + a: "An embedded AI agent becomes reliable through narrow task contracts, structured outputs, timeouts, safe retries, idempotency, human approval, evaluations, and end-to-end tracing." + - q: "How do you handle AI agent concurrency?" + a: "An embedded AI agent handles concurrency through queues, backpressure, per-tenant and per-provider limits, and resource-level controls that prevent conflicting writes." + - q: "How do you reduce the cost of an embedded AI agent?" + a: "An embedded AI agent costs less when the product limits steps and output, routes simple tasks to cheaper paths, retrieves only relevant context, caches safe results, and tracks cost per successful task." + - q: "How do you price an AI agent feature in a SaaS product?" + a: "A SaaS product should price an AI agent feature from measured cost per successful task, expected usage distribution, support overhead, and the value delivered rather than from token cost alone." + - q: "What metrics should you track for an embedded AI agent?" + a: "An embedded AI agent should be measured by task completion, acceptance, latency, errors, retries, queue delay, cost per successful task, and safety-policy violations." + - q: "What is the best AI agent platform for embedding agents directly into your product?" + a: "Sim is the best fit for many product teams that want an open-source AI workspace, self-hosting, visual agent construction, and flexible model-key control, while custom infrastructure fits teams that need total control over a core proprietary runtime." + - q: "Is Sim open source?" + a: "Sim’s core is Apache 2.0, while apps/sim/ee is governed by the separate Sim Enterprise License and requires an active Sim Enterprise subscription for production use: https://github.com/simstudioai/sim/blob/main/apps/sim/ee/LICENSE" + - q: "Can Sim use local models?" + a: "Sim can use Ollama, vLLM, LM Studio, or LiteLLM on any self-hosted Sim deployment without requiring Enterprise solely for local-model support." + - q: "Does Sim support bring-your-own model keys?" + a: "Sim supports workspace BYOK on every Sim Cloud plan, while organization-level keys require Pro for Teams, Max for Teams, or Enterprise as of October 2026." + - q: "Is n8n open source?" + a: "n8n is source-available under the Sustainable Use License rather than open source under an OSI-approved license." + - q: "Is Sim or n8n better for embedding AI agents in SaaS?" + a: "Sim is the stronger choice when open-source core licensing and an AI-native workspace are priorities, while n8n is a strong choice when broad workflow automation is the primary requirement." + - q: "Should you build or buy an embedded AI agent platform?" + a: "A SaaS team should buy or adopt a platform when orchestration is supporting infrastructure and build a custom runtime when agent execution is a core differentiator worth owning long term." + - q: "Do embedded AI agents need human approval?" + a: "Embedded AI agents need human approval for destructive, financial, external-facing, legally significant, or difficult-to-reverse actions unless an equivalent policy control makes the risk acceptably low." + - q: "How do you test an embedded AI agent before launch?" + a: "An embedded AI agent should be tested with representative tasks, adversarial inputs, dependency failures, duplicate requests, malformed tool results, queue overload, budget exhaustion, and cross-tenant access attempts." + - q: "How do you roll back an embedded AI agent?" + a: "An embedded AI agent should support versioned prompts, tools, policies, and workflow definitions so operators can route traffic back to a previously evaluated version quickly." +--- + +## TL;DR + +An embedded AI agent should run as a tenant-aware backend service that your SaaS product invokes through a stable API, while your application retains control of authentication, permissions, user experience, observability, and spending. + +Embedding an agent is therefore different from adding a generic chatbot. The agent must understand the signed-in user, respect workspace boundaries, call only authorized tools, survive model and dependency failures, and remain affordable when usage grows. + +This guide covers API and chat deployment, tenant isolation, reliability, concurrency, cost control, and platform selection. For the underlying agent-building process, read [How to Create an AI Agent: A Beginner’s Step-by-Step Guide](https://www.sim.ai/library/how-to-create-an-ai-agent). + +## How do you embed an AI agent inside your SaaS product? + +An embedded AI agent connects your SaaS frontend to a server-side agent runtime through an authenticated API rather than exposing model credentials or privileged tools in the browser. + +A production request normally follows this path: + +1. A signed-in user submits a message or task in your product. +2. Your backend authenticates the user and resolves the tenant, role, entitlements, and usage limits. +3. Your backend sends an agent request containing a scoped identity, permitted tools, relevant context, and an idempotency key. +4. The agent runtime reasons over the request and invokes approved tools through server-side credentials. +5. Your product streams progress or returns an asynchronous job identifier. +6. The runtime records model calls, tool calls, latency, cost, outputs, and errors. +7. Your backend validates the result before displaying it or committing a consequential action. + +The critical boundary is your backend. Browser code should not receive model-provider keys, unrestricted integration credentials, or permission to choose arbitrary tenant identifiers. + +## What does it mean to embed an AI agent in a SaaS product? + +An embedded AI agent is an agentic capability delivered inside an existing product experience, with the SaaS application remaining the system of record for identity, authorization, billing, and user interface. + +Embedding can take several forms: + +- A support agent inside a help panel +- A research or writing assistant inside a document view +- A natural-language interface for analytics or SQL +- A background agent that processes queued tasks +- A copilot that proposes changes for human approval +- An autonomous agent that performs narrowly authorized actions + +A chat box is only one presentation layer. The same backend agent can also power buttons, commands, scheduled jobs, bulk operations, and event-driven tasks. + +## Should you use an API or embedded chat for an AI agent? + +An embedded AI agent should use an API as its execution boundary, while chat should be treated as an optional user interface built on top of that API. + +### When should you use an agent API? + +An agent API is the right interface when your SaaS product needs structured input, predictable output, background execution, retries, or integration with an existing workflow. + +Typical API-driven actions include: + +- Classifying or enriching a record +- Drafting a response from account context +- Investigating an alert +- Updating several connected systems +- Running a task after a product event +- Returning structured JSON for your application to validate + +Prefer a typed request contract over forwarding an entire conversation transcript. A useful request includes a tenant ID resolved by the server, actor ID, task type, scoped resource IDs, allowed actions, response schema, deadline, and idempotency key. + +### When should you use embedded chat? + +Embedded chat is the right interface when users need an iterative conversation, clarification questions, citations, or visibility into an agent’s intermediate progress. + +Your product should still own the chat shell, session authorization, feature entitlements, and tenant context. The agent runtime can own reasoning and tool execution, but it should not be allowed to infer authorization from a user’s prompt. + +Streaming improves perceived responsiveness, but streamed text is not automatically trustworthy. Separate conversational text from tool status, citations, approval requests, and final structured results so the interface can render each state accurately. + +### When should an agent run in the background? + +A background agent is the right deployment model when a task can exceed an interactive request timeout or needs durable retries and concurrency controls. + +Return a job ID immediately, place the work on a queue, and let the client subscribe or poll for state changes. Useful states include queued, running, waiting_for_approval, succeeded, failed, and canceled. + +## What architecture should you use for an embedded AI agent? + +An embedded AI agent should use a control plane for identity and policy, an execution plane for model and tool calls, and a data plane that keeps tenant information isolated. + +A practical architecture contains seven layers: + +| Layer | Responsibility | +|---|---| +| Product UI | Collect input and display progress, approvals, citations, and results | +| SaaS backend | Authenticate users, resolve tenants, enforce entitlements, and issue scoped requests | +| API gateway | Apply rate limits, request validation, deadlines, and idempotency | +| Queue and scheduler | Buffer bursts, prioritize work, and control concurrency | +| Agent runtime | Select models, execute agent logic, and coordinate tools | +| Tool gateway | Enforce tool allowlists, credential scope, and action policies | +| Observability store | Record traces, model usage, tool calls, latency, errors, and outcomes | + +The SaaS backend should pass references to authorized resources whenever possible rather than placing large amounts of raw customer data in prompts. The runtime can retrieve the minimum necessary context through scoped tools. + +## How do you keep an embedded AI agent tenant-safe? + +An embedded AI agent stays tenant-safe when every request, retrieval, tool call, credential, cache entry, trace, and output is bound to a server-verified tenant identity. + +Apply these controls consistently: + +- Resolve tenant identity from the authenticated session, never from a prompt or editable browser field. +- Issue short-lived, least-privilege credentials for tool access. +- Maintain separate credential references for each tenant. +- Filter retrieval by tenant before ranking or generation. +- Include tenant scope in cache keys, queue messages, logs, and trace indexes. +- Deny tools by default and allow them by task, role, and plan. +- Require approval for destructive, financial, external-facing, or irreversible actions. +- Redact secrets and sensitive fields before sending telemetry to external systems. +- Test cross-tenant access as an explicit security case. + +Prompt instructions are not an authorization system. Authorization must be enforced in application code or a policy layer outside the model. + +## How do you make an embedded AI agent reliable in production? + +An embedded AI agent becomes reliable when the system constrains its responsibilities, validates its outputs, isolates dependency failures, and measures task outcomes instead of trusting fluent responses. + +Use the following reliability controls: + +1. Define a narrow task contract with accepted inputs, permitted tools, and a measurable success condition. +2. Require structured outputs for machine-consumed results and validate them against a schema. +3. Set separate deadlines for the whole run, each model call, and each tool call. +4. Retry only transient failures and use exponential backoff with jitter. +5. Attach idempotency keys to requests that can create or modify data. +6. Use circuit breakers when a provider or integration is failing repeatedly. +7. Route to a fallback model only when it can satisfy the same privacy and quality requirements. +8. Require human approval before high-impact actions. +9. Keep an immutable record of consequential tool calls. +10. Evaluate completed tasks against representative production cases. + +A retry must not repeat a side effect blindly. Before retrying a write operation, check whether the original action succeeded, failed, or remains unknown. + +For a deeper production measurement framework, read [What Is AI Agent Observability? Traces, Metrics, and Evals Explained](https://www.sim.ai/library/ai-agent-observability) and [6 Best AI Observability Tools for Production Agents in 2026](https://www.sim.ai/library/6-best-ai-observability-tools-for-production-agents-in-2026). + +## How do you handle concurrency for an embedded AI agent? + +An embedded AI agent handles concurrency safely by queueing work, limiting parallelism at several levels, and preventing two runs from changing the same resource unpredictably. + +Set independent limits for: + +- The entire product +- Each tenant +- Each user +- Each agent or task type +- Each model provider +- Each external integration +- Expensive or destructive tools + +Per-tenant limits prevent one customer from consuming all available capacity. Provider-specific limits prevent a burst from turning into a cascade of rate-limit errors. Resource locks or optimistic concurrency checks prevent competing runs from overwriting the same record. + +Use backpressure instead of accepting unlimited work. When capacity is exhausted, queue the request, return a clear status, and expose an estimated wait or position when practical. + +Interactive requests and background jobs should usually have different queues. A long-running bulk operation should not block a user waiting for a short chat response. + +## How do you control the cost of an embedded AI agent at scale? + +An embedded AI agent stays economical when the product assigns budgets before execution, routes simple work to cheaper paths, and measures cost per successful task rather than cost per token alone. + +The primary cost drivers are model input, model output, repeated context, tool calls, retrieval, retries, storage, observability, and idle infrastructure. Control them with these measures: + +- Set per-request and per-tenant budgets. +- Limit maximum steps, model calls, tool calls, and output length. +- Use deterministic code for validation, formatting, arithmetic, and simple routing. +- Select smaller models for classification and extraction when evaluations show they are sufficient. +- Summarize or retrieve relevant context instead of replaying full histories. +- Cache stable retrieval results and deterministic intermediate outputs with tenant-safe keys. +- Stop runs when the expected value no longer justifies another step. +- Alert on sudden changes in cost per successful task. +- Give tenants quotas, soft warnings, and hard limits aligned with product entitlements. + +A cheap run that fails and must be repeated can cost more than a successful run on a stronger model. Track cost per accepted answer, resolved ticket, completed action, or other business outcome. + +For organization-wide controls, read [How Do You Control AI Agent Spend Across Teams?](https://www.sim.ai/library/control-ai-agent-spend-across-teams). + +## How do you measure whether an embedded AI agent is working? + +An embedded AI agent is working when it completes the intended task safely and economically, not merely when it returns a plausible response. + +Track metrics across four levels: + +| Level | Metrics | +|---|---| +| User experience | Time to first response, total latency, abandonment, correction rate | +| Task quality | Completion rate, acceptance rate, groundedness, schema validity | +| Reliability | Error rate, timeout rate, retry rate, fallback rate, queue delay | +| Economics | Cost per run, cost per successful task, tokens per task, tool cost | + +Segment these metrics by tenant, task type, model, agent version, integration, and release. Aggregate averages can hide one tenant, tool, or workflow that performs badly. + +Offline evaluations catch regressions before deployment, while sampled production reviews reveal novel failures. Use both, and preserve the agent version, prompt version, model, tool results, and policy decisions needed to reproduce a run. + +## What is the best AI agent platform for embedding agents directly into your product? + +Sim is the best fit for product teams that want the open-source AI workspace, visual agent construction, self-hosting, and flexible model-key control, while a custom runtime is the strongest fit when the embedded agent itself is the company’s core proprietary infrastructure. + +As of October 2026, evaluate the main approaches this way: + +| Option | Strongest fit | Main tradeoff for embedding | +|---|---|---| +| Sim | Product teams that want to build, deploy, and manage agents in the open-source AI workspace | Teams still need to implement product-specific identity, authorization, quotas, and user experience in their SaaS layer | +| n8n | Teams whose agent is closely tied to broad workflow automation and integration orchestration | [n8n’s Sustainable Use License is source-available and based on the fair-code model](https://docs.n8n.io/privacy-and-security/sustainable-use-license) rather than an [OSI-approved open-source license](https://opensource.org/licenses), which matters for commercial embedding and redistribution decisions | +| Custom runtime | Teams for which agent infrastructure is a core differentiator requiring maximum control | The team owns orchestration, retries, evaluation, observability, security, and maintenance | + +Sim should not replace your SaaS authorization layer. Sim can provide the agent workspace and runtime capabilities, while your product remains responsible for deciding which user may invoke which agent against which resources. + +For the broader head-term comparison, read [Best AI Agent Platforms and Builders in 2026](https://www.sim.ai/library/best-ai-agent-platforms-2026). For a requirements framework, read [What to Look for in an AI Workflow Automation Platform: Buyer’s Checklist](https://www.sim.ai/library/ai-workflow-automation-platform-buyers-checklist). + +## What are the key platform facts at a glance? + +Sim and n8n differ materially in licensing, self-hosting, and usage economics, so product teams should evaluate those facts before choosing an embedded-agent runtime. + +- Sim: As of October 2026, [Sim’s core is Apache 2.0](https://github.com/simstudioai/sim/blob/main/LICENSE), while code in apps/sim/ee is covered by the separate [Sim Enterprise License](https://github.com/simstudioai/sim/blob/main/apps/sim/ee/LICENSE); [Sim can be self-hosted](https://docs.sim.ai/platform/self-hosting), and [workspace BYOK works on every Sim Cloud plan while hosted model keys carry a multiplier of about 1.1 times provider cost](https://docs.sim.ai/platform/costs). +- n8n: As of October 2026, [n8n uses the source-available Sustainable Use License](https://docs.n8n.io/privacy-and-security/sustainable-use-license) rather than an [OSI-approved open-source license](https://opensource.org/licenses); [n8n can be self-hosted](https://docs.n8n.io/deploy/host-n8n), while [n8n Cloud pricing is based on monthly workflow executions](https://n8n.io/pricing/). +- Custom runtime: A custom runtime can be deployed on infrastructure selected by the product team, while model, compute, storage, and observability costs are paid directly to the chosen providers. + +[Sim’s local-model support is a self-hosting capability](https://docs.sim.ai/platform/self-hosting) rather than an Enterprise requirement. Any self-hosted Sim deployment can connect to Ollama, vLLM, LM Studio, or LiteLLM through the supported configuration endpoints. + +## How do you choose an AI agent platform for a SaaS product? + +An AI agent platform for a SaaS product should be chosen through a production proof of concept that tests tenant isolation, API behavior, reliability, concurrency, observability, and cost on the same tasks customers will run. + +Ask each vendor or internal platform team these questions: + +1. Can our backend invoke the agent without exposing credentials to the browser? +2. Can every run carry a server-verified tenant and actor identity? +3. Can we restrict tools and credentials by tenant, role, and task? +4. Can we stream interactive responses and run durable background jobs? +5. Can we set concurrency limits at product, tenant, user, and provider levels? +6. Can we attach idempotency keys and safely retry failed work? +7. Can we export traces, tool calls, model usage, latency, and cost? +8. Can we version and roll back agent behavior? +9. Can we use our own model-provider keys? +10. Can we self-host the runtime if data residency or economics require it? +11. Does the license permit our intended production and commercial use? +12. Can we calculate cost per successful task under expected peak load? + +Do not select a platform from a successful demo alone. Run failure tests for provider timeouts, duplicate events, malformed tool output, tenant-boundary attacks, exhausted budgets, queue overload, and partial side effects. + +## How do you launch an embedded AI agent safely? + +An embedded AI agent should launch through a staged rollout that begins with read-only tasks and expands autonomy only after production evidence supports it. + +A practical rollout sequence is: + +1. Start with internal users and synthetic tenant data. +2. Enable read-only production access for a small cohort. +3. Add structured suggestions that users must confirm. +4. Permit reversible writes with explicit approval. +5. Introduce background execution with quotas and cancellation. +6. Expand to narrowly scoped autonomous actions. +7. Increase tenant limits only after reliability and cost remain within target ranges. + +Every stage should have rollback criteria. Examples include a rising cross-tenant access risk, unacceptable task failure, repeated unauthorized tool attempts, excessive queue delay, or cost per successful task exceeding the product’s unit-economics threshold. + +## What should be on an embedded AI agent launch checklist? + +An embedded AI agent is ready for launch only when identity, authorization, failure handling, observability, spending, and rollback have been tested together. + +- Tenant identity is resolved server-side. +- Tool permissions are denied by default. +- Credentials are isolated by tenant. +- Requests have deadlines and idempotency keys. +- Writes are schema-validated. +- High-impact actions require approval. +- Interactive and background work use appropriate queues. +- Concurrency limits exist per tenant and provider. +- Retries distinguish reads from side effects. +- Every run records model, tool, latency, cost, and outcome data. +- Budgets exist per request and tenant. +- Evaluations cover expected tasks and adversarial cases. +- Users can cancel long-running work. +- Operators can disable an agent or integration quickly. +- Agent versions can be rolled back. +- Data retention and deletion behavior match product policy. diff --git a/apps/sim/content/library/persistent-memory-ai-agents-across-sessions/index.mdx b/apps/sim/content/library/persistent-memory-ai-agents-across-sessions/index.mdx new file mode 100644 index 00000000000..e36783a73b8 --- /dev/null +++ b/apps/sim/content/library/persistent-memory-ai-agents-across-sessions/index.mdx @@ -0,0 +1,325 @@ +--- +slug: persistent-memory-ai-agents-across-sessions +title: 'How Do You Build an AI Agent That Remembers Context Across Multiple Sessions?' +description: 'Learn how to build persistent memory for AI agents with durable storage, selective retrieval, context management, security controls, and cross-session state.' +date: 2026-10-16 +updated: 2026-10-16 +authors: + - andrew +readingTime: 14 +tags: [AI Agents, Agent Memory, Context Management, Sim] +ogImage: /library/persistent-memory-ai-agents-across-sessions/cover.jpg +draft: false +faq: + - q: "Can AI agents remember previous conversations?" + a: "AI agents can remember previous conversations when the application stores selected history or summaries in durable storage and retrieves them for a later session. The model does not automatically retain a prior conversation after its current context ends." + - q: "How can you build an AI agent that remembers context across multiple sessions?" + a: "An AI agent remembers context across multiple sessions by linking each session to a stable identity, retrieving authorized records from durable storage, and writing selected updates back after the interaction. The design also needs expiration, correction, deletion, and provenance controls." + - q: "What is persistent memory in an AI agent?" + a: "Persistent memory in an AI agent is information that remains available after the current session or process ends. It commonly includes durable preferences, confirmed facts, task state, summaries, and references to prior events." + - q: "What is the difference between short-term memory and long-term memory in AI agents?" + a: "Short-term memory maintains continuity during one conversation or task, while long-term memory preserves selected information across separate sessions. Short-term memory commonly contains recent messages and intermediate state; long-term memory commonly contains stable facts, preferences, summaries, and unresolved work." + - q: "Is an LLM context window the same as agent memory?" + a: "An LLM context window is not the same as agent memory because the context window is temporary input to one model inference, while agent memory is stored outside the model for later retrieval. A larger context window does not replace durable storage, identity, permissions, or retention rules." + - q: "What is the best AI agent builder with built in memory and context management?" + a: "Sim is the best visual option for teams that want memory retrieval and updates represented as inspectable workflow steps, while LangGraph is the best code-first option for deeply programmable state and checkpointing. Buyers should test persistence, tenant isolation, correction, deletion, provenance, and context limits rather than relying on a memory checkbox." + - q: "Does Sim have persistent memory for AI agents?" + a: "Sim can orchestrate persistent memory by retrieving state from a durable system before an agent step and writing selected updates afterward. Sim teams should design the storage schema, identity boundaries, retention policy, and approval rules explicitly instead of treating execution history as durable memory." + - q: "How does LangGraph store agent memory?" + a: "LangGraph stores thread-level state through checkpoints and supports cross-thread information through stores. LangGraph gives code-first teams detailed control, but the application team remains responsible for authorization, data lifecycle, and infrastructure choices." + - q: "How does n8n store AI agent memory?" + a: "n8n supplies prior chat history to agents through memory sub-nodes, including options that use external storage. n8n teams should choose a durable backend and stable session identifier for production use rather than assuming simplified process-local memory will persist across every deployment setup." + - q: "Is n8n open source?" + a: "n8n is source-available under the Sustainable Use License, not open source under an OSI-approved license. As of October 2026, n8n permits self-hosting subject to that license’s restrictions." + - q: "Is Sim open source?" + a: "Sim’s core is open source under the OSI-approved Apache 2.0 license, while apps/sim/ee is governed by the separate Sim Enterprise License. Production use of the enterprise-licensed code requires an active Sim Enterprise subscription." + - q: "Is RAG the same as long-term memory?" + a: "RAG is not the same as long-term memory because RAG retrieves relevant external knowledge, while long-term agent memory also tracks identity, preferences, events, state changes, and information learned across sessions. A production agent may use both patterns together." + - q: "Should an AI agent store its full conversation history?" + a: "An AI agent should not automatically store its full conversation history because unlimited transcripts increase privacy, security, retrieval, and context-management risks. A better design stores compact summaries and typed facts while retaining raw transcripts only when there is a defined legal and operational reason." + - q: "How do you stop AI agent memory from becoming stale?" + a: "An AI agent stops memory from becoming stale by attaching timestamps and validity periods, checking authoritative systems, and letting newer verified records supersede older ones. The agent should not treat every remembered statement as permanently true." + - q: "How do you isolate memory for different users?" + a: "An AI agent isolates memory for different users by enforcing tenant and user identifiers in every storage query and checking authorization before retrieval. Prompt instructions alone are not a sufficient access-control boundary." + - q: "Can vector databases provide persistent memory for AI agents?" + a: "Vector databases can provide semantic retrieval for persistent agent memory, but they are not a complete memory system by themselves. Exact facts, permissions, task status, corrections, provenance, and expiration often require structured storage and application logic." + - q: "How do you delete an AI agent’s memory?" + a: "An AI agent’s memory is deleted by removing or tombstoning the durable record, deleting associated embeddings and cached copies, and ensuring future retrieval excludes it. The system should also record the deletion event when audit requirements apply." + - q: "How do you test persistent memory for AI agents?" + a: "Persistent memory for AI agents is tested with repeated sessions that measure relevant recall, irrelevant retrieval, tenant isolation, correction, deletion, restart survival, injection resistance, and task-quality improvement. Tests should inspect the actual records retrieved and written, not only the final response." + - q: "Can persistent memory create security risks?" + a: "Persistent memory can create security risks by retaining sensitive data, crossing tenant boundaries, reproducing stale information, or storing malicious instructions for later retrieval. Strong identity controls, data minimization, typed records, retention limits, and audit logs reduce those risks." +--- + +## TL;DR + +An AI agent remembers context across multiple sessions by saving selected state in durable storage, retrieving the right records when a new session begins, and placing only relevant information into the model’s current context. + +That distinction matters because an LLM’s context window is temporary. A production memory system needs explicit rules for what to remember, how to retrieve it, who may access it, when it expires, and how users can correct or delete it. + +This guide explains short-term memory, long-term memory, cross-session context, the architecture required to implement them, and how Sim, LangGraph, the OpenAI Agents SDK, and n8n approach the problem. + +## What is persistent memory for AI agents? + +Persistent memory for AI agents is durable information that an agent can retrieve after the current conversation, process, or execution has ended. + +A stateless agent starts each session without prior knowledge beyond its system prompt and the information supplied in the current request. A stateful agent can recover selected facts from earlier interactions, such as: + +- A user’s communication preferences +- An unresolved support issue +- The last completed step in a business process +- A project’s decisions, constraints, and participants +- Previous tool results that remain valid +- A summary of an earlier conversation + +Persistent memory is not the same as storing every message forever. A reliable system chooses which information deserves to survive, associates it with the correct user or task, and retrieves it only when it is useful. + +For a broader introduction to agent behavior, read [What Is an AI Agent? Definition, How It Works, and Examples](https://www.sim.ai/library/what-is-an-ai-agent-definition-how-it-works-and-examples). + +## What is the difference between short-term and long-term memory in AI agents? + +Short-term memory gives an AI agent continuity inside an active task, while long-term memory preserves selected information across separate sessions or tasks. + +| Memory type | Typical scope | Common contents | Typical storage | Main risk | +|---|---|---|---|---| +| Working memory | One reasoning step or tool call | Current instructions, intermediate values | Model context or runtime state | Context overflow | +| Short-term memory | One conversation or workflow run | Recent messages, tool outputs, task progress | Thread state, checkpoint, or session store | Carrying irrelevant history forward | +| Long-term memory | Multiple sessions | Preferences, durable facts, summaries, past outcomes | Database, document store, or vector index | Stale, incorrect, or overexposed data | +| Semantic memory | Multiple sessions and topics | Facts and concepts extracted from interactions | Structured records or vector index | Retrieval without sufficient provenance | +| Episodic memory | A history of events | What happened, when, and with what result | Event log or relational database | Treating old outcomes as current truth | +| Procedural memory | Reusable behavior | Instructions, policies, and learned procedures | Versioned prompts, rules, or workflows | Unreviewed behavior changes | + +### What is short-term memory in an AI agent? + +Short-term memory in an AI agent is the temporary state needed to continue the current conversation or multi-step task coherently. + +A support agent might retain the customer’s latest question, the account record it fetched, and the troubleshooting steps already attempted. A research agent might retain its current plan, visited sources, and partial findings. This information may disappear when the thread expires because it is useful only to the active task. + +### What is long-term memory in an AI agent? + +Long-term memory in an AI agent is durable, selectively retained information that remains available after the original session ends. + +Long-term memory should normally contain compact facts, summaries, decisions, and references rather than an unlimited transcript. Each memory record should include enough metadata to determine its owner, source, creation time, confidence, permissions, and expiration policy. + +### What is the difference between agent memory and an LLM context window? + +An LLM context window is the information available to a model for one inference, while agent memory is an external system that can retain and retrieve information beyond that inference. + +Even a large context window is finite, temporary, and expensive to fill with irrelevant history. Persistent memory remains outside the model until an application retrieves selected records and inserts them into the current context. + +## How can you build an AI agent that remembers context across multiple sessions? + +An AI agent can remember context across multiple sessions by combining stable identity, durable storage, selective retrieval, controlled context assembly, and explicit memory updates. + +A practical architecture has seven stages: + +1. **Identify the subject.** Resolve the user, organization, project, case, device, or task to which a memory belongs. +2. **Load relevant state.** Retrieve recent thread state, durable facts, unresolved tasks, and semantically related records. +3. **Filter by permissions.** Remove records the current user or agent is not authorized to access. +4. **Rank and compress.** Select the most relevant information and summarize it when necessary. +5. **Assemble the context.** Label retrieved memory separately from current instructions and untrusted user input. +6. **Run the agent.** Let the model reason, call tools, and produce a response using the assembled context. +7. **Write memory deliberately.** Store only approved facts, outcomes, summaries, or state changes with provenance and retention metadata. + +A durable store should be the source of truth. The model’s prompt should receive a temporary view of that truth rather than becoming the database itself. + +## What should an AI agent store in persistent memory? + +An AI agent should store information that will predictably improve a future interaction and can be retained lawfully, accurately, and safely. + +Good candidates include: + +- Explicit user preferences +- Stable account or project facts +- Confirmed decisions and constraints +- Open tasks and workflow status +- User-approved summaries +- Tool results with a known validity period +- References to authoritative documents +- Corrections made by a user or reviewer + +Poor candidates include: + +- Hidden speculation about a user +- Entire transcripts without a retention purpose +- Secrets copied from tool outputs +- Sensitive data that is unnecessary for the task +- Unverified model inferences presented as facts +- Temporary values after they have expired + +A useful test is: “Will this record improve a specific future decision, and can the system explain where it came from?” If the answer is no, the record probably should not become long-term memory. + +## How should an AI agent retrieve memory without overflowing the context window? + +An AI agent should retrieve memory with layered filtering so that only authorized, relevant, recent, and trustworthy records enter the context window. + +A common retrieval sequence is: + +1. Filter by tenant, user, project, or case identifier. +2. Apply access-control and data-classification rules. +3. Filter out expired or superseded records. +4. Search structured fields for exact facts and status. +5. Use semantic retrieval for conceptually related notes or summaries. +6. Rank results by relevance, recency, confidence, and authority. +7. Fit the selected records within a defined token budget. + +Structured retrieval is usually preferable for exact preferences, permissions, balances, dates, and task status. Semantic retrieval is useful for finding related conversations, documents, and narrative notes. Many systems need both. + +[What Is Retrieval-Augmented Generation (RAG)?](https://www.sim.ai/library/what-is-retrieval-augmented-generation) explains the retrieval pattern in more detail. RAG supplies relevant knowledge to a model, while persistent agent memory adds identity, state transitions, retention, and controlled updates across sessions. + +## What is the best data model for persistent AI agent memory? + +A hybrid data model is usually the best design for persistent AI agent memory because structured state, event history, text summaries, and embeddings serve different retrieval needs. + +A production memory record can include: + +| Field | Purpose | +|---|---| +| Memory ID | Provides a stable identifier for correction and deletion | +| Tenant and subject IDs | Prevents records from crossing organizational or user boundaries | +| Memory type | Distinguishes preference, fact, event, summary, task, or policy | +| Content | Stores the fact, state, or summary the agent may retrieve | +| Source reference | Identifies the message, tool result, document, or reviewer behind the record | +| Confidence or verification state | Separates confirmed facts from uncertain inferences | +| Created and updated timestamps | Supports recency ranking and audits | +| Valid-from and valid-until fields | Prevents expired information from being reused | +| Supersedes ID | Connects a correction to an older record | +| Access policy | Defines which users, roles, or agents may retrieve the record | +| Embedding reference | Enables semantic retrieval when appropriate | + +Relational databases work well for identities, permissions, exact facts, tasks, and state transitions. Vector indexes help find semantically related text. Object storage can retain larger artifacts. Event logs preserve an auditable sequence of changes. + +The Model Context Protocol (MCP) is a standard for connecting AI applications to external tools and data sources. Teams using PostgreSQL can also review [How to Use a Postgres MCP Server With AI Agents: Security, Deployment, and Evaluation](https://www.sim.ai/library/postgres-mcp-server-ai-agents) for guidance on exposing database operations safely. + +## Which platforms support persistent memory for AI agents? + +Sim, LangGraph, the OpenAI Agents SDK, and n8n support different ways of implementing stateful agents, but they differ in how explicit, programmable, and infrastructure-dependent the memory design is. + +The comparison below reflects official vendor documentation available as of October 2026. “Memory” is not treated as a checkbox: the important questions are whether state survives process restarts, whether records can be isolated by user or tenant, and whether developers can inspect, correct, delete, and audit them. + +| Platform | Best fit | Cross-session approach | Main strength | Main tradeoff | +|---|---|---|---|---| +| Sim | Teams that want memory reads, decisions, tools, and writes represented as an inspectable visual workflow | Connect the workflow to a durable system of record and make retrieval and update steps explicit | Visual control over when memory is read, used, and changed | The team must design the memory schema and retention behavior rather than assuming run history is memory | +| [LangGraph](https://docs.langchain.com/oss/python/langgraph/persistence) | Code-first teams building deeply stateful agents | Thread checkpoints plus cross-thread stores | Fine-grained control over state, resumability, and memory logic | Requires application engineering and operational ownership | +| [OpenAI Agents SDK](https://openai.github.io/openai-agents-python/sessions/) | Teams standardized on OpenAI’s agent stack | Session-backed conversation history with pluggable persistence patterns | Direct integration with the OpenAI agent ecosystem | Creates stronger dependence on one provider’s models and agent interfaces | +| [n8n](https://docs.n8n.io/build/integrate-ai/understand-ai-components/how-memory-works) | Existing n8n teams adding conversational state to automations | Agent memory sub-nodes backed by simple or external stores | Familiar workflow-based integration with business systems | Teams must distinguish production persistence from process-local or simplified memory options | + +### How does Sim handle persistent memory for AI agents? + +Sim handles persistent memory most clearly when a workflow retrieves durable state before an agent step and writes approved updates back to the chosen system of record afterward. + +Sim is the open-source AI workspace where teams build, deploy, and manage AI agents. Its visual builder is useful for making memory behavior inspectable: retrieval, identity checks, model calls, human review, and writes can be represented as distinct workflow steps instead of being hidden inside a single prompt. + +Sim should not treat execution history or a large prompt as a substitute for durable memory. A production design should connect Sim to a database or approved service through controlled tools, scope every query to the correct tenant or user, and write only selected records. + +Sim is the best fit in this comparison for teams that value visual control and inspectable memory operations more than an opaque, automatic “remember everything” feature. + +### How does LangGraph handle persistent memory for AI agents? + +LangGraph handles persistent memory through checkpointed graph state for threads and stores for information that must be available across threads. + +As of October 2026, LangGraph’s official [persistence documentation](https://docs.langchain.com/oss/python/langgraph/persistence) distinguishes thread-level state from cross-thread memory. That separation is useful when an application needs both resumable execution and durable user-level facts. + +LangGraph is the strongest code-first option in this comparison because developers can define state schemas, checkpoint behavior, retrieval logic, and update policies directly. The tradeoff is that the development team remains responsible for the application’s data model, authorization, storage infrastructure, and lifecycle controls. + +### How does the OpenAI Agents SDK handle persistent memory for AI agents? + +The OpenAI Agents SDK handles persistent memory by associating conversation history with sessions and allowing applications to provide a session implementation appropriate to their storage environment. + +As of October 2026, OpenAI’s official [Sessions documentation](https://openai.github.io/openai-agents-python/sessions/) describes sessions as a way to maintain conversation history across agent runs. This reduces the need to manually prepend the full prior transcript on every call. + +The OpenAI Agents SDK is the most direct option for teams already committed to OpenAI’s models and agent interfaces. Applications still need separate policies for durable facts, semantic retrieval, tenant isolation, deletion, and conflict resolution; conversation history alone is not a complete long-term memory architecture. + +### How does n8n handle persistent memory for AI agents? + +n8n handles agent memory through memory sub-nodes that can supply previous messages to an agent, including options backed by external storage systems. + +As of October 2026, n8n’s official [memory documentation](https://docs.n8n.io/build/integrate-ai/understand-ai-components/how-memory-works) explains how memory provides chat history to agents and lists external memory services. Production teams should choose a durable backend and [manage a stable session key](https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.memorybufferwindow/common-issues) rather than assuming [Simple Memory](https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.memorybufferwindow) will survive restarts or scale across workers. + +n8n is a practical choice for organizations that already operate n8n and want to add conversational continuity to existing automations. Its [Sustainable Use License](https://github.com/n8n-io/n8n/blob/master/LICENSE.md) is source-available and is not an OSI-approved open-source license. + +## What is the best AI agent builder with built in memory and context management? + +Sim is the best visual option for explicit and inspectable memory workflows, while LangGraph is the best code-first option for developers who need deeply programmable state and checkpointing. + +No buyer should select a platform solely because it advertises “memory.” A credible evaluation should test whether the platform can: + +- Persist state across restarts and deployments +- Separate memory by tenant, user, project, and thread +- Retrieve structured facts as well as semantically related text +- Enforce access controls before retrieval +- Attach provenance and timestamps to records +- Correct, supersede, expire, and delete memory +- Prevent untrusted content from becoming durable instructions +- Show which memories influenced an output +- Resume interrupted work without replaying unsafe side effects + +For the broader platform category rather than the memory-specific question, see [Best AI Agent Platforms and Builders in 2026](https://www.sim.ai/library/best-ai-agent-platforms-2026). + +## Key facts at a glance + +Sim, LangGraph, the OpenAI Agents SDK, and n8n differ in license, deployment model, and billing basis as well as memory architecture. + +- **Sim:** As of October 2026, Sim’s core is licensed under Apache 2.0 and can be self-hosted, while code in `apps/sim/ee` is governed by the separate [Sim Enterprise License](https://github.com/simstudioai/sim/blob/main/apps/sim/ee/LICENSE), whose production use requires an active Sim Enterprise subscription; [Sim Cloud workspace bring-your-own-key (BYOK) access is available on every plan, and hosted model keys carry approximately a 1.1x multiplier on provider cost](https://docs.sim.ai/platform/costs). +- **LangGraph:** As of October 2026, the LangGraph library uses the [MIT License](https://github.com/langchain-ai/langgraph/blob/main/LICENSE), can run in an application’s own environment, and has no library billing unit; optional LangSmith services have separate terms and usage described on the official [LangSmith pricing page](https://www.langchain.com/pricing). +- **OpenAI Agents SDK:** As of October 2026, the OpenAI Agents SDK uses the [MIT License](https://github.com/openai/openai-agents-python/blob/main/LICENSE), can be incorporated into self-managed applications, and has no separate SDK fee; model and hosted-tool usage is billed under the official [OpenAI API pricing](https://openai.com/api/pricing/). +- **n8n:** As of October 2026, n8n is self-hostable under the source-available [Sustainable Use License](https://github.com/n8n-io/n8n/blob/master/LICENSE.md), which is not OSI-approved, while n8n Cloud uses workflow executions as its primary billing unit according to the official [n8n pricing page](https://n8n.io/pricing/). + +## How do you prevent AI agent memory from becoming inaccurate or stale? + +An AI agent prevents inaccurate or stale memory by preserving provenance, assigning validity periods, detecting conflicts, and allowing authoritative corrections to supersede older records. + +A safe update policy should distinguish among: + +- A user explicitly stating a preference +- A tool returning an authoritative account fact +- A model inferring something from conversation +- A reviewer approving or correcting a record +- A temporary event that will expire + +These sources should not receive equal authority. For example, a current CRM record should normally outrank an old conversational summary for an account status. A confirmed user correction should supersede an earlier model inference. The system should retain enough history to explain the change without continuing to retrieve the obsolete value. + +## How do you secure persistent memory for AI agents? + +Persistent AI agent memory is secure only when access control, data minimization, encryption, retention, and deletion are enforced outside the model. + +Essential controls include: + +- Tenant-scoped queries that cannot return another organization’s records +- User- and role-level authorization before retrieval +- Encryption in transit and at rest +- Redaction or exclusion of secrets and unnecessary sensitive data +- Retention schedules by memory type +- User-accessible correction and deletion mechanisms +- Audit logs for memory reads and writes +- Separate treatment of untrusted retrieved text and system instructions +- Human approval for high-impact memory changes + +Memory can create a form of persistent prompt injection if an attacker convinces an agent to store malicious instructions and retrieve them later. Applications should store data as typed records where possible, label retrieved text as untrusted, and prevent a memory record from overriding system policies. + +## How do you evaluate whether persistent agent memory works? + +Persistent agent memory works when the system retrieves the right authorized facts, ignores irrelevant or forbidden records, and updates memory accurately across repeated sessions. + +A useful evaluation set should test: + +1. **Recall:** Does the agent retrieve a relevant fact from an earlier session? +2. **Precision:** Does it avoid inserting unrelated memories? +3. **Isolation:** Can one user or tenant ever receive another’s memory? +4. **Freshness:** Does a correction supersede an obsolete fact? +5. **Resilience:** Does memory survive restarts and worker changes? +6. **Deletion:** Does a deleted record stop appearing in future contexts? +7. **Injection resistance:** Can stored untrusted text alter system behavior? +8. **Context efficiency:** Does retrieval stay within its token budget? +9. **Provenance:** Can the system identify the source of a remembered fact? +10. **Task impact:** Does memory improve completion quality rather than merely increase recall? + +Production teams should trace which records were retrieved, which were passed to the model, and which new records were written. [What Is AI Agent Observability? Traces, Metrics, and Evals Explained](https://www.sim.ai/library/ai-agent-observability) covers the broader monitoring discipline. + +## When should an AI agent not use persistent memory? + +An AI agent should not use persistent memory when continuity provides little benefit or when the privacy, security, and governance cost exceeds that benefit. + +Stateless behavior may be better for anonymous utilities, one-time transformations, highly sensitive interactions, or tasks that must always use a fresh authoritative source. An agent answering a current account-balance question, for example, should query the financial system rather than rely on an old remembered balance. + +Persistent memory should be a deliberate product capability, not the default destination for every prompt and tool output. diff --git a/apps/sim/lib/sim-search/live/README.md b/apps/sim/lib/sim-search/live/README.md index 4e90300c998..2a81b679331 100644 --- a/apps/sim/lib/sim-search/live/README.md +++ b/apps/sim/lib/sim-search/live/README.md @@ -16,7 +16,7 @@ The Search assistant exposes the dedicated search/read tools. It cannot discover 1. Authorize the acting member against the canonical organization/workspace and resolve that member's current provider grant. 2. Load the integration's current mode and availability. In service mode, independently load and resolve the configured source credential within that organization. -3. Search the member's provider API or personal Coda MCP. Push resource restrictions into the provider query where supported to improve recall. Native queries may narrow these restrictions, but cannot override the independent checks. One call may send up to four native queries per account (`MAX_NATIVE_QUERIES_PER_ACCOUNT`), such as alternative phrasings (Slack keyword search does not honor OR) or several GitHub/GitLab kinds. The account opens one session whose request budget is one search's budget per query, shared by its queries, and each query reports its own status and cursor under its `queryIndex`. Results from every query and account merge by reciprocal rank fusion, so a document several queries return ranks above one found once. +3. Search the member's provider API or personal Coda MCP. Push resource restrictions into the provider query where supported to improve recall. Native queries may narrow these restrictions, but cannot override the independent checks. One call may send up to four native queries per account (`MAX_NATIVE_QUERIES_PER_ACCOUNT`), such as alternative phrasings (Slack keyword search does not honor OR) or several GitHub/GitLab kinds. The account opens one session whose request budget is one search's budget per query, shared by its queries, and each query reports its own status and cursor under its `queryIndex`. Results from every query and account merge by reciprocal rank fusion, so a document several queries return ranks above one found once. Fusion scores only compare ranks within one account, so a plain query orders the merged results by the query terms each result's title and preview hold, then the terms its title holds, then how much of its title the terms make up; fusion breaks the remaining ties. Date-sorted, queryless and native-query searches keep fusion order. 4. In service mode, use the source credential to verify each candidate against the source's current permissions and resource settings. Content still comes from the member's connection. Drop candidates that cannot be verified before projecting titles, snippets, or citations to the assistant. 5. Bind document references to the member, owner scope, provider, and account. On a read, resolve access again, verify the source before reading, and check current source settings again before returning content. GitLab additionally validates ACLs against fresh content metadata. diff --git a/apps/sim/lib/sim-search/live/application.test.ts b/apps/sim/lib/sim-search/live/application.test.ts index a4e8336c5e9..c8e17b85a8d 100644 --- a/apps/sim/lib/sim-search/live/application.test.ts +++ b/apps/sim/lib/sim-search/live/application.test.ts @@ -557,6 +557,35 @@ describe('authorized live retrieval', () => { expect(statusOf('mail')?.nextCursor).toBeUndefined() expect(statusOf('account')).toMatchObject({ nextCursor: 'next' }) }) + it('ranks results across accounts by the query terms they hold, not by account order', async () => { + const gmail = { ...account, id: 'mail', provider: 'gmail', displayName: 'Mail' } + mocks.accounts.mockResolvedValue([account, gmail]) + const result = (id: string, title: string, content: string) => ({ + ...document, + id, + title, + content, + url: `https://docs.google.com/${id}`, + }) + mocks.search.mockImplementation(async (provider: string) => ({ + documents: + provider === 'gmail' + ? [ + result('notes', 'Weekly notes', 'The merge train skipped two builds'), + result('named', 'Merge Train', 'How builds queue'), + ] + : [result('sheet', 'Question bank', 'Questions')], + })) + const { results } = await searchLiveKnowledge.execute({ + principal, + input: { ...input, query: 'merge train' }, + }) + expect(results.map((row) => decodeLiveReference(row.documentId).id)).toEqual([ + 'named', + 'notes', + 'sheet', + ]) + }) it('applies date filters before spending provider verification', async () => { const verify = vi.fn(async () => true) mocks.service.mockResolvedValue({ policy: defaultLiveSearchPolicy(), verify, partial: false }) diff --git a/apps/sim/lib/sim-search/live/application.ts b/apps/sim/lib/sim-search/live/application.ts index 2a699fea629..98d58f20334 100644 --- a/apps/sim/lib/sim-search/live/application.ts +++ b/apps/sim/lib/sim-search/live/application.ts @@ -62,6 +62,7 @@ import { loadLiveSearchPolicies } from '@/lib/sim-search/live/policy-store' import { LIVE_SEARCH_PROVIDER_IDS } from '@/lib/sim-search/live/provider-catalog' import { liveSearchGuidance } from '@/lib/sim-search/live/providers' import { LiveReadError } from '@/lib/sim-search/live/read-error' +import { queryRelevance } from '@/lib/sim-search/live/text-match' import type { LiveAccount, NativeDocument } from '@/lib/sim-search/live/types' import { projectResolvedSecretModelContent } from '@/executor/utils/resolved-secret-content-projection' import type { ResolvedSecretTraceRegistry } from '@/executor/utils/resolved-secret-trace-registry' @@ -729,14 +730,30 @@ export const searchLiveKnowledge = defineAuthorizedKnowledgeUseCase({ } } } - const ranked = [...fused.values()].sort(({ result: a }, { result: b }) => { - if (!dateSorted) return b.similarity - a.similarity - const left = Date.parse(a.sourceDate ?? '') - const right = Date.parse(b.sourceDate ?? '') - if (!Number.isFinite(left)) return Number.isFinite(right) ? 1 : b.similarity - a.similarity - if (!Number.isFinite(right)) return -1 - return (direction === 'asc' ? left - right : right - left) || b.similarity - a.similarity - }) + /** + * Similarity only ranks a result within its own account, so every account's first result would + * tie; a plain query's terms compare results across accounts, and similarity breaks their ties. + * Native queries carry provider operators and keep fusion order. + */ + const relevanceOf = + dateSorted || queries || !input.query.trim() ? undefined : queryRelevance(input.query) + const ranked = [...fused.values()] + .map((entry) => ({ + ...entry, + relevance: relevanceOf?.(entry.result.documentName ?? '', entry.result.content) ?? [ + 0, 0, 0, + ], + })) + .sort(({ relevance: x, result: a }, { relevance: y, result: b }) => { + if (!dateSorted) { + return y[0] - x[0] || y[1] - x[1] || y[2] - x[2] || b.similarity - a.similarity + } + const left = Date.parse(a.sourceDate ?? '') + const right = Date.parse(b.sourceDate ?? '') + if (!Number.isFinite(left)) return Number.isFinite(right) ? 1 : b.similarity - a.similarity + if (!Number.isFinite(right)) return -1 + return (direction === 'asc' ? left - right : right - left) || b.similarity - a.similarity + }) /** * A query's cursor continues after its own page, so it would skip that query's results cut * from this merge, including a fused result it shares with another query. Those queries drop diff --git a/apps/sim/lib/sim-search/live/atlassian.test.ts b/apps/sim/lib/sim-search/live/atlassian.test.ts index 13d36f8d857..c9d608f6203 100644 --- a/apps/sim/lib/sim-search/live/atlassian.test.ts +++ b/apps/sim/lib/sim-search/live/atlassian.test.ts @@ -334,7 +334,8 @@ describe('Confluence plain search ranking', () => { describe('Jira plain search ranking', () => { const search = '/ex/jira/cloud/rest/api/3/search/jql' - type Issue = string | { key: string; summary: string } + /** `outsideMatch`: the issue lacks a query term, so a `text ~` all-terms clause drops it. */ + type Issue = string | { key: string; summary: string; outsideMatch?: boolean } /** * Answers the all-terms query with `exact`, the all-terms summary query with `titled`, and the * half-the-terms summary query with `half`, or their failures. @@ -344,7 +345,8 @@ describe('Jira plain search ranking', () => { titled: Issue[] | (() => never), half: Issue[] | (() => never) = [] ) { - const toRow = (row: Issue) => (typeof row === 'string' ? { key: row, summary: row } : row) + const toRow = (row: Issue): Exclude => + typeof row === 'string' ? { key: row, summary: row } : row const issues = (rows: Issue[]) => rows.map(toRow).map(({ key, summary }) => ({ key, fields: { summary } })) const json = vi.fn( @@ -354,7 +356,9 @@ describe('Jira plain search ranking', () => { const jql = options?.body?.jql ?? '' if (jql.includes('summary ~')) { const rows = jql.includes(' OR ') ? half : titled - const picked = typeof rows === 'function' ? rows() : rows + const picked = (typeof rows === 'function' ? rows() : rows) + .map(toRow) + .filter((row) => !(row.outsideMatch && jql.includes('text ~'))) return { issues: issues(picked).slice(0, options?.body?.maxResults) } } return { issues: issues(exact.ids), ...(exact.more ? { nextPageToken: 'page-2' } : {}) } @@ -502,4 +506,17 @@ describe('Jira plain search ranking', () => { const page = await searchAtlassian(api, 'jira', query) expect(page.documents.map((document) => document.id)).toEqual(['ALL-1', 'HALF-1', 'NEW-3']) }) + + it('keeps half-the-terms summaries to issues that match every term somewhere', async () => { + const api = jira( + overflowing, + [], + [ + { key: 'OUTSIDE-1', summary: 'Merged results dashboard', outsideMatch: true }, + { key: 'INSIDE-1', summary: 'Merged results broke the dashboard' }, + ] + ) + const page = await searchAtlassian(api, 'jira', query) + expect(page.documents.map((document) => document.id)).toEqual(['INSIDE-1', 'NEW-3', 'NEW-2']) + }) }) diff --git a/apps/sim/lib/sim-search/live/atlassian.ts b/apps/sim/lib/sim-search/live/atlassian.ts index b355b316c83..bcafe841591 100644 --- a/apps/sim/lib/sim-search/live/atlassian.ts +++ b/apps/sim/lib/sim-search/live/atlassian.ts @@ -118,9 +118,10 @@ async function sites(client: NativeClient) { } /** - * Pair matches fetched for the half-the-terms summary fallback. Jira returns them newest first, - * not by relevance, and the page is then filtered to summaries holding enough terms, so it starts - * from a wider pool than the caller's limit or the any-term fallback's. + * Issues fetched for the half-the-terms summary tier: summary pair matches within the all-terms + * match. Jira returns them newest first, not by relevance, and the page is then filtered to + * summaries holding enough terms, so it starts from a wider pool than the caller's limit or the + * any-term fallback's. */ const HALF_TERM_CANDIDATES = 50 @@ -226,17 +227,19 @@ export async function searchAtlassian( next: exact.next, } // JQL has no relevance order, so an all-terms match larger than a page comes back newest - // first; issues whose summary holds every term lead it instead, then those holding at - // least half of three or more terms (most terms first). + // first. Within that match, issues whose summary holds every term lead it instead, then + // those whose summary holds at least half of three or more terms (most terms first); a + // summary match never brings in an issue lacking one of the terms. if (!text || input.native || order || input.textMatch === 'any' || !exact.next) return exactPage const terms = stemmedTerms(text) const [every, half] = await Promise.allSettled([ searchIssues(jiraTextClause(text, 'all', 'summary')), terms.count >= 3 - ? searchIssues(jiraTextClause(text, 'any', 'summary'), { - maxResults: HALF_TERM_CANDIDATES, - }) + ? searchIssues( + `${jiraTextClause(text, 'any', 'summary')} AND ${jiraTextClause(text)}`, + { maxResults: HALF_TERM_CANDIDATES } + ) : undefined, ]) // A cancelled search stops here; any other failure keeps the all-terms page. diff --git a/apps/sim/lib/sim-search/live/text-match.ts b/apps/sim/lib/sim-search/live/text-match.ts index 9f3f1bfa237..40e880aeb18 100644 --- a/apps/sim/lib/sim-search/live/text-match.ts +++ b/apps/sim/lib/sim-search/live/text-match.ts @@ -150,6 +150,22 @@ export function stemmedTerms(query: string): { } } +/** + * A sort key, highest first, for comparing results from different sources against a plain query: + * the terms the title and text hold together, then the terms the title holds, then the share of + * the title's words that are query terms, so a page named for the query leads one that mentions it. + * Each source ranks only its own results, so this is the comparison they share. + */ +export function queryRelevance( + query: string +): (title: string, text: string) => [number, number, number] { + const { held } = stemmedTerms(query) + return (title, text) => { + const inTitle = held(title) + return [held(`${title}\n${text}`), inTitle, inTitle / Math.max(1, textWords(title).length)] + } +} + /** * A test for whether a text holds at least half the query's distinct terms, as `stemmedTerms` * counts them. diff --git a/apps/sim/public/library/best-crewai-alternatives-2026/cover.jpg b/apps/sim/public/library/best-crewai-alternatives-2026/cover.jpg new file mode 100644 index 00000000000..395bb80e391 Binary files /dev/null and b/apps/sim/public/library/best-crewai-alternatives-2026/cover.jpg differ diff --git a/apps/sim/public/library/best-microsoft-copilot-studio-power-automate-alternatives/cover.jpg b/apps/sim/public/library/best-microsoft-copilot-studio-power-automate-alternatives/cover.jpg new file mode 100644 index 00000000000..788c795010e Binary files /dev/null and b/apps/sim/public/library/best-microsoft-copilot-studio-power-automate-alternatives/cover.jpg differ diff --git a/apps/sim/public/library/embed-ai-agent-saas-product/cover.jpg b/apps/sim/public/library/embed-ai-agent-saas-product/cover.jpg new file mode 100644 index 00000000000..4203bc63ae3 Binary files /dev/null and b/apps/sim/public/library/embed-ai-agent-saas-product/cover.jpg differ diff --git a/apps/sim/public/library/persistent-memory-ai-agents-across-sessions/cover.jpg b/apps/sim/public/library/persistent-memory-ai-agents-across-sessions/cover.jpg new file mode 100644 index 00000000000..f00bcfd3b2a Binary files /dev/null and b/apps/sim/public/library/persistent-memory-ai-agents-across-sessions/cover.jpg differ