How erikhenning927/engineering_ai works
This repository combines an AI commerce API, an asynchronous recommendation worker, and a separate RAG product-intelligence service. The main workflow accepts a query, checks safety and intent, and queues recommendation work; the worker processes the task and persists its result. Separately, the RAG API indexes products from a SQL Server warehouse into Qdrant and exposes similarity search and LLM-backed answers. Some worker and RAG internals are unsampled, so those relationships are included only where the source index or excerpts support them.
Main entry points: service.py Product RAG Service · app/main.py Task Consumer · database.py Warehouse Connection · src/main.py RAG API
Components 24
Request Orchestration
- Orchestration API
core-api/app/api/routes.py - Safety and Intent
core-api/app/agent/orchestrator.py - Kafka Producer
core-api/app/services/kafka_producer.py
Recommendation Worker
- Task Consumer
worker-recommendation/app/main.py - Product Agent
worker-recommendation/app/agent/product_agent.py - Vector Search Client
worker-recommendation/app/db/qdrant_client.py - Result Writer
worker-recommendation/app/db/postgres_client.py
RAG Intelligence
- RAG API
microservice-ai/src/main.py - RAG Endpoints
microservice-ai/src/rag/router.py - Product RAG Service
microservice-ai/src/rag/service.py - Embedding Generation
microservice-ai/src/rag/embeddings.py - Prompt Builder
microservice-ai/src/rag/prompts.py - Product Repository
microservice-ai/src/rag/repository.py - RAG Utilities
microservice-ai/src/rag/utils.py - Schema Definitions
microservice-ai/src/rag/schema_dict.py - RAG Vector Client
microservice-ai/src/rag/qdrant_client.py
Data Stores
- Task Results
worker-recommendation/app/db/models.py - Warehouse Connection
microservice-ai/src/database.py - SQL Server Warehouse
- Qdrant
Other components
- User
- Product Tasks
- OpenAI API
- Kafka Broker
Connections 23
- User → Orchestration API: submits query
core-api/app/api/routes.py - Orchestration API → Safety and Intent: invokes
core-api/app/api/routes.py - Safety and Intent → Kafka Producer: publishes task
core-api/app/agent/orchestrator.py - Kafka Producer → Kafka Broker: sends message
- Kafka Broker → Product Tasks: routes task
- Product Tasks → Task Consumer: delivers task
- Task Consumer → Product Agent: processes query
worker-recommendation/app/main.py - Task Consumer → Result Writer: saves result
worker-recommendation/app/main.py - Result Writer → Task Results: creates record
worker-recommendation/app/db/postgres_client.py - Product Agent → Vector Search Client: searches products
worker-recommendation/app/agent/product_agent.py - Vector Search Client → Qdrant: queries vectors
- RAG API → Warehouse Connection: initializes connection
microservice-ai/src/main.py - RAG API → RAG Endpoints: registers routes
microservice-ai/src/main.py - RAG Endpoints → Product RAG Service: calls operations
microservice-ai/src/rag/router.py - Product RAG Service → Embedding Generation: generates embeddings
microservice-ai/src/rag/service.py - Product RAG Service → Prompt Builder: builds prompt
microservice-ai/src/rag/service.py - Product RAG Service → Product Repository: loads product data
microservice-ai/src/rag/service.py - Product RAG Service → RAG Utilities: extracts response data
microservice-ai/src/rag/service.py - Product RAG Service → RAG Vector Client: searches and indexes
microservice-ai/src/rag/service.py - Product RAG Service → OpenAI API: requests completion
microservice-ai/src/rag/service.py - Product Repository → Warehouse Connection: uses connection
microservice-ai/src/rag/repository.py - Warehouse Connection → SQL Server Warehouse: connects
microservice-ai/src/database.py - RAG Vector Client → Qdrant: stores vectors
microservice-ai/src/rag/qdrant_client.py