How ingu627/ai-agent-service works
AI Agent Service is a conversational assistant with a React client and an optional FastAPI proxy. The user submits a message or quick prompt; the chat UI delegates generation, displays the reply, and persists conversation history locally. Generation can use OpenAI or Perplexity, with optional Tavily search grounding; the proxy handles search and model completion server-side when configured. The UI also supports streaming, export, and keyboard shortcuts. Backend and frontend source excerpts show the primary calls; some UI capabilities are documented but their detailed implementation was not sampled.
Main entry points: ChatBot.tsx Chat interface · api.py Chat API · apiService.ts AI API client · services.py Completion service
Components 18
Chat experience
- App shell
frontend/src/App.tsx - Chat interface
frontend/src/components/ChatBot.tsx - Message bubbles
frontend/src/components/MessageBubble.tsx - Typing indicator
frontend/src/components/TypingIndicator.tsx - Keyboard shortcuts
frontend/src/hooks/useKeyboardShortcuts.ts
Client services
- AI API client
frontend/src/services/apiService.ts - Chat history
frontend/src/services/storageService.ts
Backend service
- Chat API
backend/api.py - Request contracts
backend/schemas.py - Runtime settings
backend/config.py - Search grounding
backend/search.py - Completion service
backend/services.py - Logging
backend/app_logging.py
AI integrations
- OpenAI
- Perplexity
- Tavily Search
Other components
- User
- Browser local storage
Connections 24
- User → App shell: opens
README.md - App shell → Chat interface: renders
frontend/src/App.tsx - Chat interface → AI API client: requests generation
frontend/src/components/ChatBot.tsx - Chat interface → Chat history: loads and saves
frontend/src/components/ChatBot.tsx - Chat history → Browser local storage: reads and writes
frontend/src/services/storageService.ts - Chat interface → Keyboard shortcuts: registers actions
frontend/src/components/ChatBot.tsx - Chat interface → Message bubbles: renders
frontend/src/components/ChatBot.tsx - Chat interface → Typing indicator: renders
frontend/src/components/ChatBot.tsx - AI API client → OpenAI: calls completion
frontend/src/services/apiService.ts - AI API client → Perplexity: calls completion
frontend/src/services/apiService.ts - AI API client → Tavily Search: searches web
frontend/src/services/apiService.ts - AI API client → Chat API: posts chat
frontend/src/services/apiService.ts - Chat API → Request contracts: validates payload
backend/api.py - Chat API → Search grounding: requests search
backend/api.py - Search grounding → Tavily Search: searches web
backend/search.py - Chat API → Completion service: requests completion
backend/api.py - Completion service → OpenAI: calls completion
backend/services.py - Completion service → Perplexity: calls completion
backend/services.py - Chat API → Runtime settings: loads configuration
backend/api.py - Search grounding → Runtime settings: loads configuration
backend/search.py - Completion service → Runtime settings: loads configuration
backend/services.py - Chat API → Logging: configures logging
backend/api.py - Search grounding → Logging: logs failures
backend/search.py - Completion service → Logging: logs provider
backend/services.py