Skip to content

feat: integrate LiveKit for real-time voice agents#286

Open
pulinduvidmal wants to merge 11 commits into
developfrom
feature/livekit-integration
Open

feat: integrate LiveKit for real-time voice agents#286
pulinduvidmal wants to merge 11 commits into
developfrom
feature/livekit-integration

Conversation

@pulinduvidmal
Copy link
Copy Markdown
Contributor

Description

add livekit integration

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test update
  • CI/CD update
  • Other (please describe):

Related Issues

Fixes #
Relates to #

Changes Made

Testing

  • Unit tests pass locally
  • Integration tests pass locally
  • Manual testing completed
  • New tests added for changes

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Screenshots (if applicable)

Additional Notes

Copilot AI review requested due to automatic review settings May 10, 2026 19:38
@pulinduvidmal pulinduvidmal changed the title Integrate LiveKit for real-time voice agents feat: integrate LiveKit for real-time voice agents May 10, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a new LiveKit integration to let Agent Kernel agents participate in real-time voice sessions, along with documentation and an end-to-end demo project under examples/.

Changes:

  • Added AgentLiveKitRequestHandler + AgentKernelLLM bridge to run a LiveKit worker alongside the FastAPI REST server and expose /livekit/token.
  • Extended core configuration with a new livekit section and added a new livekit optional extra in ak-py/pyproject.toml.
  • Added docs + a runnable examples/api/livekit demo, and wired the new docs page into the Docusaurus sidebar.

Reviewed changes

Copilot reviewed 15 out of 17 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
examples/api/livekit/server.py Demo REST API entrypoint for LiveKit voice handler
examples/api/livekit/README.md Demo instructions for token endpoint + LiveKit workflow
examples/api/livekit/pyproject.toml Demo project dependencies (agentkernel extras)
examples/api/livekit/build.sh Demo environment/bootstrap script
examples/api/livekit/.env.example Demo environment variable template
docs/sidebars.js Adds LiveKit integration doc page to sidebar
docs/docs/intro.md Updates intro diagrams/lists to reflect LiveKit support
docs/docs/integrations/overview.md Adds LiveKit under integrations overview + diagrams
docs/docs/integrations/livekit.md New LiveKit integration documentation page
ak-py/src/agentkernel/livekit.py Public module export for the LiveKit integration
ak-py/src/agentkernel/integration/livekit/README.md Integration README (library-internal)
ak-py/src/agentkernel/integration/livekit/livekit_handler.py Core LiveKit handler + AgentKernel LLM bridge implementation
ak-py/src/agentkernel/integration/livekit/init.py Exposes LiveKit handler/LLM symbols
ak-py/src/agentkernel/core/config.py Adds livekit config model to AKConfig
ak-py/pyproject.toml Adds livekit optional extra dependencies
ak-py/uv.lock Locks new dependency set for LiveKit integration

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread examples/api/livekit/server.py Outdated
Comment thread docs/docs/integrations/livekit.md Outdated
Comment thread ak-py/src/agentkernel/core/config.py
Comment thread ak-py/src/agentkernel/integration/livekit/livekit_handler.py Outdated
Comment thread ak-py/src/agentkernel/integration/livekit/livekit_handler.py Outdated
Comment thread ak-py/src/agentkernel/integration/livekit/livekit_handler.py Outdated
Comment thread ak-py/src/agentkernel/integration/livekit/livekit_handler.py Outdated
Comment thread docs/docs/integrations/livekit.md
Copilot AI review requested due to automatic review settings May 10, 2026 20:47
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 15 out of 17 changed files in this pull request and generated 4 comments.

Comment thread ak-py/src/agentkernel/integration/livekit/livekit_handler.py Outdated
Comment thread ak-py/src/agentkernel/integration/livekit/livekit_handler.py Outdated
Comment thread docs/docs/integrations/livekit.md Outdated
Comment thread ak-py/src/agentkernel/integration/livekit/README.md Outdated
Copilot AI review requested due to automatic review settings May 19, 2026 09:28
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 17 out of 19 changed files in this pull request and generated 6 comments.

Comments suppressed due to low confidence (2)

examples/api/livekit/server_test.py:42

  • The fixture uses a fixed await asyncio.sleep(5) to wait for the server to start, which is flaky across machines and can cause intermittent failures or unnecessary delays. Prefer polling the /health endpoint (with a timeout/backoff) until it responds before yielding the client.
    proc = subprocess.Popen(
        [sys.executable, "server.py"],
        stdout=sys.stdout,
        stderr=sys.stderr,
        env=my_env,
    )
    await asyncio.sleep(5)
    try:
        yield APITestClient(f"http://localhost:8000")

examples/api/livekit/server_test.py:45

  • proc.wait() in the finally block has no timeout. If the server doesn’t terminate cleanly, the test session can hang. Consider wait(timeout=...) and falling back to proc.kill() if needed.
        proc.terminate()
        proc.wait()

Comment thread examples/api/livekit/server_test.py
Comment thread examples/api/livekit/.env.example Outdated
Comment thread docs/docs/integrations/livekit.md
Comment thread ak-py/src/agentkernel/integration/livekit/README.md
Comment thread ak-py/src/agentkernel/integration/livekit/livekit_handler.py Outdated
Comment thread ak-py/src/agentkernel/integration/livekit/livekit_handler.py Outdated
Copilot AI review requested due to automatic review settings May 19, 2026 09:49
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 16 out of 18 changed files in this pull request and generated 5 comments.

Comment thread docs/docs/integrations/livekit.md
Comment thread docs/docs/integrations/livekit.md Outdated
Comment thread ak-py/src/agentkernel/integration/livekit/README.md
Comment thread examples/api/livekit/server.py Outdated
Comment thread ak-py/src/agentkernel/integration/livekit/livekit_handler.py Outdated
Copilot AI review requested due to automatic review settings May 19, 2026 10:20
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI review requested due to automatic review settings May 20, 2026 04:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

@amithad amithad self-requested a review May 21, 2026 06:28
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