7. The AI Categorization Engine
Markd’s core feature is its ability to read webpage content and intelligently route bookmarks. It does this through a highly controlled, multi-stage pipeline designed to prevent AI hallucinations (making up invalid folders) and ensure clean organization.
1. The Sorting Modes
Depending on which button you click, Markd restricts how the AI is allowed to behave:
- Sort Using Existing (The Strict Librarian): The AI is fed your exact, current folder Blueprint. It is strictly forbidden from inventing new folders. It processes up to 3 bookmarks simultaneously for high speed. If a bookmark doesn't fit anywhere, the AI will output
noneand the bookmark will be skipped. - Sort Creating New (The Architect): The AI looks at your Blueprint. If it finds a perfect match, it uses it. If not, it is authorized to invent a brand new Main Category and Subcategory. To prevent the AI from accidentally creating duplicate folders at the same time, this mode strictly processes 1 bookmark at a time.
- Sort Within... (The Micro-Manager): Triggered by clicking the
icon on a specific Main Category. A dialog will appear asking if you want to restrict the AI to Existing Categories Only or allow it to Create New subcategories specifically within this folder. The AI is forced to find a home for the bookmark only inside this specific parent folder.
- The Escape Hatch (Advisory Skipping): What if a bookmark about "Cooking" is accidentally sitting in your "Technology" folder? If the AI realizes a bookmark has zero relevance to the current folder, it triggers the "Escape Hatch." To prevent bookmarks from being scattered across your workspace behind your back, Markd intentionally aborts the move and skips the bookmark. It then leaves a smart advisory note in the Activity Log (e.g., "Consider moving this bookmark to your 'Lifestyle' folder" or "Consider creating a new category 'Cooking'" depending on whether you allowed it to create new folders).
2. Hallucination Detection & Repair
Markd does not blindly trust the AI. When "Sort Using Existing" is active, every AI response goes through an Auditor Pipeline:
- Syntax Check: If the AI fails to return proper JSON, Markd automatically intercepts the bad response and sends a "Correction Prompt" to force the AI to fix its formatting.
- Fuzzy Matching (Auto-Correction): Before throwing a strict logic error, Markd runs a "Fuzzy Match" pass. If the AI makes a minor typo or case-sensitivity error (e.g., outputting "tech news" instead of "Technology News"), Markd silently auto-corrects the AI's response to match your exact Blueprint, ensuring the sort process doesn't slow down.
- Logic Check: If the AI suggests a folder that doesn't exist in your plan, Markd flags it as a "Hallucination." It sends a strict warning back to the AI with a list of valid folders, forcing it to try again. If it fails twice, the bookmark is safely skipped.
Achieving the Best AI Results:
Using the Free tier of cloud AI providers can sometimes result in slower sorting or "Skipped" bookmarks. This happens because free API tiers heavily restrict how many requests you can make per minute (Rate Limiting), or because the free models are smaller and less capable of understanding complex webpages. For the fastest speeds and highest sorting accuracy, we highly recommend using a premium API tier (like OpenAI, Anthropic, or paid Groq) or running a strong, local Ollama model if your computer hardware supports it.
3. Smart URL Patterns (The AI Bypass)
AI takes a few seconds to read a webpage. Smart URL Patterns bypass the AI entirely for lightning-fast routing.
If you map github.com to Technology/Programming in Settings, Markd will route any GitHub link there instantly. However, if that folder does not exist in your current plan, Markd will pause the sort and show a URL Pattern Conflict Dialog:
- Move to Suggested: Forces the creation of the missing folder and moves the bookmark there.
- Ignore & AI Sort: Tells Markd to ignore your URL rule for this specific link and let the AI find a home in your existing folders instead.
- Skip: Leaves the bookmark exactly where it is.
- Checkbox: Check "Apply the same for all future URL conflicts in this batch" to automate your choice for the rest of the sorting session.
- This Pattern Checking is active in Sort Within... mode too.
4. Local URL Routing
Markd automatically detects private network links (e.g., localhost, 192.168.x.x, file://). It skips the AI (which cannot access your local network anyway) and prompts you to route them directly to the Local Development system folder.
5. Preview Mode
Clicking Preview (Existing) or Preview (New) safely tests the AI on 10 uncategorized bookmarks. The progress bar will run, but no bookmarks will be moved. Instead, you can open the "Activity Log" to see exactly where the AI would have placed them, allowing you to fine-tune your folders before committing.
6. Progress, Cancellation, and Safety
- Pre-Flight HTTP Checks: Before Markd wastes an AI API call, the internal scraper checks if the website is actually alive. If it detects a dead page (404) or a strict firewall (403), it skips the AI entirely, leaves the bookmark where it is, and logs the exact HTTP error code in the Activity Log.
- AI Broken Page Detection: Sometimes a webpage technically loads, but the text on the page says "Domain Expired" or "Article Removed." The AI is trained to detect this. If it does, Markd aborts the move and logs a warning: "AI suggested this might be broken. Use the 'Check Broken Links' tool to verify."
- 30-Second Timeout Protection: If a cloud AI provider hangs or experiences a severe lag spike, Markd will not freeze. A strict 30-second timeout races against the AI. If the AI doesn't respond in time, the bookmark is skipped with a
Timeoutwarning, and the queue moves to the next item. - Throttling: If you hit API Rate Limits, Markd won't crash. It logs a yellow
Rate Limit Reachedwarning, skips the bookmark, and moves to the next. - Large Batch Warnings: If you select more than 50 bookmarks for a single bulk sort, Markd calculates the estimated time (based on API delays) and pops up a confirmation dialog to ensure you actually meant to trigger a massive operation.
- Parser Fallback Notification: If the advanced offscreen DOM parser fails to load a complex webpage, Markd seamlessly falls back to a raw text-regex parser. It will show a single toast notification: "Advanced parser unavailable. Using basic mode for this batch," ensuring the sort continues uninterrupted.
- Graceful Cancellation: If you click "Cancel Operation" on the progress bar, Markd does not abruptly kill the app. The text changes to "Stopping... Finishing active AI requests..." It lets the currently processing bookmarks finish, saves the progress made so far, and generates a single, clean "Undo" command for the batch.
- Free Tier Limits: Free users can process a maximum of 10 bookmarks at a time as a demo.
7. The Live Auto-Sorting Mechanism
If you enable Categorize Site When Added in Settings, Markd runs a highly intelligent background assistant. When you use Chrome’s native "Star" button to save a bookmark, Markd steps in to organize it for you automatically.
Here is exactly how this background process works:
- The Root Watcher: The auto-sorter does not interfere with your manual organization. It strictly monitors your designated Markd "Root" folder (your Inbox). Markd actually communicates with Chrome to reset your "Last Used Folder" pointer, ensuring new bookmarks land in the Root so the AI can catch them.
- The Smart Queue: If you save several bookmarks in rapid succession (or import a small batch), Markd won't freeze your browser. It places new bookmarks into an orderly background queue, processing them a couple of seconds apart. To prevent the Markd app interface from flashing or jumping around while you are trying to use it, visual updates are paused. The app will only execute a single, clean visual refresh once the entire background queue is finished.
- The Human Override: AI takes a few seconds to read a webpage. What happens if you click the Chrome star, but then immediately change the folder yourself using Chrome’s native dropdown? Markd is programmed to defer to you. If it detects that a bookmark has been moved out of the Root folder before the AI finishes thinking, it instantly cancels the AI sort, leaves the bookmark exactly where you put it, and shows a brief "AI Sorting Cancelled" notification.
- Pre-Sorting Checks:
- Local Links: If you save a private network link (like
localhost), Markd skips the AI entirely and routes it instantly to the Local Development system folder. - Offline Mode: If your internet connection drops, the background worker pauses gracefully. It will leave the bookmark safely in your Inbox and notify you that sorting is paused until you are back online.
- Local Links: If you save a private network link (like
- The Final Move (Two Modes):
- Always Ask (Interactive): If this setting is on, Markd will send a Chrome Desktop Notification (e.g., "Suggested: Technology > AI. Move this bookmark?"). The bookmark stays in your Inbox until you explicitly click "Yes" on the notification.
- Fully Automatic (Silent): If "Always Ask" is disabled, Markd silently moves the bookmark to the correct folder in the background and simply shows a brief confirmation toast so you know where it went. (Note: Markd includes specialized background logic to ensure that even if Chrome tries to force the bookmark back to the root when the star menu closes, the AI's intended destination is enforced).
- Smart Error Handling & Diagnostics: The background worker is designed to be helpful, not annoying.
- If a link is completely broken, or if the AI is confused because you have no categories created yet, it will leave the bookmark in your Inbox.
- It will then show a notification explaining the exact issue (e.g., "AI could not match this to your existing categories. Tip: Try adding more categories").
- For most errors, these notifications include a convenient "Open Markd" button, allowing you to instantly launch the app and resolve the issue.