diniscruz.ai / writing / Projects and Innovation Lab

Project InsightFlow: GenAI-Powered Transformation of Regulatory and News Feeds

By Dinis Cruz and ChatGPT Deep Research · · 26 min read

PDF LinkedIn post

regulationsnewssemantic-knowledge-graphgenaipersonalization

Contents · 4 sections
  1. Executive Summary
  2. Problem Statement
  3. Solution Overview
  4. Implementation Plan

Executive Summary

Company X’s personalized news feed process can be transformed from a manual, labor-intensive workflow into a highly scalable, AI-assisted pipeline. We propose leveraging a GenAI-powered semantic knowledge graph approach – using the open-source stack developed by Dinis Cruz (OSBot, MGraph, MyFeeds.ai) – to automate the ingestion, tagging, and summarization of content for client-specific newsletters.

In this approach, source documents (e.g. financial regulations, compliance updates, industry news) are converted into structured knowledge graphs using large language models (LLMs), which capture key entities and their relationships. Simultaneously, a semantic profile graph is generated for each client or persona, representing their interests (e.g. a client’s focus areas or a role-based profile like “CFO” or “Regulatory Analyst”).

The system then matches content graphs to persona graphs to identify the most relevant updates and uses an LLM to generate tailored summaries for each reader. Crucially, every step produces structured, traceable data rather than opaque text, providing a clear provenance trail for why each article was selected.

The entire pipeline runs on a serverless architecture for elasticity and easy integration, with human experts in the loop to curate ontologies and approve final outputs.

This proposal outlines the problem with the current workflow, details the GenAI+Graph solution architecture, and provides an implementation plan for integrating these open-source tools into Company X’s operations.

Problem Statement

Company X’s current workflow for producing personalized news feeds is heavily manual. Human analysts must gather relevant documents (financial reports, compliance notices, regulatory rulings, industry news articles), manually tag each with topics, and write summaries for different clients. While this human-driven approach can ensure quality, it suffers from several limitations:

In summary, the manual workflow is time-consuming, difficult to scale, and lacks transparency. It limits Company X’s ability to rapidly onboard more content sources or clients. The current system also makes it hard to ensure each client’s feed is both comprehensive and precisely tuned to their needs. We need a solution that automates the heavy lifting of content processing and tagging, provides fine-grained personalization, and builds trust through explainability – all while keeping human experts in control of the curation.

Solution Overview

We propose a Generative AI and Semantic Knowledge Graph solution that automates the personalized feed generation process. The solution will ingest raw source materials and transform them through a multi-stage pipeline, mirroring the workflow proven in Dinis Cruz’s Cyber Boardroom and MyFeeds.ai projects (which deliver personalized cybersecurity news feeds). The key idea is to represent both content and user profiles as graphs of semantic data, and use LLMs to bridge and summarize these graphs. Below, we outline the architecture and data flow:

1. Source Ingestion and Persistent Storage: All relevant source documents – including compliance documents, policy updates, regulatory rulings, news articles, RSS feeds, etc. – are ingested into a unified storage system. For example, an ingestion script (triggered automatically or by schedule) will fetch new items from RSS feeds or file repositories. Using the OSBot framework, this can be implemented as a serverless function (AWS Lambda) that gathers new content and saves it to an S3 bucket or database, with a timestamped folder structure for versioning. This persistent storage of raw data ensures we keep historical snapshots, enabling comparisons like “what changed since last week” (a capability already used to diff RSS feed snapshots in MyFeeds.ai). Storing raw content and intermediate results is important for traceability and re-processing if needed.

2. Transformation to Structured JSON (Content Graph Creation): Each ingested document is converted into a machine-readable JSON representation of its key points, using a large language model. In practice, an LLM (such as GPT-4 via API) is prompted to extract the entities (people, organizations, topics, etc.) and their relationships from the document’s text. We use OpenAI’s structured output mechanisms to have the LLM return a JSON object following a predefined schema (using Python classes or JSON schema). For example, for a news article, the LLM would identify entities like “Federal Reserve”, “interest rates”, “inflation” and relations such as Federal Reserve -> raises -> interest rates. This step essentially encodes the who/what/how of the source material into a knowledge graph data structure. Each document’s JSON graph is stored (e.g. as article_id.json) in persistent storage.

3. Ontology and Taxonomy Generation: In parallel with extracting content, the system can also generate or apply a domain-specific ontology – essentially the schema of entity types and relationships relevant to Company X’s use case. In the initial phase, we might let the LLM freely choose relationships (as was done in the first MyFeeds MVP), which already produces useful results. However, to ensure consistency (e.g. always tag “GDPR” as a Regulation type, or link “Central Bank” to “Financial Authority” category), we will incorporate a predefined taxonomy of terms or allow the LLM to assist in building one. This is where humans provide oversight: domain experts at Company X can review the initial set of entity types/relations the LLM produced and fine-tune the ontology by defining standard categories. The LLM can then be guided to use this ontology in subsequent runs (for example, by providing it in the prompt or as few-shot examples). Over time, this ontology will evolve – with human-in-the-loop feedback ensuring it stays accurate. This approach mirrors the plan in MyFeeds.ai to move from free-form extraction to a “much more explicit set of entities and relationships” based on human feedback. A well-defined ontology will improve the quality of the graph and even reduce the need for an extra mapping step (since relevant connections could be found by simple graph traversal if entities share IDs or types).

4. Persona Profile Graphs (User Modeling): For each end-user or client who receives a newsletter, we construct a persona semantic graph representing their interests and context. In practice, Company X likely already segments clients by interests or industries (e.g. a client interested in “EU financial regulations” or a profile like “Tech Industry Investor”). We can take these profiles (in text form or as a list of interest keywords) and use an LLM to expand them into a richer graph of related concepts. For example, a persona description of “CFO at a fintech company” might yield a graph with nodes like “financial compliance”, “blockchain technology”, “start-up funding”, and edges linking these to broader topics like “regulatory compliance -> fintech”. This graph acts as a semantic fingerprint of the user’s interests. Like the content graphs, persona graphs are stored as JSON. They can be partly predefined (and even edited by analysts to accurately reflect the client) and partly generated by the LLM to include hidden connections an expert might not list explicitly. (Notably, this can surface non-obvious interests; e.g., if a client follows AI in finance, the persona graph might include related terms like “algorithmic trading” even if the client didn’t explicitly say so, because the LLM infers a relevant link). These persona graphs will be updated as client interests change or can remain static per client until edited.

5. Relevance Mapping (Matching Articles to Personas): With a content knowledge graph and a persona graph, the system’s next job is to determine which content pieces are relevant to which persona and why. This is accomplished by another LLM-driven step that compares the two graphs for overlaps. Essentially, we prompt the LLM with the persona graph and an article’s graph and ask it to find intersections – answering the question: “Which entities or topics in this article align with the persona’s interests?”. The output is a structured JSON listing the specific matches and possibly a relevance score. For example, the LLM might output that Article X mentions “Basel III” which appears in the persona graph for a banking client, and “cybersecurity” which also appears, giving the article an 8.5/10 relevance score for that client. This stage effectively links the article to the persona via common nodes (entities) and provides the rationale for selection. Articles with no meaningful overlap will be filtered out, while those with several connections bubble up as top recommendations for that persona. All these mapping results are stored, building a provenance trail that we can later use to justify each recommendation (“we included this news because it connects to 3 topics you care about, X, Y, and Z”). If a strong ontology is in place, some of this mapping could be done with direct graph algorithms (e.g. checking for intersecting nodes), but using an LLM allows flexibility with synonyms and context (the LLM can recognize that “data protection” in an article is related to “privacy compliance” in the persona graph even if wording differs).

6. Personalised Summary Generation: In the final step for each piece of relevant content, the system generates a tailored summary or write-up for inclusion in the newsletter, addressing the persona’s perspective. Here we leverage the LLM one more time: it is prompted with (a) the original article text or key excerpts, and (b) the list of persona-specific relevant points from the previous step. The prompt is crafted to instruct the LLM to “Write a brief summary of this article for [Persona X], focusing on the aspects that matter to them.” Because we also feed in the structured connections (e.g. Article mentions GDPR and Persona is interested in data privacy), the LLM can explicitly tailor the summary to highlight those aspects. The output can be a short paragraph or a set of bullet points ready to go into the newsletter. We will enforce a structured format here as well – for example, the LLM could output a JSON with fields like headline, summary_paragraph, key_points, which we then render into final text. Having a structured output ensures the summary stays on task and we can easily concatenate multiple summaries consistently. Hallucinations are minimized because the LLM isn’t asked an open-ended question; it’s grounded in the article’s content and the known relevant facts (so it won’t introduce outside information). This step was demonstrated in MyFeeds.ai’s pipeline, where the LLM produced a JSON object for the personalised post, which was then converted to HTML/Markdown for publishing.

7. Assembly and Publishing: Once summaries are generated, the system compiles the personalized newsletter. This could be an automated email or a page on a portal. In Dinis Cruz’s implementation, the content was ultimately published to a Ghost CMS site via its API. For Company X, we might integrate with whatever delivery mechanism is in place (e.g. an email templating system or a web dashboard). The output for each client persona is essentially a curated list of summaries (with links to full sources) that the pipeline has determined to be most relevant for that period. Every piece of content in the newsletter can carry a tooltip or link to the explanation (provenance) of why it was included, drawn from the mapping step data. For internal use, each summary can be accompanied by the debug info: the underlying graphs and matching nodes, so editors can quickly verify the reasoning if needed.

Technical Architecture: The entire workflow above is orchestrated in a serverless, modular pipeline. We will use OSBot-FastAPI to set up the logic as a set of cloud functions (each major step can be an API endpoint or Lambda function). OSBot provides a scaffold to define these flows and deploy easily, with utilities for common tasks. For example, there will be endpoints like /ingest-feed, /extract-entities, /build-persona, /match-graphs, /generate-summary corresponding to the stages. These can be composed into a sequence (potentially managed by OSBot-Utils’ Flow system, which is inspired by Prefect’s workflow engine). Because it’s serverless, each step can scale independently – if a surge of new documents arrives, multiple Lambdas can run extraction in parallel. The stateless nature of Lambda is handled by our use of persistent storage (S3/DB) for passing data from one step to the next (one function writes the JSON output, the next reads it). We emphasize an API-first design, where each stage’s output is available via API for monitoring or integration. This aligns with an “API-first architecture” for content and semantic operations, which enables flexible integration and reuse of the data. For instance, internal tools could query the knowledge graph API to find all clients interested in a given topic whenever a breaking news alert comes in.

Determinism and Explainability: By breaking the process into discrete, JSON-mediated steps, we ensure a degree of deterministic behavior and transparency in an otherwise complex AI pipeline. Every intermediate result (extracted entities, persona interests, mappings, scores) is saved and auditable, forming a complete narrative of how raw input became a newsletter output. This design means that given the same inputs, the system will follow the same decision path, and any variation (like an LLM wording difference) is confined and detectable (e.g. if an LLM ever produces malformed JSON, the system flags it). The use of structured outputs at each LLM step yields more consistent results and allows validation – if a field is missing, we know the AI deviated and we can correct it. In short, the solution treats LLMs not as a black box that magically goes from documents to newsletter, but as co-pilots for well-defined tasks, each constrained by schema. This yields a high level of explainability: we can explain exactly why each article was selected (because we have the list of matching entities as evidence), and we can trace how the summary was formed (since it’s based on identified relevant points). This focus on provenance and determinism has been noted as a key to building trust in AI-driven content systems.

Role of Human Oversight: It’s important to stress that this GenAI-powered system augments human analysts, rather than replacing them. Human expertise remains in the loop in several ways: (a) Curation and Ontology tuning: Experts will review the automatically extracted knowledge graphs and refine them. For example, if the LLM tags a concept incorrectly or uses an inconsistent name, analysts can correct the taxonomy. These corrections can be fed back to improve the prompts or even hard-coded as rules in MGraph (e.g. merge equivalent nodes, enforce that “UK” and “United Kingdom” are the same entity). The system is designed to learn from these adjustments over time, resulting in an evolving “expert-approved” knowledge graph of the domain. (b) Approval of Outputs: Especially during initial deployment, the content team might want to review the generated summaries before they go out to clients. The pipeline can output draft newsletters to an internal dashboard where a human reviewer quickly scans each item’s summary and rationale. They can then approve, or in rare cases tweak the wording or remove an item. Because the summaries are backed by source content and graphs, an editor can trust that the factual content is from the source (minimizing fact-check needs, since we avoid hallucination). This review step ensures nothing sensitive or inappropriate is sent to clients and that the tone meets Company X’s standards. (c) Feedback loop: Over time, feedback from readers or analysts (e.g. “client A found this article irrelevant”) can be analyzed. If a mismatch occurs, it might indicate the persona profile needs updating or the mapping threshold for relevance should be adjusted. Humans will guide these strategic adjustments to continuously improve personalization accuracy. Ultimately, the system will handle the heavy lifting of processing and matching, freeing the human analysts to focus on higher-level quality control and relationship management with clients, rather than rote data processing.

By implementing this solution, Company X will gain a cutting-edge platform for personalized information delivery – one that is AI-driven yet human-guided, scalable yet explainable. The same workflow principles that have been applied in Cyber Boardroom and NewsFeeds.ai (for cybersecurity content) will be adapted to Company X’s domain, demonstrating a strong continuity with proven techniques. Next, we outline a practical implementation plan, including phases and technical integration steps, to bring this solution to life.

Implementation Plan

Implementing this solution will be an iterative process. We will start with a pilot project focusing on a subset of content and a couple of persona profiles to validate the approach, then expand coverage and functionality. The following plan is proposed:

Phase 1: Setup Core Infrastructure and Pilot:

Each of these functions will be available via the API and also callable as an orchestrated flow for a given new article. At this stage, we will run them manually in sequence (or write a small script to simulate the pipeline) to verify each piece works.

Phase 2: Scale Up Sources and Automation:

Phase 3: Integration and Rollout:

Leveraging Open-Source Tools and Existing Work: Throughout implementation, we will heavily reference Dinis Cruz’s published work and repositories. The MyFeeds.ai project code (available on GitHub at the-cyber-boardroom and owasp-sbot repos) provides a baseline for many components. We can reuse and adapt code for the LLM prompts, the JSON schemas for entities, and the integration with MGraph. This jump-starts development and grounds our solution in a proven architecture rather than starting from scratch. The OSBot framework itself is open-source and well-suited to our needs, reducing custom development of deployment and API scaffolding. In essence, Company X’s internal team will be standing on the shoulders of these open tools – gaining a solution that is cutting-edge yet already tested in analogous scenarios. There is no proprietary lock-in; the stack runs in Company X’s cloud and the knowledge graphs and data remain fully under Company X’s control.

By following this implementation plan, within months Company X can have an automated, scalable personalized news feed system in production. This system will dramatically reduce the manual effort required to serve each client, allow the company to scale up the number of sources and clients it can handle, and enhance the value delivered to clients through deeper personalization and clear explanations for each included item. Crucially, the solution is built with transparency and human governance in mind – aligning with the trust and reliability expectations in financial and regulatory domains. Together, GenAI and semantic graphs will enable Company X to maintain its competitive edge in delivering timely, relevant information to clients, while controlling the process and intellectual property through open-source innovation.

📚 References

The following resources were used to inform the architecture, methodology, and technical strategy outlined in the Project InsightFlow proposal. These references include prior open-source implementations, foundational concepts on semantic knowledge graphs, and practical insights into LLM-driven workflows for personalized content delivery.

  1. Semantic Knowledge Graphs (Research Overview) Provided the conceptual and technical basis for building memory-first, ontology-driven knowledge graphs using the MGraph framework.

  2. How Semantic News Feeds Work (Blog Series) Detailed walkthroughs of the GenAI + Graph-based feed generation pipeline, including architecture design, persona modeling, triplet extraction, and LLM integration.

  3. Presentation: Leveraging GenAI & Graphs to Customise and Scale Security Knowledge Served as a high-level summary of the overall vision and the impact of combining LLMs with semantic graphs to create explainable, client-specific intelligence products.

  4. MyFeeds.ai Source Code (GitHub) Reference implementation of the end-to-end semantic feed pipeline, demonstrating serverless ingestion, ontology/taxonomy generation, and LLM-based summarization.

  5. OSBot-Fast-API Used as the technical foundation for implementing modular, event-driven APIs to support ingestion, processing, and publication workflows.

  6. MGraph: Memory-First Graph DB and Ontology Engine Core engine for representing, merging, and querying JSON-based knowledge graphs, central to the graph-driven personalization and provenance tracking logic.

  7. CyberBoardroom Project (Graph-Based Security Intelligence) Demonstrated prior successful use of similar techniques in cybersecurity domains, reinforcing the generalizability of the approach to regulatory/financial content.

  8. OSBot Utils / Prefect-Inspired Workflow Engine Provided workflow orchestration patterns (Flows, Tasks) to sequence the graph processing stages with visibility and modularity.

Released under CC BY 4.0. First published on docs.diniscruz.ai; this page as markdown.