How kevinjose102/context-aware-agent works
Lenni is a conversational mental-health support and medical-triage agent. A user sends text or recorded audio through the chat interface; the Flask backend processes the message, uses conversation context and safety-oriented triage to choose a response, and returns it to the interface. Its documented capabilities also include voice and text emotion analysis, guideline retrieval, and short- and long-term memory. The backend excerpts show orchestration and Pinecone/LLM calls; unsampled code limits certainty about internal audio and emotion wiring.
Main entry points: server.py Message orchestration · Start.jsx Chat interface · routes.ts App routes
Components 15
User interface
- Chat interface
frontend/app/components/Start.jsx - App routes
frontend/app/routes.ts
Conversation backend
- Flask API
backend/server.py - Message orchestration
backend/server.py - Safety triage
backend/server.py - Speech processing
backend/server.py - Emotion analysis
backend/server.py
Memory and retrieval
- Short-term cache
backend/server.py - Long-term memory
backend/server.py - Guideline retrieval
backend/server.py
External services
- Pinecone
- Chat model
- Speech recognition
- Emotion model
Other components
- User
Connections 18
- User → Chat interface: sends message
- App routes → Chat interface: routes to chat
- Chat interface → Flask API: submits text or audio
- Flask API → Message orchestration: dispatches message
- Message orchestration → Safety triage: evaluates risk
- Message orchestration → Short-term cache: adds turn
- Message orchestration → Long-term memory: retrieves context
- Message orchestration → Guideline retrieval: requests guidance
- Message orchestration → Chat model: requests response
- Guideline retrieval → Pinecone: queries guidelines
- Long-term memory → Pinecone: fetches vectors
- Message orchestration → Pinecone: stores conversation
- Flask API → Speech processing: processes audio
- Speech processing → Speech recognition: transcribes audio
- Flask API → Emotion analysis: analyzes emotion
- Emotion analysis → Emotion model: scores vocal tone
- Message orchestration → Emotion model: detects text emotion
- Flask API → Chat interface: returns reply