For prototyping the ShopWise AI assistant N8n cloud with OpenAI and Postgres were chosen. The architecture is three agent topology with a main assistant and two specialists one tweaked for product and other for logistics. Below is the list of the main architectural decisions.
Accepted
The goal is to have a single place for building the structure of the chatbot and testing it.
Great for prototyping. Built on top of langchain framework. Industry standard, easy to migrate to code-based solution, when scalability is needed.
Quickly got the first versions running and started testing the solution.
Superceded
Affordable language model cloud solution for prototyping.
Hit the quota limits during testing
Decision to choose alternative language model to avoid issues during the evaluation checks of the chatbot capabilities after solution is submitted.
Accepted
Best in class language model cloud solution for prototyping.
Testing showed good results with possibility to tweak. Example: chat requests for comparison of items were automatically executed by the main agent as 2 separate prompts to specialist agents and then consolidated based on the replies.
OpenAi was chosen as the main language model.
Accepted
The main agent has instructions which requests to direct to which specialised agent. Logistics Manager(Orders agent): Expert on order statuses, shipping details, and delivery dates. Product Consultant: Specialist in comparing and recommending products across all categories
Use 3 agent architecture.
Good results, more transparent and tweakable chat request flow.
Superceded
Tested RAG vs SQL.
Not to use RAG, instead use SQL (due to performance issues with RAG)
SQL node showed better performance than RAG.
Accepted
During tests inconsistent behaviour of the SQL node was discovered.
SQL agent has a bug in n8n.
Postgres and “SELECT statement” nodes are chosen as the mail DB nodes in the workflow.