Skip to content

add livekit_agent_simulation service, agent remote session proto & cli dev proto#1404

Merged
theomonnom merged 29 commits intomainfrom
theo/agent-simulations-service
Mar 17, 2026
Merged

add livekit_agent_simulation service, agent remote session proto & cli dev proto#1404
theomonnom merged 29 commits intomainfrom
theo/agent-simulations-service

Conversation

@theomonnom
Copy link
Copy Markdown
Member

No description provided.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Feb 8, 2026

🦋 Changeset detected

Latest commit: 23813dc

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

💥 An error occurred when fetching the changed packages and changesets in this PR
Some errors occurred when validating the changesets config:
The package or glob expression "github.com/livekit/protocol" specified in the `fixed` option does not match any package in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.

Comment thread protobufs/livekit_agent_simulation.proto Outdated
Comment thread protobufs/livekit_agent_simulation.proto Outdated
Comment thread protobufs/livekit_agent_simulation.proto Outdated
@theomonnom theomonnom requested a review from davidzhao February 11, 2026 22:38
STATUS_FAILED = 3;
}

message Job {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want to nest this message? seems like it gets complicated to use.. vs SimulationJob

string error = 9;
string group_id = 10;
// Set as participant attributes on the simulation participant's access token.
map<string, string> metadata = 11;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's be explicit so it's not confused with participant metadata

Suggested change
map<string, string> metadata = 11;
map<string, string> participant_attributes = 11;

string agent_name = 2;
string agent_description = 3;
int32 num_simulations = 4;
string group_id = 5;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how do I just run a single simulation scenario?

int64 created_at = 7;
Status status = 8;
string error = 9;
string group_id = 10;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you create a scenario without a group? and then assign it to a group later? or should it have a default group?

string instructions = 3;
string agent_expectations = 4;
string group_id = 5;
map<string, string> metadata = 6;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should source_room_id be part of this too? same comment about metadata

}
message DeleteScenarioResponse {}

message UpdateScenarioRequest {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would it be simpler to just include the Scenario message here and also in Create?

@Ocupe
Copy link
Copy Markdown

Ocupe commented Mar 10, 2026

Hey @theomonnom, nice work! I have a suggestion for a logically identical structure, just with more nesting. Do what you like with it, but I find it much easier to reason about and the generated struct names are easier to read.
For example: top with nested messages, below without.

&backend.AccessRecord_Subject_LivekitSupport{}
// vs:
&backend.AccessRecordSubjectLivekitSupport{}

Branch based of yours: https://github.com/livekit/protocol/blob/js/agent-sim/protobufs/livekit_agent_simulation.proto

Like I said, do what you want with it, I just wanted to share this as I found it really valuable.

@Ocupe Ocupe self-requested a review March 16, 2026 10:52
Copy link
Copy Markdown

@Ocupe Ocupe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good. 👍
I think the api that list simulation runs also needs to support filtering and pagination so that we can implement and use it on dashboard.

theomonnom and others added 4 commits March 16, 2026 15:43
- Move response types from SessionRequest into SessionResponse
- Rename SendMessage/SendMessageResponse to RunInput/RunInputResponse
- Add OverlappingSpeech and SessionUsageUpdated events, remove MetricsCollected
- Add model usage types (LLM, TTS, STT, Interruption)
- Add GetSessionState, GetRTCStats, GetSessionUsage request/response
- Restructure simulation proto with nested CRUD pattern
- Migrate simulation created_at from int64 to google.protobuf.Timestamp
- Add pagination and status filter to ListSimulationRuns
Moved from livekit.agent package to livekit to break the
agent -> livekit import cycle.
@theomonnom
Copy link
Copy Markdown
Member Author

Looking good. 👍 I think the api that list simulation runs also needs to support filtering and pagination so that we can implement and use it on dashboard.

Done, using TokenPagination

@theomonnom theomonnom changed the title add livekit_agent_simulation service add livekit_agent_simulation service, agent remote session proto & cli dev proto Mar 17, 2026
Copy link
Copy Markdown
Member

@davidzhao davidzhao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lg, just a few naming nits

Comment thread protobufs/agent/livekit_agent_dev.proto Outdated
string url = 5;
string token = 6;
string worker_id = 7;
bool fake_job = 8;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: fake -> mock

uint32 samples_per_channel = 4;
}

enum SessionAgentState {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these should be re-usable right? should they just be AgentState & UserState?

also recommend the enums to be abbreviated, i.e.:

AS_INITIALIZING

repeated ModelUsage model_usage = 1;
}

message SessionEvent {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prefix with AgentSession to disambiguate?

Suggested change
message SessionEvent {
message AgentSessionEvent {

message SessionAudioPlaybackClear {}
message SessionAudioPlaybackFinished {}

message AgentSessionMessage {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so these will be text or data streams, while the SessionRequest/Responses are using RPCs?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They call all use text/data streams because they have a request_id
Also used for our TCP transport

@theomonnom theomonnom merged commit 9607166 into main Mar 17, 2026
7 checks passed
@theomonnom theomonnom deleted the theo/agent-simulations-service branch March 17, 2026 20:24
This was referenced Mar 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants