Samvidhi is a generic, highly customizable real-time AI Voice Agent platform built with .NET 8 (ASP.NET Core & Blazor) and powered by the Gemini Multimodal Live API (models/gemini-3.1-flash-live-preview).
Out-of-the-box, it is configured for a Web Development Agency to handle client project inquiries, technical capabilities questions, budget estimates, and discovery call bookings via direct speech-to-speech interaction.
-
Real-Time Speech-to-Speech: Bidirectional low-latency audio streaming over WebSockets (16kHz PCM microphone input
$\rightarrow$ 24kHz PCM speaker output). -
Real-Time Function Calling: Native execution of Gemini Live tool calls:
-
submit_project_lead: Captures client details, project scope, budget range, and timeline. -
schedule_discovery_call: Books technical consultation meetings. -
get_agency_info: Dynamic lookup of agency services, tech stack, pricing models, and portfolio highlights.
-
-
Blazor Admin & Testing Dashboard:
-
Live Voice Tester (
/live-tester): Test calls in real-time directly from your browser microphone and speakers. -
Project Leads CRM (
/leads): Board to manage incoming web app, e-commerce, and software inquiries. -
Discovery Calls Log (
/calls): View scheduled client consultation meetings. -
Agency Persona Editor (
/settings): Tweak the system prompt, Gemini model, voice selection (Aoede,Puck,Charon,Kore,Fenrir), and agency knowledge base.
-
Live Voice Tester (
-
Persisted Storage: Built-in EF Core with SQLite database (
samvidhi.db).
flowchart TD
subgraph Client Layer
BrowserMic[Browser Microphone / Web Audio API] -->|WebSocket: PCM 16kHz| Gateway[ASP.NET Core Web Gateway - Samvidhi.Web]
BlazorUI[Blazor Server Admin Dashboard] -->|SignalR / HTTP| Gateway
end
subgraph .NET 8 Engine
Gateway -->|Audio Resampler & Gateway Controller| AudioPipe[PCM 16kHz Input / 24kHz Output]
AudioPipe -->|ClientWebSocket BidiGenerateContent| GeminiLive[Gemini Live API: models/gemini-3.1-flash-live-preview]
GeminiLive -->|Tool Call JsonElement| ToolDispatcher[Agency Tool Dispatcher]
end
subgraph Storage & Services
ToolDispatcher -->|Submit Lead / Schedule Call| LeadService[Agency Lead Service]
LeadService -->|EF Core SQLite| DB[(SQLite Database: samvidhi.db)]
Gateway -->|Configuration Engine| ConfigStore[appsettings.json / Agency Persona DB]
end
d:/samvidhi/
├── Samvidhi.sln
├── README.md
├── .gitignore
├── src/
│ ├── Samvidhi.Core/ # Domain Models, DTOs & Interfaces
│ │ ├── Models/
│ │ │ ├── ProjectLead.cs
│ │ │ ├── DiscoveryCall.cs
│ │ │ ├── CallTranscript.cs
│ │ │ └── AgencyConfig.cs
│ │ ├── Dtos/
│ │ │ └── GeminiLiveMessages.cs
│ │ └── Interfaces/
│ │ └── IAgencyLeadService.cs
│ │
│ ├── Samvidhi.Infrastructure/ # Gemini Live Client, Tools & EF Core Data Access
│ │ ├── Data/
│ │ │ └── SamvidhiDbContext.cs
│ │ ├── Audio/
│ │ │ └── AudioResampler.cs
│ │ ├── Gemini/
│ │ │ ├── GeminiLiveClient.cs # BidiGenerateContent WebSocket Client
│ │ │ └── AgencyToolDispatcher.cs # Real-time function call handler
│ │ └── Services/
│ │ └── AgencyLeadService.cs
│ │
│ └── Samvidhi.Web/ # ASP.NET Core 8 Web API & Blazor Dashboard
│ ├── Controllers/
│ │ └── VoiceGatewayController.cs # WebSocket Endpoint (/ws/live)
│ ├── Components/
│ │ ├── Pages/
│ │ │ ├── Home.razor # Dashboard summary
│ │ │ ├── LiveTester.razor # In-browser mic Gemini Live call simulator
│ │ │ ├── Leads.razor # Project leads management board
│ │ │ ├── Calls.razor # Discovery calls list
│ │ │ └── Settings.razor # AI Persona & Knowledge Base editor
│ │ └── Layout/
│ ├── wwwroot/
│ │ └── js/audio-recorder.js # Web Audio API JSInterop helper
│ ├── appsettings.json
│ └── Program.cs
- .NET 8.0 SDK or later.
- A Google Gemini API Key.
-
Clone the repository:
git clone https://github.com/your-org/samvidhi.git cd samvidhi -
Configure your Gemini API Key: Set
GEMINI_API_KEYinsrc/Samvidhi.Web/appsettings.json:{ "GEMINI_API_KEY": "YOUR_GEMINI_API_KEY_HERE" }Or set it via environment variable:
export GEMINI_API_KEY="YOUR_GEMINI_API_KEY_HERE"
-
Build the solution:
dotnet build
-
Run the web application:
dotnet run --project src/Samvidhi.Web
-
Access the Dashboard: Open
http://localhost:5000(orhttps://localhost:5001) in your web browser.
- Navigate to Live Voice Tester (
/live-tester). - Click Start Voice Session and allow microphone access.
- Speak naturally with Samvidhi! Sample prompts to try:
- "Hi Samvidhi, what web development services does your studio offer?"
- "What tech stack do you build applications with?"
- "I want to build a custom web application with a $10,000 budget. Can you log my request?"
- "I'd like to schedule a discovery call for tomorrow at 2 PM."
- View recorded leads under Project Leads (
/leads) or scheduled consultations under Discovery Calls (/calls).
Samvidhi can be easily customized for any business domain or personal assistant purpose:
- Navigate to Agent Settings (
/settings) to update:- Agent Name & Agency Name
- Target Gemini Model (e.g.
models/gemini-3.1-flash-live-preview) - Selected Prebuilt Voice (
Aoede,Kore,Puck,Charon,Fenrir) - System Prompt & Custom Instructions
- Tech Stack, Pricing, and Knowledge Base Info
- Core: .NET 8, C#
- AI Model Engine: Gemini Multimodal Live API (
wss://generativelanguage.googleapis.com/ws/google.ai.generativelanguage.v1alpha.GenerativeService.BidiGenerateContent) - Web & UI: ASP.NET Core, Blazor Server, WebSockets, Bootstrap 5
- Browser Audio: Web Audio API (
AudioContext,ScriptProcessorNode, JSInterop) - Database: Entity Framework Core 8, SQLite
This project is licensed under the MIT License.