diff --git a/doc/NDWM.md b/doc/NDWM.md new file mode 100644 index 0000000..25655c2 --- /dev/null +++ b/doc/NDWM.md @@ -0,0 +1,81 @@ +# Knowledge-Driven Workflow Management + +## Abstract + +Traditional workflow management systems excel at structuring processes and storing data, but they fail to capture the semantic meaning and contextual insights that emerge during workflow execution. This paper presents a methodology for transforming workflow management systems into knowledge-driven platforms by integrating Large Language Models (LLMs) with BPMN 2.0 modeling. The approach introduces two key innovations: automated insight generation at workflow completion and proactive knowledge activation at workflow initiation. + +## 1. Problem Statement + +Enterprise Resource Planning (ERP) systems structure and manage corporate data. Business Process Management (BPM) suites structure and orchestrate business processes. However, both approaches share a fundamental limitation: they store information without understanding it. +Consider a two-year construction planning project. Throughout its lifecycle, hundreds of workflows are executed, thousands of documents are processed, and countless decisions are made. Each individual workflow is visible and traceable. Yet the accumulated knowledge, the contextual relationships, and the lessons learned become fragmented across the System. After several months, no single person or system truly understands the project in its entirety. +The core challenge is the gap between activity and understanding. Systems record what happened, but not what it means. + +## 2. Methodology + +### 2.1 Workflow Summary Generation + +The foundation of this approach is the structured summarization of workflow execution within Dynamixs.AI. Each completed workflow generates a chronological summary containing the workflow type and status, a timestamped event history with actor identification, embedded document content (extracted text from attachments), and user comments and annotations. +This summary serves as the raw material for insight generation. It captures not just the data, but the narrative of how the workflow unfolded. + +### 2.2 LLM-Based Insight Extraction + +Upon workflow completion, Dynamixs.AI automatically invokes an LLM to analyze the workflow summary. The LLM is prompted to extract project-specific insights rather than generic observations. The prompt structure emphasizes specific facts over general advice, unusual events or warnings, relevant names and entities, and future implications. +A carefully designed prompt template ensures consistent, actionable output: + + Analyze this completed workflow and extract key insights. Respond with a brief insight (2-3 sentences): What happened? What should be remembered? Be specific. No generic advice. Include relevant names when mentioned. + +### 2.3 RAG Integration + +The generated insights are stored in a Retrieval-Augmented Generation (RAG) system alongside the original workflow summary. This creates a two-layer knowledge architecture: the Fact Layer containing raw workflow data (chronology, documents, events) and the Insight Layer containing the distilled understanding (meaning, warnings, relationships). +The insight is prepended to the workflow summary, ensuring that semantic retrieval surfaces the distilled knowledge first, followed by supporting details. Both layers share a common workflow identifier, enabling complete context reconstruction. + +### 2.4 Proactive Knowledge Activation + +The transformative element of this methodology is the inversion of the traditional query pattern. Instead of waiting for users to search for information, Dynamixs.AI proactively surfaces relevant knowledge when a new workflow begins. +When a workflow is initiated, Dynamixs.AI queries the RAG database for related insights (e.g., by customer, product, or project), aggregates relevant historical knowledge, and invokes the LLM to generate a contextual briefing for the user. (TODO: this part need to be implemented in a more elegant way...) +This briefing is presented before the user begins work, transforming passive data retrieval into active knowledge delivery. + +## 3. BPMN 2.0 Integration + +A key architectural decision is the modeling of LLM interactions within the BPMN 2.0 framework. Rather than implementing insight generation as external system logic, both the insight extraction and knowledge activation are modeled as workflow elements parallel to the business process. +This approach offers several advantages: + +1. **Visibility:** LLM operations are visible in the process model, not hidden in code. +2. **Configurability:** Prompts and RAG queries can be modified by process designers without development. +3. **Auditability:** All LLM interactions are logged as workflow events. +4. **Flexibility:** Different process types can use different insight generation strategies. + +Micro-workflows can be employed to orchestrate LLM calls, RAG queries, and result processing, maintaining separation between business logic and knowledge management logic. + +## 4. System Architecture + +The architecture consists of four primary components: + +- The Workflow Engine (BPMN 2.0) which orchestrates business processes and LLM micro-workflows. +- The LLM Service which processes prompts and generates insights (model-agnostic via OpenAI-compatible API). +- The RAG System which stores and retrieves workflow summaries and insights with vector-based semantic search. +- The Knowledge Activator which queries RAG at workflow initiation and generates contextual briefings. + +Dynamixs.AI maintains model independence by utilizing standardized API interfaces. The LLM component can be replaced (e.g., from Mistral to Llama) without affecting the workflow definitions or RAG integration. + +## 5. Practical Example + +Consider a sales quotation workflow. A customer request arrives via email, is processed, and an offer is sent. The workflow summary captures the complete interaction, including the observation that requested products became unavailable. +The generated insight records: + +- Customer identity and contact details +- Specific product requirements +- The critical warning about product unavailability +- Customer interest in volume discounts + +Six months later, when a new workflow is initiated for the same customer, Dynamixs.AI automatically surfaces this context. The sales representative is immediately informed of the previous interaction, the unresolved product availability issue, and the customer's pricing expectations, all before beginning work. + +## 6. Conclusion + +This methodology transforms workflow management from a system that merely records activity to one that accumulates and activates organizational knowledge. By integrating LLM-based insight generation with BPMN 2.0 modeling and RAG-based retrieval, enterprises can ensure that lessons learned in one workflow inform future workflows automatically. +The key innovation is not the individual components, which are well-established, but their integration pattern: + +- knowledge flows from completed workflows into a semantic store +- and is proactively surfaced when relevant contexts arise. + +Dynamixs.AI does not wait to be asked; it volunteers what it knows. This represents a shift from data management to knowledge management, enabled by the semantic capabilities of modern LLMs and the structured orchestration of BPMN 2.0. diff --git a/doc/NDWM.pdf b/doc/NDWM.pdf new file mode 100644 index 0000000..0d02e4f Binary files /dev/null and b/doc/NDWM.pdf differ