Designing an AI‑Native Text Editor: Principles, Features, and Architecture
This article explores the creation of an AI‑native text editor for documentation tasks, detailing its design principles, AI‑enhanced writing scenarios, requirement‑writing workflow, technical stack choices, configuration‑driven AI capabilities, and metrics for evaluating immersive AI tools.
Introduction
The project builds an AI‑native text editor aimed at documentation scenarios such as requirement writing, architecture documents, and other software‑development artifacts, with the goal of accelerating daily work for various roles.
Project repository: https://github.com/unit-mesh/3b (still in AI‑experience design stage, no model integrated yet). Online demo: https://editor.unitmesh.cc/
Background
After exploring Copilot‑type tools, the AutoDev plugin emerged as a faithful open‑source IDE assistant. Documentation work also benefits from AI‑assisted, immersive creation tools.
AI‑Assisted Writing Scenarios
Inspiration : Use generative AI (e.g., ChatGPT) to spark ideas, while being aware of possible factual inaccuracies.
Fact‑Based Context : Augment prompts with real‑time web results from search engines to improve factual correctness.
Historical Content Linking : Provide background material (e.g., cultural references) to enrich generated text.
Spelling and Optimization : After a draft is generated, use AI to polish language, adjust tone, and incorporate stakeholder feedback.
AI‑Assisted Requirement Writing
Unclear requirements cause rework. The envisioned workflow focuses on generating a draft and then refining it:
Optional analysis of historical code and documentation.
Optional generation of skeletal code.
Automated code completion.
Automatic test and documentation generation.
Code refactoring and optimization.
Key functions for a dedicated requirement‑writing tool:
Historical requirement clarification (optional) by extracting past requirements from code and release notes.
Draft generation that produces a structured requirement outline.
Sub‑item refinement, generating artifacts such as flowcharts based on each requirement feature.
Requirement optimization, checking for omissions and inconsistencies.
Design Principles of an Immersive AI Editor
Smart Embedding : Deep integration of AI models into the UI, making AI actions intuitive and context‑aware.
Local Optimization : Preference for on‑premise inference models to ensure fast, offline experiences.
Context Flexibility : Exposing a context API that lets users customize prompts and predefined context variables.
Smart Embedding – Trigger Mechanisms
Toolbar button click.
Slash shortcut (/).
Custom input box (Ctrl+/ or Command+/).
Bubble menu on text selection.
Inline completion (Ctrl+\ or Command+\).
Local Optimization – Capabilities
Semantic search on locally vectorized documentation.
Local grammar checking.
Text prediction for single‑line and multi‑line content, requiring a lightweight model.
Context Flexibility – Variables
All editor contexts are exposed as variables that can be combined into custom prompts. Example variables:
$beforeCursor $afterCursor $selection $similarChunk $relatedChunkUsers can override any AI capability configuration.
Technical Stack
ProseMirror / Tiptap for flexible rich‑text editing.
EdgeInfer – a Rust + ONNX Runtime based local inference engine that runs in browsers, mobile, and desktop.
Tauri – a Rust‑based desktop framework for cross‑platform deployment.
AI capabilities are defined through a configuration object, allowing extensive customization. Example configuration:
{
name: 'Polish',
i18Name: true,
template: `You are an assistant helping to polish sentence. Output in markdown format.
###${DefinedVariable.SELECTION}###`,
facetType: FacetType.BUBBLE_MENU,
outputForm: OutputForm.STREAMING
}Key fields:
name / i18Name : Display name and internationalization flag.
template : Prompt template containing variables.
facetType : UI interaction type (toolbar, slash menu, bubble menu, etc.).
outputForm : How the AI response is streamed or presented.
Metrics and Evaluation
Instead of acceptance rate, usage frequency is proposed as a more meaningful metric for immersive AI tools, indicating how naturally users reach for AI assistance.
Roadmap and Contribution
Roadmap details are tracked at https://github.com/unit-mesh/3b/issues/1. The project welcomes contributions, model integrations, and sponsorship.
Conclusion
The 3B editor is an open‑source, AI‑native writing environment that combines smart UI embedding, local inference, and flexible context handling to support both documentation and requirement‑writing workflows.
phodal
A prolific open-source contributor who constantly starts new projects. Passionate about sharing software development insights to help developers improve their KPIs. Currently active in IDEs, graphics engines, and compiler technologies.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
