How sugan-developerinnooryze-stack/leadryze_ai works
LeadRyze AI is a tenant-aware lead-generation and conversational AI service. Its main workflow accepts chat through the API, routes it to a lead agent, and uses agent logic, conversation state, context retrieval, and model providers to produce responses and capture leads. Separate branches support knowledge ingestion/search, product and booking tools, template analysis, and voice. The README documents the wider tool and provider capabilities; sampled excerpts establish only some internal calls, so uncertain wiring is omitted. The continuous voice worker is a separate process.
Main entry points: base.agent.ts Base agent · lead.agent.ts Lead agent · app.ts Express application · website-ingest.service.ts Website ingestion
Components 31
API and orchestration
- Express application
src/app.ts - Chat routes
src/api/chat.routes.ts - Knowledge routes
src/api/knowledge.routes.ts - Template analysis route
src/api/template-analysis.routes.ts - Voice routes
src/api/voice.routes.ts
Conversation agents
- Lead agent
src/agents/lead.agent.ts - Base agent
src/agents/base.agent.ts - Agent workflows
src/agents/graph.ts - Booking shortcut
src/agents/booking-confirmation-shortcut.ts - Specialist agents
src/agents - Product and booking tools
src/tools - Template analysis
src/services/template-analysis.service.ts
Knowledge and retrieval
- Website ingestion
src/rag/website-ingest.service.ts - Website crawler
src/rag/web-crawler.ts - RAG pipeline
src/rag/pipeline.ts - Dataset index
src/rag/dataset-index.service.ts - Embeddings
src/rag/embeddings.ts - Qdrant vector store
src/rag/qdrant.client.ts
Services and integrations
- Conversation state
src/memory/conversation.memory.ts - Redis
- Context builder
src/services/context.builder.ts - Backend client
src/services/backend.client.ts - LLM provider layer
src/core/model-abstraction/llm.provider.ts - Moderation and limits
src/core/guardrails
Voice experience
- Speech provider registry
src/voice/registry.ts - Voice worker
src/voice-agent/worker.ts - Voice lead adapter
src/voice-agent/lead-agent-llm.ts
Other components
- Service caller
- LeadRyze backend
- LLM providers
- Speech services
Connections 38
- Service caller → Express application: sends requests
- Express application → Chat routes: mounts routes
src/app.ts - Express application → Knowledge routes: mounts routes
src/app.ts - Express application → Template analysis route: mounts routes
src/app.ts - Express application → Voice routes: mounts routes
src/app.ts - Chat routes → Lead agent: runs agent
src/api/chat.routes.ts - Chat routes → Specialist agents: dispatches requests
src/api/chat.routes.ts - Lead agent → Base agent: delegates turns
src/agents/lead.agent.ts - Lead agent → Context builder: builds context
src/agents/lead.agent.ts - Lead agent → Conversation state: reads state
- Base agent → Conversation state: reads and writes
src/agents/base.agent.ts - Base agent → Booking shortcut: checks shortcut
src/agents/base.agent.ts - Base agent → LLM provider layer: requests completions
src/agents/base.agent.ts - Base agent → RAG pipeline: retrieves knowledge
src/agents/base.agent.ts - Base agent → Moderation and limits: applies checks
src/agents/base.agent.ts - Base agent → Product and booking tools: invokes tools
src/agents/base.agent.ts - Context builder → Backend client: loads tenant context
src/services/context.builder.ts - Backend client → LeadRyze backend: calls internal API
- Conversation state → Redis: stores session state
src/memory/conversation.memory.ts - LLM provider layer → LLM providers: uses providers
- Knowledge routes → RAG pipeline: ingests and searches
src/api/knowledge.routes.ts - Knowledge routes → Dataset index: indexes datasets
src/api/knowledge.routes.ts - Knowledge routes → Website ingestion: starts website crawl
src/api/knowledge.routes.ts - Website ingestion → Website crawler: crawls pages
src/rag/website-ingest.service.ts - Website ingestion → RAG pipeline: ingests chunks
src/rag/website-ingest.service.ts - Website ingestion → Backend client: updates crawl status
src/rag/website-ingest.service.ts - Website ingestion → Conversation state: tracks crawl status
src/rag/website-ingest.service.ts - RAG pipeline → Embeddings: embeds text
src/rag/pipeline.ts - RAG pipeline → Qdrant vector store: searches and writes
src/rag/pipeline.ts - Dataset index → Embeddings: embeds records
src/rag/dataset-index.service.ts - Dataset index → Qdrant vector store: indexes and searches
src/rag/dataset-index.service.ts - Template analysis route → Template analysis: analyzes templates
src/api/template-analysis.routes.ts - Voice routes → Speech provider registry: resolves providers
src/api/voice.routes.ts - Voice routes → Lead agent: runs transcript
src/api/voice.routes.ts - Speech provider registry → Speech services: selects speech APIs
- Voice worker → Voice lead adapter: runs voice agent
src/voice-agent/worker.ts - Voice lead adapter → Lead agent: uses lead agent
src/voice-agent/lead-agent-llm.ts - Voice worker → Backend client: reports usage
src/voice-agent/worker.ts