Skip to content

feat: Remove chat feature from OmniPDF#207

Merged
NotYuSheng merged 7 commits into
devfrom
feat/remove-chat-feature
Sep 30, 2025
Merged

feat: Remove chat feature from OmniPDF#207
NotYuSheng merged 7 commits into
devfrom
feat/remove-chat-feature

Conversation

@NotYuSheng

@NotYuSheng NotYuSheng commented Sep 30, 2025

Copy link
Copy Markdown
Owner

User description

Summary

The chat feature was not performing well and has been removed from the codebase. This PR cleans up all related code, configuration, documentation, and infrastructure components.


Changes Made

  • Removed chat_service directory (18 files including Dockerfile, routes, models, tests)
  • Removed helm/chat-service Helm chart (14 files)
  • Removed chat routes and models from pdf_processor_service
  • Removed chat UI page (frontend/my_pages/5_chat_UI.py)
  • Removed semantic embedder workflow from pdf_processor_service (kept sentence embedder for metadata)
  • Updated docker-compose.yml to remove chat_service container
  • Updated all Helm network policies to remove chat-service egress/ingress rules
  • Updated RBAC configuration to remove chat-service role and permissions
  • Updated Istio gateway configuration to remove chat-service ServiceEntry
  • Updated test scripts (test-all-services.sh, test-single-service.sh)
  • Updated security scanning script (scan_with_trivy.sh)
  • Updated deployment script (deploy-helm-charts.sh)
  • Updated documentation (CLAUDE.md, README.md, C4 diagram, network policy reference, secret management docs, etc.)
  • Removed Trivy scan results for chat_service

Context / Rationale

The chat feature was experimental and not meeting quality standards. Rather than continue iterating on it, we've decided to remove it entirely and focus on the core PDF processing features. A version with chat is tagged for future reference if we decide to revisit this functionality.

Statistics Updated:

  • Services: 14 → 13
  • Tests: 206+ → 180+ (across 7 → 6 services)
  • RBAC roles: 14 → 13
  • HPA services: 9 → 8

This is a refactor/cleanup to improve codebase maintainability and reduce complexity.


Related Docs or References

  • Updated C4 architecture diagram (c4-diagram.puml)
  • Network policy reference documentation
  • RBAC documentation
  • All service count statistics in README.md and CLAUDE.md

FastAPI Application Checklist (Delete if PR is not relevant)

N/A - This PR removes a service rather than adding/modifying FastAPI endpoints.


General Checklist

  • I have tested these changes locally (verified all references removed via grep)
  • I have updated relevant documentation or added comments where needed
  • I have linked relevant issues and tagged reviewers
  • I have followed coding conventions and naming standards
  • All Python files are syntactically valid
  • All YAML files are valid
  • Docker Compose configuration is valid (13 services)
  • Helm charts are valid (15 charts, no chat-service)

PR Type

Other


Description

  • Remove chat service and all related components

  • Update network policies and RBAC configurations

  • Clean up documentation and deployment scripts

  • Remove semantic embedder workflow from processing


Diagram Walkthrough

flowchart LR
  A["Chat Service"] -- "removed" --> B["Deleted Components"]
  C["PDF Processor"] -- "simplified" --> D["Basic Processing Only"]
  E["Network Policies"] -- "updated" --> F["13 Services"]
  G["RBAC"] -- "reduced" --> H["13 Roles"]
Loading

File Walkthrough

