[PR #7880] [MERGED] chore: refactor local ai #8183

Closed
opened 2026-03-23 23:22:59 +00:00 by mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/AppFlowy-IO/AppFlowy/pull/7880
Author: @appflowy
Created: 5/5/2025
Status: Merged
Merged: 5/5/2025
Merged by: @appflowy

Base: mainHead: local_chat3


📝 Commits (2)

📊 Changes

61 files changed (+5145 additions, -823 deletions)

View changed files

📝 .github/workflows/rust_ci.yaml (+1 -1)
📝 frontend/appflowy_flutter/lib/ai/service/ai_model_state_notifier.dart (+1 -6)
📝 frontend/appflowy_flutter/lib/workspace/application/settings/ai/local_ai_bloc.dart (+5 -7)
📝 frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/setting_ai_view/plugin_status_indicator.dart (+6 -76)
📝 frontend/appflowy_flutter/macos/Podfile.lock (+22 -22)
📝 frontend/rust-lib/Cargo.lock (+798 -91)
📝 frontend/rust-lib/Cargo.toml (+7 -4)
📝 frontend/rust-lib/flowy-ai-pub/src/cloud.rs (+2 -2)
📝 frontend/rust-lib/flowy-ai-pub/src/entities.rs (+3 -1)
📝 frontend/rust-lib/flowy-ai-pub/src/persistence/chat_message_sql.rs (+14 -0)
📝 frontend/rust-lib/flowy-ai/Cargo.toml (+16 -2)
📝 frontend/rust-lib/flowy-ai/src/ai_manager.rs (+22 -26)
frontend/rust-lib/flowy-ai/src/ai_tool/markdown.rs (+32 -0)
frontend/rust-lib/flowy-ai/src/ai_tool/mod.rs (+2 -0)
frontend/rust-lib/flowy-ai/src/ai_tool/pdf.rs (+31 -0)
📝 frontend/rust-lib/flowy-ai/src/chat.rs (+1 -2)
📝 frontend/rust-lib/flowy-ai/src/completion.rs (+4 -4)
📝 frontend/rust-lib/flowy-ai/src/embeddings/context.rs (+4 -0)
📝 frontend/rust-lib/flowy-ai/src/embeddings/document_indexer.rs (+4 -4)
📝 frontend/rust-lib/flowy-ai/src/embeddings/mod.rs (+2 -1)

...and 41 more files

📄 Description

Feature Preview


PR Checklist

  • My code adheres to AppFlowy's Conventions
  • I've listed at least one issue that this PR fixes in the description above.
  • I've added a test(s) to validate changes in this PR, or this PR only contains semantic changes.
  • All existing tests are passing.

Summary by Sourcery

Refactor the local AI implementation to improve modularity, add new features, and enhance the overall architecture of the AI components in the AppFlowy project.

New Features:

  • Implemented a more flexible and modular local AI chat system
  • Added support for conversational retrieval with RAG (Retrieval Augmented Generation)
  • Introduced new AI tools for processing markdown and PDF files
  • Enhanced database-related AI functionalities like translation and summarization

Enhancements:

  • Restructured local AI controller to use a more flexible chat and completion architecture
  • Improved stream processing for AI responses
  • Added more robust error handling and logging
  • Implemented a more generic approach to handling different AI completion types

Chores:

  • Refactored code to improve separation of concerns
  • Removed deprecated and redundant code
  • Updated dependencies and added new crate features

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/AppFlowy-IO/AppFlowy/pull/7880 **Author:** [@appflowy](https://github.com/appflowy) **Created:** 5/5/2025 **Status:** ✅ Merged **Merged:** 5/5/2025 **Merged by:** [@appflowy](https://github.com/appflowy) **Base:** `main` ← **Head:** `local_chat3` --- ### 📝 Commits (2) - [`ed809c9`](https://github.com/AppFlowy-IO/AppFlowy/commit/ed809c95fefbbd19c5e3c541bfca54d2949a9394) chore: refactor local ai - [`f5ad7a8`](https://github.com/AppFlowy-IO/AppFlowy/commit/f5ad7a88ca053896375335c674766cb600e14535) chore: ios build ### 📊 Changes **61 files changed** (+5145 additions, -823 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/rust_ci.yaml` (+1 -1) 📝 `frontend/appflowy_flutter/lib/ai/service/ai_model_state_notifier.dart` (+1 -6) 📝 `frontend/appflowy_flutter/lib/workspace/application/settings/ai/local_ai_bloc.dart` (+5 -7) 📝 `frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/setting_ai_view/plugin_status_indicator.dart` (+6 -76) 📝 `frontend/appflowy_flutter/macos/Podfile.lock` (+22 -22) 📝 `frontend/rust-lib/Cargo.lock` (+798 -91) 📝 `frontend/rust-lib/Cargo.toml` (+7 -4) 📝 `frontend/rust-lib/flowy-ai-pub/src/cloud.rs` (+2 -2) 📝 `frontend/rust-lib/flowy-ai-pub/src/entities.rs` (+3 -1) 📝 `frontend/rust-lib/flowy-ai-pub/src/persistence/chat_message_sql.rs` (+14 -0) 📝 `frontend/rust-lib/flowy-ai/Cargo.toml` (+16 -2) 📝 `frontend/rust-lib/flowy-ai/src/ai_manager.rs` (+22 -26) ➕ `frontend/rust-lib/flowy-ai/src/ai_tool/markdown.rs` (+32 -0) ➕ `frontend/rust-lib/flowy-ai/src/ai_tool/mod.rs` (+2 -0) ➕ `frontend/rust-lib/flowy-ai/src/ai_tool/pdf.rs` (+31 -0) 📝 `frontend/rust-lib/flowy-ai/src/chat.rs` (+1 -2) 📝 `frontend/rust-lib/flowy-ai/src/completion.rs` (+4 -4) 📝 `frontend/rust-lib/flowy-ai/src/embeddings/context.rs` (+4 -0) 📝 `frontend/rust-lib/flowy-ai/src/embeddings/document_indexer.rs` (+4 -4) 📝 `frontend/rust-lib/flowy-ai/src/embeddings/mod.rs` (+2 -1) _...and 41 more files_ </details> ### 📄 Description <!--- Thank you for submitting a pull request to AppFlowy. The team will dedicate their best efforts to reviewing and approving your pull request. If you have any questions about the project or feedback for us, please join our [Discord](https://discord.gg/wdjWUXXhtw). --> <!--- If your pull request adds a new feature, please drag and drop a video into this section to showcase what you've done! If not, you may delete this section. --> ### Feature Preview <!--- List at least one issue here that this PR addresses. If it fixes the issue, please use the [fixes](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests) keyword to close the issue. For example: fixes https://github.com/AppFlowy-IO/AppFlowy/pull/2106 --> --- <!--- Before you mark this PR ready for review, run through this checklist! --> #### PR Checklist - [ ] My code adheres to [AppFlowy's Conventions](https://docs.appflowy.io/docs/documentation/software-contributions/conventions) - [ ] I've listed at least one issue that this PR fixes in the description above. - [ ] I've added a test(s) to validate changes in this PR, or this PR only contains semantic changes. - [ ] All existing tests are passing. ## Summary by Sourcery Refactor the local AI implementation to improve modularity, add new features, and enhance the overall architecture of the AI components in the AppFlowy project. New Features: - Implemented a more flexible and modular local AI chat system - Added support for conversational retrieval with RAG (Retrieval Augmented Generation) - Introduced new AI tools for processing markdown and PDF files - Enhanced database-related AI functionalities like translation and summarization Enhancements: - Restructured local AI controller to use a more flexible chat and completion architecture - Improved stream processing for AI responses - Added more robust error handling and logging - Implemented a more generic approach to handling different AI completion types Chores: - Refactored code to improve separation of concerns - Removed deprecated and redundant code - Updated dependencies and added new crate features --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
mirror 2026-03-23 23:22:59 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AppFlowy-IO/AppFlowy#8183
No description provided.