# ProjectContext.md
_A living document describing the vision, scope, and key considerations for our “agentic/advanced text-editor” project._
---
## 1. One-Sentence Pitch
A privacy-first, locally running text editor with built-in LaTeX and research-grade AI assistance that helps university students plan, draft, and polish scientific papers—without leaving their writing flow.
---
## 2. Problem Statement
1. Students juggle multiple tools (Word/LaTeX editors, citation managers, grammar checkers, AI chat windows), fragmenting focus and wasting time.
2. Cloud-only AI writing assistants raise data-privacy concerns, especially around unpublished research.
3. Traditional LaTeX editors have steep learning curves and lack modern “smart” features such as real-time feedback, structural suggestions, or context-aware citation recommendations.
---
## 3. Vision & North-Star Goal
Deliver an agentic workspace that feels like “Overleaf × Notion × ChatGPT—minus the browser,” enabling students to think, write, and iterate faster while safeguarding intellectual property on their own machines.
---
## 4. Target Users
| Persona | Description | Primary Needs |
|---------|-------------|---------------|
| “STEM Undergrad” | 2nd–4th year, writing lab reports & capstone papers | Quick LaTeX templates, formula previews, citation autocompletion |
| “Graduate Researcher” | MSc/PhD, publishing to IEEE/ACM | Literature synthesis, section re-structuring, plagiarism checks |
| “Humanities Student” | Essay-centric | MLA/APA citation, paraphrasing, argument flow feedback |
---
## 5. Core Features (MVP)
1. **Local-First Editing Engine**
• Offline save & autosync to user-defined folders (Git-friendly).
• Live LaTeX rendering side-by-side.
2. **LLM Integration Layer**
• Configurable API keys for OpenAI, Anthropic, etc.
• On-device context window (never uploads raw project files unless user approves).
3. **AI-Powered Tools**
• “Explain-my-code/equation,” “rewrite in academic tone,” “generate related-work outline.”
• Agentic actions: refactor section order, build preliminary bibliography from DOIs.
4. **Citation & Reference Manager**
• BibTeX import/export, DOI/PMID fetch, deduplication.
• Natural-language citation queries (e.g., “add Feynman 1949 QED paper here”).
5. **User Interface**
• Distraction-free Markdown + LaTeX hybrid.
• Command palette (`⌘/Ctrl+K`) with AI and editor commands.
---
## 6. Out-of-Scope (v1)
✗ Real-time collaboration (multi-cursor)
✗ Mobile/Tablet clients
✗ Full journal submission workflows
---
## 7. Success Metrics
| KPI | Target after 6 months |
|-----|-----------------------|
| Weekly Active Users | 1 000 students |
| Avg. session length | ≥ 25 min |
| “AI suggestion accepted” rate | ≥ 40 % |
| User-reported writing time reduction | ≥ 30 % |
---
## 8. Stakeholders
• Product & UX Team
• University IT / Data-Protection Office
• Early-adopter Student Researchers (beta cohort)
• LLM API Providers (OpenAI, etc.)
---
## 9. Technical Stack (Proposed)
| Layer | Tech |
|-------|------|
| Core Editor | Electron + React / Tauri + Svelte (evaluate) |
| Document Model | ProseMirror or TipTap with LaTeX extension |
| Local Storage | SQLite + file system sync |
| AI Middleware | Node/Go rust service → HTTPS calls to LLMs |
| Security | OS keychain for API tokens, optional self-hosted LLM via Ollama |
---
## 10. Risks & Mitigations
1. **API Cost Overrun** → Implement token budget caps & on-device mini-models where feasible.
2. **Model Privacy** → Offer “strict local mode” (no remote calls).
3. **LaTeX Complexity** → Ship opinionated templates & real-time error hints.
---
## 11. Milestones (High-Level)
| Phase | Duration | Deliverables |
|-------|----------|--------------|
| Discovery & UX Prototypes | Month 1 | Wireframes, persona interviews |
| MVP Build | Months 2–4 | Core editor, local storage, LaTeX preview |
| AI Layer & Agent Actions | Months 4–6 | LLM integration, command palette |
| Beta Testing | Month 7 | University pilot, feedback loops |
| v1 Launch | Month 8 | Public release, docs, onboarding tutorial |
---
## 12. Open Questions
1. How deep should agentic automation go without compromising academic integrity?
2. Should we embed plagiarism detection or integrate with 3rd-party checkers?
3. Do we target cross-platform parity (Windows/Linux/macOS) at v1 or stagger releases?
---
_Last updated: {{ YYYY-MM-DD }} — keep this document evergreen._