Relevant files
Configuration changes
6 files
main.py
Remove chat URL environment variable                                         
+1/-9     
deploy-helm-charts.sh
Remove chat-service from deployment list                                 
+6/-7     
create-secrets.sh
Remove chat-service secret creation logic                               
+2/-4     
scan_with_trivy.sh
Remove chat_service from scan list                                             
+1/-2     
test-all-services.sh
Remove chat_service from test list                                             
+1/-2     
example.env
Update example API endpoint configuration                               
+2/-2     
Enhancement
2 files
process.py
Remove semantic embedder workflow                                               
+2/-9     
main.py
Remove chat router import                                                               
+1/-2     
Documentation
11 files
load-images.sh
Update example commands without chat service                         
+5/-5     
README.md
Update architecture and service counts                                     
+20/-21 
SECRET-MANAGEMENT.md
Update examples without chat-service references                   
+25/-25 
LOCAL_IMAGE_REPOSITORY.md
Replace chat service examples with extraction service       
+21/-21 
c4-diagram.puml
Remove chat service from architecture diagram                       
+2/-8     
README.md
Update service counts and examples                                             
+18/-18 
Makefile
Update examples without chat-service references                   
+6/-6     
README.md
Update RBAC documentation for 13 services                               
+9/-12   
NETWORK-POLICY-REFERENCE.md
Remove chat-service from network policy examples                 
+4/-4     
INSTALL.md
Update deployment examples without chat service                   
+2/-2     
Chart.yaml
Remove chat reference from description                                     
+1/-1     
Additional files
53 files
services-to-build.txt +0/-1     
Dockerfile +0/-36   
example.env +0/-23   
main.py +0/-19   
__init__.py [link]   
chat.py +0/-25   
rag_config.py +0/-569 
requirements.txt +0/-8     
__init__.py [link]   
chat.py +0/-385 
health.py +0/-8     
__init__.py +0/-1     
conftest.py +0/-45   
test_chat.py +0/-300 
test_models.py +0/-79   
docker-compose.yml +0/-10   
process_pdf.py +0/-1     
example.env +0/-1     
10_settings_UI.py +0/-9     
5_chat_UI.py +0/-250 
Chart.yaml +0/-18   
NOTES.txt +0/-61   
_helpers.tpl +0/-73   
deployment.yaml +0/-92   
hpa.yaml +0/-32   
networkpolicy.yaml +0/-66   
poddisruptionbudget.yaml +0/-23   
service.yaml +0/-15   
serviceaccount.yaml +0/-13   
servicemonitor.yaml +0/-41   
test-connection.yaml +0/-15   
values-prestaging.yaml +0/-104 
values-prod.yaml [link]   
values-staging.yaml [link]   
values.yaml +0/-122 
values-prestaging.yaml +0/-4     
values.yaml +0/-4     
images.txt +0/-1     
values-prestaging.yaml +0/-4     
values.yaml +0/-4     
values-prestaging.yaml +0/-4     
values.yaml +0/-4     
values-prestaging.yaml +0/-5     
values.yaml +0/-5     
values.yaml +0/-12   
values-prestaging.yaml +0/-4     
values.yaml +0/-4     
example.env +0/-1     
example.env +0/-1     
chat.py +0/-23   
chat.py +0/-38   
test-single-service.sh +0/-1     
chat_service-report.txt +0/-371 

@codiumai-pr-agent-free

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Incomplete Refactoring

The wait_for_semantic_embedder function was removed but there might be references to it elsewhere in the codebase that weren't updated, potentially causing runtime errors.

async def process_file_basic(doc_id: str, session_id: str):
    await wait_for_extraction(doc_id)
    await wait_for_sentence_embedder(doc_id, session_id)
    await wait_for_metadata(doc_id, session_id)
    logger.info(f"Completed basic Processing for {doc_id}")
CSS Class Renaming

The CSS class 'chat-container' was renamed to 'message-container' but existing references to this class in other components might not have been updated.

