Integrating local-first productivity with powerful LLM orchestration. This project embeds an AI Assistant directly into AppFlowy to automate database creation, data structuring, and workspace management.
The goal is to create a seamless AI-to-Workspace bridge where users can describe their data needs in natural language and have AppFlowy automatically configure the appropriate views, properties, and data structures locally.
- Local-First AI: All intelligence runs locally via Ollama, preserving privacy.
- Automated Structuring: Intelligent detection of property types (Text, Number, Checkbox, etc.).
- Clean Workspace: Automated cleanup of default boilerplate properties.
- Natural Interaction: A persistent AI overlay that understands workspace context.
The system is built on a decoupled architecture for maximum flexibility and local performance.
graph TD
User((User)) -->|Prompt| Flutter[AppFlowy Flutter Frontend]
Flutter -->|HTTP/JSON| FastAPI[Python AI Orchestrator]
FastAPI -->|LangChain| LLM[Ollama: gpt-oss:20b]
LLM -->|Parsed Action| FastAPI
FastAPI -->|Success/Error| Flutter
Flutter -->|Backend SDK| Rust[AppFlowy Rust Core]
Rust -->|Storage| DB[(Local Collab DB)]
- Frontend (Dart/Flutter): The user interface hosting the
AiChatOverlayandAiAgentClient. - Orchestrator (Python/FastAPI): A robust agent logic layer using LangChain to parse intent and resolve context.
- Engine (Rust): AppFlowy's high-performance core that handles CRDTs and data persistence.
- Implemented a non-blocking
AiChatOverlaywidget. - Created
AiAgentClientfor secure local communication with the orchestrator.
- Primary Field Mapping: Automatically renames the default "Name" field to "ID" for cleaner data modeling.
- Smart Cleanup: Automatically deletes default "Type" and "Done" columns upon AI creation.
- Prop Type Detection: Real-time detection of data types (e.g., "age" as number, "lead" as text).
- Duplicate Prevention: Resolved issues where "name" properties were incorrectly skipped.
- Improved database name extraction from various prompt formats.
- Migrated to
gpt-oss:20bfor superior reasoning capabilities. - Created parallel startup orchestration via
start.sh.
- Ollama: Download & Install
- Model: Pull the research model used:
ollama pull gpt-oss:20b
Clone the repository and run the setup:
# Install Python dependencies
python3 -m venv venv
source venv/bin/activate
pip install -r agent/requirements.txt
# Fetch Flutter dependencies
cd appflowy/frontend/appflowy_flutter
flutter pub getLaunch both the AI service and the AppFlowy application with a single command:
./start.sh| Directory | Description |
|---|---|
agent/ |
Python FastAPI Orchestrator & LLM Logic |
appflowy/ |
Core AppFlowy source code (Rust + Flutter) |
appflowy_flutter/ |
Main frontend application |
lib/ai/ |
Dart implementation of AI Agent client and handlers |
Tip
Try this prompt: "Create a CRM database with name, company, email, and deal_value properties."
The AI will automatically set deal_value to a Number type and name as a Text property while setting the primary field to ID.
Built with ❤️ for the Open Source Community.