MCPcopy Index your code
hub / github.com/benjichat/voice_agent_base

github.com/benjichat/voice_agent_base @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
206 symbols 509 edges 69 files 1 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Voice Agent Base

A voice-enabled AI agent application built with React, LangChain, and ElevenLabs.

Features

  • Voice input/output capabilities using OpenAI Whisper and ElevenLabs
  • Web search functionality using Tavily
  • React-based web interface
  • LangChain-powered agent system

Prerequisites

  • Node.js (v18 or higher)
  • pnpm (v10.6.3 or higher)

Setup

  1. Install dependencies:
pnpm install
  1. Create a .env file in the root directory with the following variables:
# OpenAI API Key for Whisper (Speech-to-Text)
OPENAI_API_KEY=your_openai_api_key

# ElevenLabs API Key for Text-to-Speech
ELEVENLABS_API_KEY=your_elevenlabs_api_key

# Tavily API Key for web search
TAVILY_API_KEY=your_tavily_api_key
  1. Start the development server:
pnpm dev

This will start both the web interface and the agent server concurrently.

Available Tools

The agent has access to the following tools:

  1. Tavily Search: Web search functionality with configurable parameters:
  2. Max results: 5
  3. Topic: General
  4. Additional optional parameters available for customization

Project Structure

  • apps/web/: React-based web interface
  • apps/agents/: LangChain agent implementation
  • src/react-agent/: Core agent logic

Development

  • pnpm dev: Start development servers
  • pnpm build: Build the application
  • pnpm lint: Run linting
  • pnpm format: Format code

Star History

Star History Chart

Extension points exported contracts — how you extend this code

AudioVisualizerFallbackProps (Interface)
(no doc)
apps/web/src/components/audio-visualizer-fallback.tsx
SpeechInput (Interface)
(no doc)
apps/agents/src/react-agent/speech-to-text.ts
AudioOrbProps (Interface)
(no doc)
apps/web/src/components/audio-visualizer-3d.tsx
TTSOutput (Interface)
(no doc)
apps/agents/src/react-agent/text-to-speech.ts
AudioOrbPropsExtended (Interface)
(no doc)
apps/web/src/components/audio-visualizer-3d.tsx
AudioVisualizer3DProps (Interface)
(no doc)
apps/web/src/components/audio-visualizer-3d.tsx
AudioVisualizerWithFallbackProps (Interface)
(no doc)
apps/web/src/components/audio-visualizer-with-fallback.tsx

Core symbols most depended-on inside this repo

cn
called by 60
apps/web/src/lib/utils.ts
useStreamContext
called by 8
apps/web/src/providers/Stream.tsx
playAudioFromBase64
called by 6
apps/web/src/components/voice-only-interface.tsx
cleanup
called by 6
apps/web/src/components/voice-only-interface.tsx
getButtonState
called by 5
apps/web/src/components/voice-only-interface.tsx
getColor
called by 3
apps/web/src/components/audio-visualizer-fallback.tsx
getContentString
called by 3
apps/web/src/components/thread/utils.ts
prettifyText
called by 3
apps/web/src/components/thread/agent-inbox/utils.ts

Shape

Function 179
Interface 27

Languages

TypeScript100%

Modules by API surface

apps/web/src/components/voice-only-interface.tsx15 symbols
apps/web/src/components/ui/audio-player.tsx13 symbols
apps/web/src/components/thread/agent-inbox/components/inbox-item-input.tsx11 symbols
apps/web/src/components/ui/sheet.tsx10 symbols
apps/web/src/components/thread/agent-inbox/components/state-view.tsx9 symbols
apps/web/src/providers/Stream.tsx8 symbols
apps/web/src/components/thread/index.tsx8 symbols
apps/web/src/components/thread/agent-inbox/utils.ts7 symbols
apps/web/src/components/thread/agent-inbox/hooks/use-interrupted-actions.tsx7 symbols
apps/web/src/components/audio-visualizer-with-fallback.tsx7 symbols
apps/web/src/components/ui/voice-recorder-button.tsx6 symbols
apps/web/src/components/ui/card.tsx6 symbols

For agents

$ claude mcp add voice_agent_base \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact