Bring Your Own Agent

Available now — open source. Bring Your Own Agent (BYOA) lets you deploy custom AI agents built on any framework while leveraging Sharely.ai's knowledge management, conversation infrastructure, distribution, and role-based access control.

The heart of BYOA is the Sharely Server SDK — an open-source TypeScript SDK (Apache 2.0) for building Sharely-compatible agent servers:


What is Bring Your Own Agent?

Sharely.ai splits the platform into parts you run and parts Sharely manages:

  • Sharely manages knowledge (ingestion, taxonomies, RAG), governance (RBAC), and the control plane that routes requests, validates identity, and persists conversations.
  • You own the agent itself — its model, framework, tools, prompts, and infrastructure.

The Server SDK is the contract between the two. You host an agent server; the Sharely platform routes each user chat turn to your server and streams your agent's response back into the surface where the user is working (for example, Web Control embedded in your portal).

With BYOA you can:

  • Build agents using any framework, SDK, or platform — Anthropic SDK, OpenAI Agents SDK, Vercel AI SDK, LangGraph, Temporal Workflows, or plain code
  • Use domain-specific tools and agent loops tailored to your use case
  • Query Sharely.ai's knowledge base with RAG and semantic search, already filtered to the calling user's role
  • Get built-in RBAC for enterprise-grade content access control
  • Distribute through Web Control and Hosted Agents with streaming UI for thinking steps, tool calls, and citations
  • Host your agent on your preferred cloud platform

Different roles often need different agent behavior, not just different documents — a finance agent and a volunteer agent may draw on the same knowledge but differ in tools and guardrails. Running that as code you own and host is what BYOA is for.


How It Works

┌────────────┐     chat turn      ┌──────────────────┐    POST /chat     ┌──────────────────┐
│ Web Control │ ─────────────────▶ │ Sharely platform │ ────────────────▶ │ Your agent server │
│  (renders)  │ ◀───────────────── │  (control plane) │ ◀──────────────── │  (Server SDK)     │
└────────────┘   streamed events   └──────────────────┘    SSE events     └──────────────────┘
                                          │  ▲
                                          ▼  │ RAG / threads / tools
                                   Sharely Knowledge (RBAC-filtered)
  1. You write a Handler — an async generator that yields typed events (thinking_delta, tool_call_start, content_delta, sources, …)
  2. createSharelyServer() wraps it in an Express server that owns HTTP, CORS, auth, token validation, message persistence, and SSE encoding
  3. You register your server with your workspace via the Agent API
  4. The platform dispatches chat turns to your server and streams your agent's output straight back to the user
  5. Your agent queries knowledge through a request-scoped platform client — results arrive already filtered to the calling user's role

Key principle: Your agent logic stays completely under your control. Your handler never deals with auth, the wire format, or storage.


The SDK Packages

All packages are published on npm under the @sharelyai scope (Apache 2.0):

PackagePurpose
@sharelyai/serverExpress runtime — HTTP, CORS, auth, token validation, persistence, SSE encoding
@sharelyai/protocolWire types — Handler, AgentInput, AgentContext, the AgentEvent union. Types only, no runtime
@sharelyai/apiTyped client to the Sharely platform (threads, messages, RAG)
@sharelyai/toolsFirst-party Sharely tool definitions + a pluggable executor registry
@sharelyai/adapter-vercel-aiTranslate a Vercel AI SDK streamText stream into AgentEvents
@sharelyai/adapter-temporalTranslate a Temporal workflow's signals into AgentEvents
@sharelyai/conformanceValidate any AgentEvent stream against the wire-protocol contract

Use Cases

Legal Research Agent — A law firm builds an agent with specialized legal research tools and case law analysis. Sharely.ai manages document storage with RBAC so attorneys only access cases relevant to their practice areas.

Medical Knowledge Assistant — A healthcare provider creates an agent with clinical protocol validation. Sharely.ai manages the medical literature knowledge base with strict RBAC for sensitive clinical information.

Code Review Agent — A software company develops an agent with static analysis and security scanning tools, using Sharely.ai's knowledge base for coding standards, with role-based access per engineering team.

Customer Support Agent — A SaaS company creates an agent with CRM integration and product-specific troubleshooting workflows. Sharely.ai manages product documentation with customer-tier based access control.


Comparison: Agent Deployment Options

FeatureOut-of-Box AgentBring Your Own Agent
Setup TimeMinutesHours to days
FrameworkSharely.ai's agentAny framework or custom
ToolsBuilt-in knowledge toolsAny custom tools you need
Agent LoopGeneral-purpose conversationalCustom domain-specific logic
Knowledge Management✅ Full Sharely.ai infrastructure✅ Full Sharely.ai infrastructure
RBAC✅ Supported✅ Supported
Web Control✅ Supported✅ Supported
DeploymentFully managed by Sharely.aiYou deploy and manage
CustomizationKnowledge and journeysComplete control over agent
Best ForGeneral knowledge access, quick launchesDomain-specific agents, specialized workflows

You can also migrate later: your knowledge base and user spaces remain the same, so you can start with the out-of-box agent and move to a custom agent as your needs evolve.


Documentation

FAQ

Q: Can I use my own LLM or foundation model?

A: Yes. Your agent has complete control over which models to use — Anthropic, OpenAI, open-source models, or your own fine-tuned models.

Q: Do I need to host the agent server myself?

A: Yes. You deploy your agent server on your preferred cloud platform, giving you full control over models, dependencies, and data flow.

Q: Does this work with Web Control?

A: Yes. Web Control renders your agent's streamed events — thinking steps, tool calls, citations — with no client UI to build. Enable the agent view via displayMode.VIEWS.AGENT (see Web Control).

Q: Is there a cost difference?

A: BYOA incurs your own hosting and LLM costs for running your custom agent. Sharely.ai's knowledge management and distribution pricing remains the same.

Q: Is the SDK open source?

A: Yes — Apache 2.0, at github.com/sharelyai/sharely-server-sdk (opens in a new tab). See Open Source at Sharely.ai for everything we've opened.