Docs / Raw

AI Agent Quick Start

Sourced from docs/start/ai-agents.md

Edit on GitHub

AI Agent Quick Start

Last Updated: 2025-12-01

This guide helps AI coding assistants (Claude, GPT, Copilot, etc.) quickly understand and work on VoiceAssist.


Project Overview

VoiceAssist is a HIPAA-compliant medical AI assistant platform with:

  • Voice Mode: Thinker-Talker pipeline (Deepgram STT → GPT-4o → ElevenLabs TTS)
  • Text Mode: Streaming chat with citations
  • Knowledge Base: Medical textbooks, guidelines, literature
  • Admin Panel: User management, analytics, KB administration

Key Directories

/home/asimo/VoiceAssist/
├── apps/
│   ├── web-app/              # React frontend (main app)
│   ├── admin-panel/          # Admin dashboard
│   └── docs-site/            # Next.js documentation site
├── packages/
│   ├── api-client/           # Type-safe API client
│   ├── types/                # Shared TypeScript types
│   ├── ui/                   # Shared UI components
│   └── utils/                # Shared utilities
├── services/
│   └── api-gateway/          # FastAPI backend
│       └── app/
│           ├── api/          # REST endpoints
│           ├── services/     # Business logic (Thinker, Talker, etc.)
│           └── models/       # Database models
└── docs/                     # Documentation source

Critical Files

Voice Pipeline (Thinker-Talker)

FilePurpose
services/api-gateway/app/services/thinker_service.pyLLM orchestration
services/api-gateway/app/services/talker_service.pyTTS synthesis
services/api-gateway/app/services/thinker_talker_websocket_handler.pyWebSocket handling
services/api-gateway/app/services/sentence_chunker.pyText chunking for TTS
apps/web-app/src/hooks/useThinkerTalkerSession.tsFrontend voice hook

API Endpoints

FilePurpose
services/api-gateway/app/api/conversations.pyChat CRUD
services/api-gateway/app/api/voice.pyVoice session management
services/api-gateway/app/api/realtime.pyChat WebSocket
services/api-gateway/app/api/auth.pyAuthentication

Frontend Components

FilePurpose
apps/web-app/src/components/ChatView.tsxMain chat interface
apps/web-app/src/components/VoicePanel.tsxVoice mode UI
apps/web-app/src/hooks/useChatSession.tsChat state management

Documentation Index

Architecture

API Reference

Services

Data


Machine-Readable Endpoints

The docs site provides JSON endpoints for programmatic access:

EndpointDescription
GET /agent/index.jsonDocumentation system metadata
GET /agent/docs.jsonFull document list with metadata
GET /search-index.jsonFull-text search index

Base URL: https://assistdocs.asimo.io

See Agent API Reference for details.


Common Tasks

Adding a New API Endpoint

  1. Create route in services/api-gateway/app/api/<module>.py
  2. Add schema in services/api-gateway/app/schemas/<module>.py
  3. Register in services/api-gateway/app/main.py
  4. Add TypeScript types in packages/types/src/
  5. Update API client in packages/api-client/src/

Adding a Frontend Feature

  1. Create component in apps/web-app/src/components/
  2. Add hooks in apps/web-app/src/hooks/
  3. Use shared UI from packages/ui/
  4. Use API client from packages/api-client/

Modifying Voice Pipeline

  1. ThinkerService changes: thinker_service.py
  2. TalkerService changes: talker_service.py
  3. WebSocket protocol: thinker_talker_websocket_handler.py
  4. Frontend hooks: useThinkerTalkerSession.ts

Code Patterns

Backend (Python/FastAPI)

# Typical endpoint structure @router.post("/conversations/{id}/messages") async def create_message( id: UUID, request: CreateMessageRequest, user: User = Depends(get_current_user), db: Session = Depends(get_db) ) -> MessageResponse: # Business logic return MessageResponse(...)

Frontend (React/TypeScript)

// Typical hook usage const { messages, sendMessage, isLoading } = useChatSession(conversationId); // Voice mode const { startListening, stopListening, isRecording } = useThinkerTalkerSession({ onTranscript: (text) => console.log(text), onAudio: (audio) => playAudio(audio), });

Testing

# Backend tests cd services/api-gateway pytest tests/ -v # Frontend tests pnpm test # Type checking pnpm typecheck # Linting pnpm lint

Environment Setup

Required API keys (in .env):

OPENAI_API_KEY=sk-... # GPT-4o for Thinker DEEPGRAM_API_KEY=... # Speech-to-text ELEVENLABS_API_KEY=... # Text-to-speech DATABASE_URL=postgresql://... # PostgreSQL REDIS_URL=redis://... # Cache

Quick References

  • OpenAPI Spec: http://localhost:8000/openapi.json
  • Swagger UI: http://localhost:8000/docs
  • Health Check: http://localhost:8000/health
  • Docs Site: https://assistdocs.asimo.io

Beginning of guide
End of guide