how to have a frontend for my app which has a conv...
# ask-ai
p
how to have a frontend for my app which has a conversation flow builder for my customers to help them build their ai voice agents. this then needs to feed into livekit which will power the agent under the hood
t
Thanks for reaching out, Sunny. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Hi there! LiveKit offers fantastic tools to help you build real-time voice agent applications. While it doesn't have a visual conversation flow builder for designing dialogue logic, you can still create conversation flows programmatically on the backend and keep everything in sync with the frontend using LiveKit's SDKs and RPC (Remote Procedure Calls). For the frontend, I recommend trying out the
agent-starter-react
template. It’s great because it supports real-time voice interaction, transcriptions, and dynamic updates. To get started with this template, just run:
Copy code
lk app create --template agent-starter-react
After that, you can start the app locally by running:
Copy code
pnpm install
pnpm dev
Then, simply open your browser and go to http//localhost3000 to see it in action. If you'd like, I’d be happy to guide you through implementing a programmable conversation flow—like form-based or branching logic—using LiveKit Agents and RPC. Just let me know how I can help! Sources: OpenAI and LiveKit partner to turn Advanced Voice into an API | Virtual avatar plugins | LiveKit Docs | TEMPLATE.md | complex-agents/nutrition-assistant/README.md | Voice Assistant Applications | livekit/livekit_composite | DeepWiki
p
I want to be able to make the conversation flows on frontend and have this dynamically tanslate to the agent
t
I'd love to better understand how you picture the frontend conversation flow builder working. For instance: • Are you thinking of a drag-and-drop interface to design the flows? • What kind of dynamic translation to the agent do you have in mind? Maybe real-time updates or predefined templates? • Are there any particular features or integrations that are important to you? Getting a clearer idea will really help me offer the best guidance or suggest some great alternatives for you.
p
1. yes. dont worry about implementation of the interface I will handle that but how could I possibly use this to map into a livekit agent 2. It needs to be custom conversation flows and custom tools per my user.
t
I'm glad you're interested in mapping your custom frontend conversation flows into LiveKit agents! Let me walk you through how you can set this up in a way that feels clear and manageable: Custom Conversation Flows • You can define your conversation flows programmatically using patterns like linear flows, branching decision trees, or declarative logic—whichever fits your needs best. • Agent handoffs are a great way to smoothly transfer control between different agents during various phases of the conversation, all while keeping the context intact. Tool Mapping to Agents • Each agent can have its own unique set of tools, with specific actions such as API calls or state updates tailored to what you want them to do. • These tools work dynamically based on how users interact, and they can even trigger agent handoffs or update the conversation state to keep everything flowing naturally. Example
Copy code
const routerAgent = new RouterAgent({
  tools: {
    playGame: llm.tool({
      description: 'Called when the user wants to play a game.',
      execute: async () => {
        return llm.handoff({ agent: gameAgent, returns: 'The game is now playing.' });
      },
    }),
  },
});
If you'd like, I’m here to provide more details on how to implement these flows or share examples of specific tools and agent configurations. Just let me know how I can help! Sources: examples/src/restaurant_agent.ts | JavaScript Agents & LLM Integration | livekit/livekit_composite | DeepWiki | Workflows | LiveKit Docs | External data and RAG | LiveKit Docs | complex-agents/testing/agent_test.py
p
but i dont want to define the conversation flow upfront in code it will be made in dshboard on frontend
t
Thanks for reaching out! I want to share that LiveKit doesn’t come with a ready-made visual flow builder for creating conversation flows dynamically within a frontend dashboard. But don’t worry—LiveKit provides all the essential components and patterns you’ll need to build one yourself. Here’s a friendly overview of how you might approach it: Key Building Blocks: • Declarative Flow Patterns: You can define flows programmatically and load them dynamically from external sources, giving you flexibility. • RPC Communication: This allows you to send flow commands from your frontend directly to LiveKit agents smoothly. • React-Based UI: You can create a visual flow design interface using LiveKit’s React components and state management patterns, making the UI interactive and intuitive. LiveKit supports dynamic flow modification and synchronization between your frontend and agents, so updates happen in real time. While the visual flow builder itself will need to be custom-built, the platform offers the right tools to help you integrate it seamlessly with your agents. If you’d like, I’d be happy to guide you through specific parts of this setup—like how to handle RPC integration or dynamic flow loading. Just let me know how I can assist! Sources: Voice Assistant Applications | livekit/livekit_composite | DeepWiki | avatars/hedra/README.md