Skip to content

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

Open
theomonnom wants to merge 20 commits intomainfrom
theo/agent-simulations-service
Open

add livekit_agent_simulation service, agent remote session proto & cli dev proto#1404
theomonnom wants to merge 20 commits intomainfrom
theo/agent-simulations-service

Conversation

@theomonnom
Copy link
Member

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Feb 8, 2026

⚠️ No Changeset found

Latest commit: e08abe1

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a 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.

@theomonnom theomonnom requested a review from davidzhao February 11, 2026 22:38
STATUS_FAILED = 3;
}

message Job {
Copy link
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
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
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
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
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
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

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

@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
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
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

string url = 5;
string token = 6;
string worker_id = 7;
bool fake_job = 8;
Copy link
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
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
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
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?

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.

3 participants