Deploying Coral Server
The first step to integrating Coral Server with your application is having a proper deployment of it. Exactly how you manage & deploy it depends on your application, but we offer a docker image for Coral Server, and support orchestrating agents via Docker.Docker (recommended)
Docker (recommended)
Coral Server looks for an
application.yaml
file in the path provided to it via the CONFIG_PATH
environment variable. When running from docker that path defaults to /config/
.For that reason - to be able to configure Coral Server, you should create a config folder & mount that to /config
when running:There is no need to restart the server if you are only changing
application.yaml
- it will hot reload your changes!Our provided docker image does not contain a python runtime! This means you cannot run agents through the
executable
runtime - and must use Docker orchestration instead.This is intended, as Docker orchestration is more stable, reproducible & portable - thus more production-ready.Docker orchestration from inside Docker
In order to allow Coral Server to spin up containers while being inside a Docker container itself, we need to mount the host’s Docker socket into our container.Since Docker behaves differently on each platform - how to do this varies:Linux
Linux
Mounting
/var/run/docker.sock
should be enough to give the server the ability to spin up containers.macOS
macOS
We recommend you install colima for a nicer experience. With colima, you can mount Without colima, you can mount
~/.colima/docker.sock
:~/.docker/run/docker.sock
to the container:Note how we mount to
/var/run/docker.sock
inside the container, so we don’t need
to set DOCKER_SOCKET
Windows
Windows
Mount If that doesn’t work, mount
//var/run/docker.sock
://./pipe/docker_engine
, and point to it with the DOCKER_SOCKET
environment variable:Java
Java
Clone the repo and build the jar file:Coral Server looks for an
application.yaml
file in the path provided to it via the CONFIG_PATH
environment variable. When unset, that path defaults to ./src/main/resources/
, to make it easy in development.For production, we recommended you set CONFIG_PATH
to somewhere more easily accessible (and not in the cloned repo folder):There is no need to restart the server if you are only changing
application.yaml
- it will hot reload your changes!You should also consider writing a systemd service that runs your jar file for more reliable deployments.
Using Coral Server
In production, the only ways you should be interfacing with Coral Server & the agents inside - is through the create session endpoint (/sessions
), and custom tools.
Creating Sessions
Creating sessions is how you define and orchestrate agent graphs. While Coral Studio provides a ready-made interface for doing it, when integrating Coral with your application, you’ll want to use Coral Server’s APIs directly./sessions
, with a JSON body containing your session parameters. Here are some sample request bodies:
Session Request Parameters
The Application ID (defined in your
application.yaml
)The Privacy Key for the given Application (also defined in your
application.yaml
)The desired graph of agents for this session.
What agents can interact with each other - defined as a list of ‘groups’ of agents, where each agent in a group can “see” every other agent in that same group.For example:Defines two groups, where agents
a
, b
& c
can all interact, and agents c
& d
can interact. Agents a
& b
however, cannot interact with agent d
.Custom Tools
There are a lot of scenarios in which you need agents to be given application-specific capabilities - that can’t be built into the agents themselves (if you are using 3rd party agents). For that reason, Coral Server supports injecting custom MCP tools at runtime.Example - User Input
A common use case in applications is exposing some kind of “chat”-style agent to your end users. This can be implemented using custom tools.Coral Studio implements
this exact use case for easy local development. Feel free to browse the
source
code
for an example implementation.
request-input
, and respond-to-input
(you can call them whatever you like)
The flow would look (roughly) like:
- Agent calls
request-input
when they’re ready - which hangs until there is user input.- Your implementation of
request-input
would propagate this input request to your frontend, and resolve it once the user enters something (in say a chat style UI).
- Your implementation of
- Agent does whatever work it needs based on that user input.
- When the agent is ready to respond, it calls
respond-to-input
, with the answer/response as input.- Your implementation of
respond-to-input
would then carry that response to the frontend - to display to your end user.
- Your implementation of
/sessions
body) could look like the following: