Skip to content

Flow1 kb draft ai integration - #1879

Draft
shivamnit123 wants to merge 5 commits into
wso2-open-operations:dev-app-csm-portalfrom
shivamnit123:flow1-kb-draft-ai-integration
Draft

shivamnit123 wants to merge 5 commits into
wso2-open-operations:dev-app-csm-portalfrom
shivamnit123:flow1-kb-draft-ai-integration

Conversation

@shivamnit123

Copy link
Copy Markdown

Purpose

Add the first automated KB-generation flow: when a support case closes, automatically draft a knowledge base article from its comments using AI. This is a draft PR specifically for Rashmika to review the Kafka implementation approach before deciding how Flow 2 (article-published → embedding) should be wired up.

Goals

  1. Automatically generate a KB article draft whenever a case is closed, without any manual step
  2. Reuse existing Kafka infrastructure rather than adding anything new
  3. Handle long cases (50+ comments) without losing any comment content

Approach

  1. New kbdraftengine package listens on the existing case-events Kafka topic, filtering for case-closed events — no new topic or event type needed
  2. On trigger: fetches all the case's comments (paginated), sends them to Azure OpenAI to generate a draft article, then saves it via entity-service
  3. For cases with more than 50 comments: summarizes comments in batches first, then generates the article from the combined summaries, so nothing gets dropped
  4. Included a small test tool (cmd/testpublisher) used to manually verify the flow end-to-end against real data

User stories

Summary of user stories addressed by this change>

Release note

Brief description of the new feature or bug fix as it will appear in the release notes

Documentation

Link(s) to product documentation that addresses the changes of this PR. If no doc impact, enter �N/A� plus brief explanation of why there�s no doc impact

Training

Link to the PR for changes to the training content in https://github.com/wso2/WSO2-Training, if applicable

Certification

Type �Sent� when you have provided new/updated certification questions, plus four answers for each question (correct answer highlighted in bold), based on this change. Certification questions/answers should be sent to certification@wso2.com and NOT pasted in this PR. If there is no impact on certification exams, type �N/A� and explain why.

Marketing

Link to drafts of marketing content that will describe and promote this feature, including product page changes, technical articles, blog posts, videos, etc., if applicable

Automation tests

  • Unit tests

    Code coverage information

  • Integration tests

    Details about the test cases and coverage

Security checks

Samples

Provide high-level details about the samples related to this feature

Related PRs

List any other related PRs

Migrations (if applicable)

Describe migration steps and platforms on which migration has been tested

Test environment

List all JDK versions, operating systems, databases, and browser/versions on which this feature/fix was tested

Learning

Describe the research phase and any blog posts, patterns, libraries, or add-ons you used to solve the problem.

…webapp)

- Full article lifecycle: draft, submit, approve/reject, publish, retire
- Knowledge base CRUD, approver management, deactivation enforcement
- 3-tab review workflow (All/To Review/My) + Admin panel
- Version history with inline and side-by-side diff comparison
- Multi-select filtering (knowledge base, status, author, team)

NOTE: migrations 000014-000019 are NOT yet applied to any shared
environment. Per discussion with Sajith, these wait until the
knowledge_bases/kb_articles schema is aligned with the ongoing
ServiceNow data migration.
…-csm-portal

# Conflicts:
#	apps/csm-portal/backend/internal/entity/customer.go
#	apps/csm-portal/webapp/src/App.tsx
#	apps/csm-portal/webapp/src/config/csmNavItems.ts
@coderabbitai

coderabbitai Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@shivamnit123
shivamnit123 marked this pull request as draft September 21, 2026 10:47
@shivamnit123
shivamnit123 changed the base branch from main to dev-app-csm-portal September 21, 2026 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants