Skip to content

docs: describe offline-first AI architecture#19

Open
sharma-sugurthi wants to merge 4 commits intoAOSSIE-Org:mainfrom
sharma-sugurthi:docs/ai-architecture
Open

docs: describe offline-first AI architecture#19
sharma-sugurthi wants to merge 4 commits intoAOSSIE-Org:mainfrom
sharma-sugurthi:docs/ai-architecture

Conversation

@sharma-sugurthi
Copy link

@sharma-sugurthi sharma-sugurthi commented Mar 7, 2026

Fixes #17

Description

This PR introduces the foundational documentation for SmartNotes' AI architecture. It establishes the technical guidelines and core principles needed to build AI features that are strictly offline-first, privacy-preserving, and modular.

Key Changes

  • New Architecture Guide: Added docs/ai-architecture.md to detail the high-level AI pipeline (chunking, embedding, indexing, and retrieval) using a Mermaid flowchart.
  • Module Boundaries: Defined conceptual contracts for core AI components, including chunking, embedding, keyword/hybrid search, and knowledge graph extraction.
  • System Guidelines: Documented best practices for vault/storage interaction, performance scalability, and explicit non-goals (e.g., avoiding mandatory SaaS backends).
  • README Update: Added an "AI Architecture" section to highlight the offline-by-default principles and link out to the new, detailed documentation.

Summary by CodeRabbit

  • Documentation
    • Added an AI Architecture section describing SmartNotes as a desktop, local-first, privacy-first, modular app with offline-by-default design.
    • Expanded User Flow with a new Key User Journeys subsection and three concrete, step-by-step journeys.
    • Added a comprehensive AI architecture blueprint covering the pipeline, module boundaries, scalability and performance considerations, and explicit opt-in for any online components.

@github-actions github-actions bot added enhancement New feature or request documentation Improvements or additions to documentation labels Mar 7, 2026
@coderabbitai
Copy link

coderabbitai bot commented Mar 7, 2026

Warning

Rate limit exceeded

@sharma-sugurthi has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 17 minutes and 14 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 38b112de-6917-4a5d-b73d-ee87784b2daf

📥 Commits

Reviewing files that changed from the base of the PR and between 20efd20 and 1276f37.

📒 Files selected for processing (1)
  • docs/ai-architecture.md

Walkthrough

Adds an "AI Architecture" section to the README and a new docs/ai-architecture.md file describing SmartNotes as an offline‑first, privacy‑preserving, modular, desktop‑only AI architecture with a pipeline (parsing → chunking → embedding → indexing → retrieval → UI), module contracts, vault interactions, scalability notes, and concrete user journey steps.

Changes

Cohort / File(s) Summary
README updates
README.md
Inserted an "AI Architecture" section and "Key User Journeys" subsection; replaced placeholder journeys with three structured user journey flows and linked to docs/ai-architecture.md.
New architecture docs
docs/ai-architecture.md
Added comprehensive AI architecture documentation covering offline-first/privacy-first principles, pipeline (markdown parsing → chunking → embedding → indexing → retrieval), module boundaries/contracts (chunking, embedding, indexing, keyword/semantic/hybrid retrieval, knowledge graph), vault/storage interactions, batching/incremental processing, scalability/performance considerations, and non-goals.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

Documentation

Poem

🐰 I hop through notes in moonlit stacks,

