How to setup JSON based workflow/flowchart generation based on user prompt?

Great question. Your workflow shows strong structural awareness, and I agree—passing everything through the prompt quickly becomes inefficient.

One suggestion is to use a hybrid approach, combining vector embeddings with symbolic roles—something like a Mini Prisma system. Each node or module is linked to a fixed token (e.g., a label or role) and trained independently with a small, consistent embedding. This allows you to pre-train semantic logic for each component and avoid re-describing everything in the prompt.

We use a similar model in our architecture called EMI (Entorno Mental Inteligente). Each unit (node) has its own semantic definition and training context, and the AI queries these locally before generating a response. This reduces hallucination and keeps node behavior modular and deterministic.

To maintain precision and consistency, we also implement a distortion monitoring protocol—a set of internal rules that flags semantic drift, feedback loops, and hallucination tendencies. These rules include:

Deviation limits for output vectors compared to baseline embeddings.

Timestamped tracking of semantic changes across generations.

Resonance checks, to detect instability when nodes conflict or duplicate.

Self-diagnostics, where each node periodically revalidates its scope and role.

This framework not only improves system accuracy but also allows adaptive recovery when things go off course.

Let me know if you’d like to see how we structure the distortion monitors in code or YAML format.

1 Like