r/ContextEngineering • u/Reasonable_Teach4344 • 5d ago
From an MQTT event to document context: a visual RAG workflow
/r/Rag/comments/1y8n7is/i_built_a_visual_workflow_connecting_rag_over/https://reddit.com/link/1y8nahw/video/egu9maxysl4i1/player
I teach IoT and AI and develop SHAPE, a visual programming environment.
I built a teaching demo where a sensor error received over MQTT triggers a query against a technical manual, rather than requiring someone to open a chat and describe the problem.
The workflow:
Upload a sample sensor manual and prepare it for retrieval.
Receive an MQTT message such as {"errorCode": "E01"}.
Use the error code to query the document-aware service.
Parse the generated response as JSON and publish it back through MQTT.
SHAPE connects the steps with visual blocks. ChordLLM manages documents and retrieval, while Ollama runs Ministral locally. In this example, the manual is attached to one conversation.
The context-design question is what should accompany the error code. The demo uses a single manual, but with multiple devices, the code alone would not identify the right documentation.
Generated troubleshooting steps still need verification against the source, and JSON parsing does not guarantee a valid schema.
How would you scope retrieval in a multi-device setup: separate knowledge bases per device, or a shared collection filtered by device model and manual version?
Code and documentation: https://github.com/TactigonTeam/Tactigon-Shape