Chunks and embeddings in my tracks,
Offline hush and private cheer,
Search returns what I hold dear,
SmartNotes sings — carrots near!

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'docs: describe offline-first AI architecture' accurately and directly describes the main changes in the PR: adding documentation for an offline-first AI architecture.
Linked Issues check ✅ Passed The PR successfully addresses all primary coding requirements from issue #17: includes AI pipeline overview, documents offline/privacy/modularity principles, defines module boundaries with contracts, describes vault/storage interaction, and addresses scalability considerations.
Out of Scope Changes check ✅ Passed All changes are directly scoped to issue #17: the new docs/ai-architecture.md file and README.md updates focus exclusively on documenting AI architecture principles and do not introduce unrelated code modifications.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/ai-architecture.md`:
- Around line 21-30: The diagram currently shows both KW (Keyword search) and
Sem (Semantic search) pointing to a single Index which contradicts the doc text;
update the diagram so KW points to a separate KeywordIndex (or Keyword backend)
node and Sem points to a VectorIndex/VectorStore node (replace or split the
existing Index node), and adjust the arrows so Fuse (Hybrid ranking) still
consumes KW and Sem while KG stays connected to UI_Related—ensure you rename the
nodes (e.g., Index -> KeywordIndex and VectorIndex) so the visual matches the
textual statement that keyword search is independent of the vector store.
- Around line 132-146: The index contract currently only exposes index(chunks,
embeddings) → void which lacks explicit upsert/delete semantics and prevents
deterministic eviction of stale/re-chunked notes; update the contract to add
explicit operations such as upsert(chunks, embeddings) → void (for inserting or
replacing chunk entries) and deleteByIds(ids) or deleteByNoteIds(noteIds) → void
(for removing stale chunks), and ensure searchByEmbedding(queryEmbedding,
options) → RankedResults remains unchanged; implement these new methods in the
index storage implementation so incremental updates can call upsert for changed
chunks and deleteByIds for removed/re-chunked notes to avoid full rebuilds.
- Around line 120-121: The doc currently presents a remote LLM as if it can
serve as a drop-in Embedding implementation; update the wording to use an
embedding-service example (e.g., a local embedding model via a JS/TS transformer
library or a hosted embedding API) instead of a generic remote LLM, explicitly
state that the default implementation should be a local embedding model and that
any remote LLM-based generation/assistant services are strictly optional and
belong to the separate assistant/generation layer (refer to the "Embedding"
contract and the phrase "Default implementation" to make this distinction
clear).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: a0d3b5e8-31c1-45a2-9ab1-828e533d961d

📥 Commits

Reviewing files that changed from the base of the PR and between a3ccb2b and af39128.

📒 Files selected for processing (2)
  • README.md
  • docs/ai-architecture.md

@github-actions github-actions bot added size/L and removed size/L labels Mar 8, 2026
@sharma-sugurthi
Copy link
Author

fixed all the 3 issues..

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/ai-architecture.md`:
- Line 182: Change the lowercase "markdown" to the proper noun "Markdown" in the
sentence that reads "Parse wiki‑style links (e.g. `[[Note]]`, `[[Note|Alias]]`)
from markdown." so it becomes "from Markdown." Update the text in the
docs/ai-architecture.md content for the sentence containing the wiki-style link
example.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 5539d010-7f45-4ed1-80aa-092905a845fc

📥 Commits

Reviewing files that changed from the base of the PR and between af39128 and 58be322.

📒 Files selected for processing (1)
  • docs/ai-architecture.md

@github-actions github-actions bot added size/L and removed size/L labels Mar 8, 2026
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/ai-architecture.md`:
- Line 1: Change the document title heading from "## AI Architecture for
SmartNotes" to a top-level H1 by replacing the leading "##" with "#" so the file
begins with "# AI Architecture for SmartNotes" (update the existing heading
string to the H1 form to resolve MD041).
- Around line 30-45: Update the architecture diagram and explanatory text to add
the assistant/generation path: introduce an explicit "Assistant" consumer node
(e.g., UI_Assistant or Assistant_Gen) and show arrows from both the retrieval
pipeline (Fuse --> UI_Search and hybrid retrieval/semantic search outputs) and
the knowledge-graph layer (KG --> UI_Related) into that Assistant node; in the
prose, state that retrieval results and KG context feed an optional local
assistant which performs prompt construction, grounding and generation using
local models (no network), and clarify that the assistant can consume
keyword/semantic/hybrid retrieval outputs and related-note context for answer
generation and suggested links. Ensure references to UI_Search, UI_Related,
Fuse, KG, and the new Assistant node are included so implementers know where
retrieval output should be routed.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 078bce9e-3d87-40e7-9bf3-f42c9d3ca97b

📥 Commits

Reviewing files that changed from the base of the PR and between 58be322 and 20efd20.

📒 Files selected for processing (1)
  • docs/ai-architecture.md

@github-actions github-actions bot added size/L and removed size/L labels Mar 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request first-time-contributor size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Document offline‑first AI architecture and modular retrieval design for SmartNotes

1 participant