.message-container {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 10px;
    margin: 0.5rem 0;

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @NotYuSheng, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on a significant refactor to remove the experimental chat feature from OmniPDF. The decision was made due to the feature not meeting quality standards, allowing the project to concentrate on its core PDF processing capabilities. The changes involve a comprehensive cleanup across the entire stack, from application code and UI to infrastructure configurations and documentation, resulting in a leaner and more maintainable system.

Highlights

  • Complete Removal of Chat Feature: The experimental chat feature, including its dedicated chat_service microservice, Helm chart, UI components, and all related code, configuration, and documentation, has been entirely removed from the codebase. This encompasses 18 files from the chat_service directory and 14 files from its Helm chart.
  • Infrastructure and Configuration Updates: All infrastructure-as-code components have been updated to reflect the removal of the chat service. This includes modifications to docker-compose.yml, Helm network policies, RBAC configurations, and Istio gateway settings. Test scripts and security scanning scripts were also adjusted.
  • Streamlined PDF Processing Workflow: The pdf_processor_service has been updated to remove dependencies on the chat service. Specifically, the semantic embedder workflow, which was primarily used for the chat feature, has been removed, while the sentence embedder remains for metadata generation.
  • Reduced Complexity and Improved Maintainability: The removal of the chat feature has led to a reduction in overall system complexity. Key statistics updated in the documentation show a decrease from 14 to 13 services, 206+ to 180+ tests, 14 to 13 RBAC roles, and 9 to 8 HPA services, improving codebase maintainability.
  • Documentation and UI Cleanup: The README.md, c4-diagram.puml, network policy reference, and secret management documentation have been updated to accurately reflect the current architecture without the chat feature. The frontend UI (frontend/my_pages/5_chat_UI.py) and associated navigation elements have also been removed.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@codiumai-pr-agent-free

codiumai-pr-agent-free Bot commented Sep 30, 2025

Copy link
Copy Markdown

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Security
Remove hardcoded API key

Replace the hardcoded example API key in image_captioner_service/example.env
with a placeholder like your-api-key-here to improve security practices.

image_captioner_service/example.env [1-8]

 # Vision Language Model Configuration
 OPENAI_BASE_URL=http://100.64.0.1/vllm_Qwen2.5-VL-7B-Instruct/v1 # Please change this to your LLM Server URL endpoint
 OPENAI_VLM=Qwen2.5-VL-7B-Instruct
-OPENAI_API_KEY=token-abc123
+OPENAI_API_KEY=your-api-key-here
 MODEL_TEMPERATURE=0.1
 MODEL_MAX_TOKENS=2000
 MODEL_TOP_P=0.8

[To ensure code accuracy, apply this suggestion manually]

Suggestion importance[1-10]: 7

__

Why: The suggestion correctly identifies a hardcoded example API key and recommends replacing it with a placeholder, which is a good security practice for example configuration files.

Medium
Possible issue
Remove duplicate service from loop
Suggestion Impact:The commit removed the duplicate pdf-extraction-service entry from the for loop as suggested, which would prevent deployment errors from occurring due to trying to deploy the same service twice.

code diff:

-for service in frontend pdf-processor-service pdf-extraction-service embedder-service chromadb redis minio cleaner pdf-extraction-service docling-translation-service pdf-renderer-service image-captioner-service metadata-service; do
+for service in frontend pdf-processor-service pdf-extraction-service embedder-service chromadb redis minio cleaner docling-translation-service pdf-renderer-service image-captioner-service metadata-service; do

Remove the duplicate pdf-extraction-service entry from the for loop in the
deployment script to prevent deployment errors.

helm/istio-gateway/INSTALL.md [58-63]

 # Deploy services with prestaging values (includes sidecar injection)
-for service in frontend pdf-processor-service pdf-extraction-service embedder-service chromadb redis minio cleaner pdf-extraction-service docling-translation-service pdf-renderer-service image-captioner-service metadata-service; do
+for service in frontend pdf-processor-service embedder-service chromadb redis minio cleaner pdf-extraction-service docling-translation-service pdf-renderer-service image-captioner-service metadata-service; do
   echo "Deploying $service with Istio sidecar..."
   helm install $service ./helm/$service \
     --namespace omnipdf-prestaging \
     --values ./helm/$service/values-prestaging.yaml

[Suggestion processed]

Suggestion importance[1-10]: 6

__

Why: The suggestion correctly identifies a duplicate service in a deployment loop, which would cause the script to fail, and proposes the correct fix.

Low
  • Update

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request does an excellent job of removing the chat feature and its related components from the codebase. The cleanup is extensive, covering application code, configuration, infrastructure definitions, CI/CD scripts, and documentation. The changes are consistent with the goal of excising the feature entirely. I've found a few minor inconsistencies in the documentation files that seem to be leftovers from the refactoring, which I've pointed out in the specific comments. Overall, this is a solid cleanup effort that improves the maintainability of the project.

Comment thread helm/NETWORK-POLICY-REFERENCE.md
Comment thread helm/SECRET-MANAGEMENT.md Outdated
Comment thread helm/istio-gateway/INSTALL.md Outdated
Comment thread helm/rbac/README.md
Comment thread scripts/README.md Outdated
@NotYuSheng

Copy link
Copy Markdown
Owner Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request does an excellent job of removing the chat feature and all its related components from the codebase. The cleanup is comprehensive, covering service code, Helm charts, documentation, and CI/CD scripts. The changes significantly reduce the complexity of the project and improve maintainability.

My review focuses on further enhancing the maintainability of the automation scripts, which currently rely on hardcoded service lists. By making these scripts more dynamic, they will be more resilient to future changes. I've added a few suggestions to refactor these scripts for better long-term maintenance.

@NotYuSheng NotYuSheng left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewed

@NotYuSheng NotYuSheng merged commit d3efb38 into dev Sep 30, 2025
4 checks passed
@NotYuSheng NotYuSheng deleted the feat/remove-chat-feature branch September 30, 2025 03:27
@NotYuSheng NotYuSheng restored the feat/remove-chat-feature branch September 30, 2025 03:37
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.

1 participant