[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-thiswillbeyourgithub--AnkiAIUtils":3,"tool-thiswillbeyourgithub--AnkiAIUtils":61},[4,18,26,36,44,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",146793,2,"2026-04-08T23:32:35",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",108111,"2026-04-08T11:23:26",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":32,"last_commit_at":50,"category_tags":51,"status":17},4721,"markitdown","microsoft\u002Fmarkitdown","MarkItDown 是一款由微软 AutoGen 团队打造的轻量级 Python 工具，专为将各类文件高效转换为 Markdown 格式而设计。它支持 PDF、Word、Excel、PPT、图片（含 OCR）、音频（含语音转录）、HTML 乃至 YouTube 链接等多种格式的解析，能够精准提取文档中的标题、列表、表格和链接等关键结构信息。\n\n在人工智能应用日益普及的今天，大语言模型（LLM）虽擅长处理文本，却难以直接读取复杂的二进制办公文档。MarkItDown 恰好解决了这一痛点，它将非结构化或半结构化的文件转化为模型“原生理解”且 Token 效率极高的 Markdown 格式，成为连接本地文件与 AI 分析 pipeline 的理想桥梁。此外，它还提供了 MCP（模型上下文协议）服务器，可无缝集成到 Claude Desktop 等 LLM 应用中。\n\n这款工具特别适合开发者、数据科学家及 AI 研究人员使用，尤其是那些需要构建文档检索增强生成（RAG）系统、进行批量文本分析或希望让 AI 助手直接“阅读”本地文件的用户。虽然生成的内容也具备一定可读性，但其核心优势在于为机器",93400,"2026-04-06T19:52:38",[52,14],"插件",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":10,"last_commit_at":59,"category_tags":60,"status":17},4487,"LLMs-from-scratch","rasbt\u002FLLMs-from-scratch","LLMs-from-scratch 是一个基于 PyTorch 的开源教育项目，旨在引导用户从零开始一步步构建一个类似 ChatGPT 的大型语言模型（LLM）。它不仅是同名技术著作的官方代码库，更提供了一套完整的实践方案，涵盖模型开发、预训练及微调的全过程。\n\n该项目主要解决了大模型领域“黑盒化”的学习痛点。许多开发者虽能调用现成模型，却难以深入理解其内部架构与训练机制。通过亲手编写每一行核心代码，用户能够透彻掌握 Transformer 架构、注意力机制等关键原理，从而真正理解大模型是如何“思考”的。此外，项目还包含了加载大型预训练权重进行微调的代码，帮助用户将理论知识延伸至实际应用。\n\nLLMs-from-scratch 特别适合希望深入底层原理的 AI 开发者、研究人员以及计算机专业的学生。对于不满足于仅使用 API，而是渴望探究模型构建细节的技术人员而言，这是极佳的学习资源。其独特的技术亮点在于“循序渐进”的教学设计：将复杂的系统工程拆解为清晰的步骤，配合详细的图表与示例，让构建一个虽小但功能完备的大模型变得触手可及。无论你是想夯实理论基础，还是为未来研发更大规模的模型做准备",90106,"2026-04-06T11:19:32",[35,15,13,14],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":66,"readme_en":67,"readme_zh":68,"quickstart_zh":69,"use_case_zh":70,"hero_image_url":71,"owner_login":72,"owner_name":73,"owner_avatar_url":74,"owner_bio":75,"owner_company":76,"owner_location":77,"owner_email":78,"owner_twitter":78,"owner_website":79,"owner_url":80,"languages":81,"stars":86,"forks":87,"last_commit_at":88,"license":89,"difficulty_score":90,"env_os":91,"env_gpu":92,"env_ram":93,"env_deps":94,"category_tags":98,"github_topics":99,"view_count":32,"oss_zip_url":78,"oss_zip_packed_at":78,"status":17,"created_at":112,"updated_at":113,"faqs":114,"releases":130},5713,"thiswillbeyourgithub\u002FAnkiAIUtils","AnkiAIUtils","AI-powered tools to enhance Anki flashcards with explanations, mnemonics, illustrations, and adaptive learning for medical school and beyond","AnkiAIUtils 是一套专为 Anki 用户打造的 AI 增强工具集，旨在通过自动化手段提升记忆卡片的学习效率。它主要解决用户在复习中反复记不住难点的问题：当你标记某张卡片为“困难”或“失败”时，它能自动调用大语言模型生成通俗易懂的解释、定制化的记忆口诀（助记符），甚至利用 DALL-E 或 Stable Diffusion 创作生动的辅助插图，将抽象知识转化为直观的视觉记忆。\n\n这套工具特别适合医学生、备考人员以及所有希望深度优化 Anki 学习流程的普通用户。其独特之处在于高度个性化的记忆系统：它不仅支持用户自定义和维护专属的口诀库，确保记忆逻辑的一致性，还能基于语义相似度技术，从你的历史数据中动态匹配最相关的示例进行自适应学习。此外，AnkiAIUtils 具备极强的兼容性，直接修改本地笔记数据，无缝支持 Windows、Mac 及移动端等各类 Anki 客户端，并允许用户自由选择不同的 AI 模型提供商。虽然目前主要以脚本形式运行，适合愿意尝试自动化工作流的进阶用户，但其核心目标是让每个人都能拥有类似专业付费平台的智能辅助体验，让背诵变得不再枯燥。","# Anki AI Utils\nA powerful suite of AI-powered tools to enhance your [Anki](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FAnki_(software)) flashcard learning experience by automatically improving cards you struggle with, tested through medical school. For example think of it like this: every time you fail a card you get a ChatGPT explanation, a Dall-E illustration, mnemonics, etc but supporting your own mnemonics.\n\n**Check out my other Anki and AI related projects on my [GitHub profile](https:\u002F\u002Fgithub.com\u002Fthiswillbeyourgithub)!**\n\n### Simple example\n**Those scripts make it so that every failed note will automatically have new fields containing explanations, mnemonics, and illustrations.** This is done in a way that respects **your own mnemonics**, can even use the [major system](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FMnemonic_major_system), and has **many** more features.\n\nAn example of the kind of workflow that AnkiIllustrator facilitates, watch [pixorise's youtube channel](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=QzxHpjryJHg0) which is full of great image mnmemonics, particularly appropriate for mental palace types of learning.\n\n## Developer's note \u002F call for help\nThis collection of scripts is the culmination of my efforts to contributes the AI features I wish existed when I started medical school. All scripts should be working but I released them hastily after documenting them heavily with the help of [aider](https:\u002F\u002Faider.chat\u002F). It is possible that some aspects of the documentation is slightly off or imprecise. It is also possible that some of the scripts where slighly broken during the release process. In any case, **by releasing this project made with love and care my hope is to motivate others to package it into addons.** I have too little time to learn how to package those scripts into addons and make the appropriate GUI so any help is absolutely welcome. To that end, please take a look at the TODO list below and open an isue!\n\n## Key Features\n\n- **Adaptive Learning**: Uses [semantic similarity](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FSemantic_similarity) to dynamically match your cards with the most relevant examples from your training datasets. The more examples you add, the better it gets!\n\n- **Personalized Memory Hooks**: Reuses consistent mnemonics from your custom collection, building a personalized memory system. Includes a dedicated tool to help create and manage your mnemonic library.\n\n- **Automation Ready**: Run programmatically - for example, use cron to automatically enhance cards you struggled with yesterday, making them easier to remember through images, mnemonics, and explanations.\n\n- **Universal Compatibility**: Modifies Anki notes directly in-place, working seamlessly across all Anki clients (Windows, Mac, Linux, Android, iOS). Extensive logging ensures you can track changes and rollback if needed.\n\n- **Provider Agnostic**: Supports all LLM providers and models through LiteLLM, letting you choose the best option for your needs.\n\n- **Infinitely Extensible**: Add as many examples as you want to your training datasets - the semantic filtering automatically picks the most relevant ones for each card.\n\n## Tools\n\n### Illustrator \nCreates custom mnemonic images for your cards using AI image generation. It:\n- Analyzes card content to identify key concepts\n- Generates creative visual memory hooks\n- Preserves a history of generated images\n- Supports both DALL-E2, DALL-E3 and Stable Diffusion\n- Automatically formats images for optimal display (centered, proper sizing)\n- Handles multiple images per card with consistent layout\n\nPerfect for visual learners or complex topics that benefit from imagery.\n\nAn example of the kind of workflow that AnkiIllustrator facilitates, watch [pixorise's youtube channel](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=QzxHpjryJHg0) which is full of great image mnmemonics, particularly appropriate for mental palace types of learning.\n\n\u003Cdetails>\n\u003Csummary>\nClick to see an example\n\u003C\u002Fsummary>\n\nFor example, I had this French flashcard:\n\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fthiswillbeyourgithub_AnkiAIUtils_readme_969e515ba2c4.png)\n\u003Cdetails>\n\u003Csummary>Click here if you can't read French\u003C\u002Fsummary>\n\nHere's the note content translated to English:\n```\nDiagnostic criteria for simple febrile seizures:\n- Age greater than 1 year\n- Seizure occurring with fever above 38°C (100.4°F)\n- Symmetrical motor manifestations lasting less than 15 minutes and without deficit\n- Single seizure per febrile episode\n- Less than 3 episodes in total\n```\n\n\u003C\u002Fdetails>\n\n`illustrator.py` generated to me this image:\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fthiswillbeyourgithub_AnkiAIUtils_readme_fa493e8ed052.png)\n\nAs well as this text content to understand its thought process: (Note that this part is always in English no matter the original language)\n```\nTopic: 'Diagnostic criteria for a simple febrile seizure'\nAnchors: 'Febrile \u002F Fever: a fireplace (sounds like febrile)'\nPhonetic: '1 as T link in thai, tea, tie; 3 as M link in mow, my, meh; 8 as F link in fire, faux, few; 5 as L link in low, lee, lie'\nRemarks:\n* The criteria are specific and should be presented in a way that is easy to remember.\nStep by step decomposition:\n* Age over 1 year: a toddler holding a teacup (T for 1)\n* Seizure with fever over 38°C: a thermometer with flames around it (F for 8)\n* Symmetric motor manifestations lasting less than 15 minutes without deficit: a clock showing 15 minutes with two identical figurines moving symmetrically on either side\n* 1 unique seizure per febrile episode: a single lightning bolt striking a fireplace (fireplace for fever)\n* Less than 3 episodes in total: three thermometers, but only two showing a high temperature\nImagining:\n* A toddler holding a teacup, standing next to a fireplace with a single lightning bolt striking it.\n* Above the fireplace, a clock showing 15 minutes with two identical figurines moving symmetrically.\n* Next to the toddler, a thermometer surrounded by flames, and three thermometers, two of which show high temperatures.\nSubject: 'a toddler holding a teacup next to a fireplace struck by a single lightning bolt, a clock showing 15 minutes with symmetric figurines, a flaming thermometer, and three thermometers with two showing high temperatures'\nDescription words: 'educational, colorful, engaging, vivid, detailed'\nStyle: 'illustration'\nRealism: 'semi-realistic'\na toddler holding a teacup next to a fireplace struck by a single lightning bolt, a clock showing 15 minutes with symmetric figurines, a flaming thermometer, and three thermometers with two showing high temperatures, educational, colorful, engaging, vivid, detailed, illustration, semi-realistic\n\n[DATE:09\u002F04\u002F2024 VERSION:2.5 LLMMODEL:openai\u002Fgpt-4-0125-preview IMAGEMODEL:openai\u002Fdall-e-3]\n```\n\n\u003C\u002Fdetails>\n\n### Reformulator\nAn intelligent tool that rephrases your flashcards while preserving their core meaning and structure. It helps when:\n- Cards are poorly worded or unclear\n- You want to vary the phrasing to strengthen recall\n- Cards need to be more concise or natural sounding\n- Your preferred card format has evolved over time\n\nThe tool uses LLMs to reformulate content while carefully preserving cloze deletions and media. This is especially valuable for long-term Anki users - for example, during medical school, your idea of what makes a \"perfect\" flashcard often evolves after a few semesters. The Reformulator lets you easily update all your older cards to match your current preferred format and style.\n\n\u003Cdetails>\n\u003Csummary>\nClick to see an example\n\u003C\u002Fsummary>\n\nFor example, given this poorly worded flashcard:\n\n```\nbilateral and symmetric alveolar syndrome, perihilar, often with effusion, what to consider?\n{{c1::APE}}\n```\n\nThe reformulator would improve it to:\n\n```\nWhat should be considered in presence of bilateral and symmetric alveolar syndrome, perihilar, often with effusion?\n{{c1::In case of bilateral and symmetric alveolar syndrome, perihilar, often with effusion, one should consider APE.}}\n```\n\nThe reformulator can also make cards more concise when needed. For example, it could reformat the same card as:\n\n```\nKey features of bilateral and symmetric alveolar syndrome, perihilar, often with effusion:\n- {{c1::Consider APE}}\n```\n\nThe true power of the reformulator lies in its flexibility - your imagination is the only limit. It can:\n- Make questions grammatically complete and clear\n- Structure content as proper questions, bullet points, tables, or any format you prefer\n- Make answers self-contained by repeating key context when needed\n- Adjust verbosity from concise summaries to detailed explanations\n- Preserve exact medical terminology while improving clarity\n- Maintain cloze deletion format while enhancing content\n- Adapt to any formatting style (paragraphs, lists, diagrams, etc.)\n- Transform content into mnemonics, analogies, or memory palaces\n- Create hierarchical structures for complex topics\n- Generate multiple variations to strengthen recall through interleaving\n\nThe reformulator is not just a tool for fixing poorly worded cards - it's a creative partner that can help you explore new ways to structure and present information. Whether you want to create visual mind maps, build memory palaces, or develop unique mnemonic systems, the reformulator can help bring your ideas to life while maintaining the integrity of your Anki cards.\n\n\u003C\u002Fdetails>\n\n\n### Mnemonics Creator\nGenerates memorable mnemonics tailored to your cards by:\n- Creating multiple mnemonic options per card\n- Using proven memory techniques like the [Major System](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FMnemonic_major_system)\n- Incorporating your existing memory anchors\n- Preserving context and accuracy\n\nHelps create lasting memory connections, especially for numbers and sequences.\n\n\u003Cdetails>\n\u003Csummary>\nClick to see an example\n\u003C\u002Fsummary>\n\nThe mnemonics made for the card above about infant fever ended up with this content in the AnkiMnemonics field:\n\n---\n\n\n1.  'Heureux Hephaistos fébrile tend sa banane unique près du feu'\u003Cbr>* \u003Cb>Heureux \u003C\u002Fb> Âge supérieur à 1 an \u003Cu> Heureux évoque la maturité et donc un âge déjà avancé, supérieur à 1 an \u003C\u002Fu>\u003Cbr>* \u003Cb>Hephaistos fébrile \u003C\u002Fb> Survenue de la crise avec une fièvre supérieure à 38°C \u003Cu> Hephaistos évoque la fièvre du fait de son rôle de forgeron et fébrile réitère ce concept \u003C\u002Fu>\u003Cbr>* \u003Cb>tend sa banane unique \u003C\u002Fb> 1 unique crise par épisode fébrile donné \u003Cu> banane unique évoque une seule occurrence, ici la crise unique par épisode fébrile \u003C\u002Fu>\u003Cbr>* \u003Cb>près du feu \u003C\u002Fb> Moins de 3 épisodes au total \u003Cu> feu évoque la fièvre et sa proximité suggère une limite, ici moins de 3 épisodes en tout \u003C\u002Fu>\u003Cbr>\u003Cbr>2.  'Un enfant trébuche dans le feu, danse symétriquement, a un seul coup et moins de trois feux'\u003Cbr>* \u003Cb>Un enfant trébuche \u003C\u002Fb> Âge supérieur à 1 an \u003Cu> l'idée d'un enfant qui commence juste à marcher évoque l'âge juste après un an \u003C\u002Fu>\u003Cbr>* \u003Cb>dans le feu, \u003C\u002Fb> Survenue de la crise avec une fièvre supérieure à 38°C \u003Cu> le feu évoque la chaleur, donc la fièvre \u003C\u002Fu>\u003Cbr>* \u003Cb>danse symétriquement, \u003C\u002Fb> Manifestations motrices symétriques \u003Cu> danser évoque le mouvement, et symétriquement évoque les deux côtés du corps bougeant de la même manière \u003C\u002Fu>\u003Cbr>* \u003Cb>a un seul coup \u003C\u002Fb> 1 unique crise par épisode fébrile donné \u003Cu> un seul coup évoque l'unicité de la crise pendant l'épisode fébrile \u003C\u002Fu>\u003Cbr>* \u003Cb>et moins de trois feux \u003C\u002Fb> Moins de 3 épisodes au total \u003Cu> moins de trois feux évoque le nombre total d'épisodes, utilisant l'analogie avec la fièvre comme feu \u003C\u002Fu>\u003Cbr>\u003Cbr>3.  'Un enfant febrile symetrique forge une unique bulle dans la prairie'\u003Cbr>* \u003Cb>Un enfant \u003C\u002Fb> Âge supérieur à 1 an \u003Cu> enfant indique que le sujet concerne un jeune individu, donc plus d'un an \u003C\u002Fu>\u003Cbr>* \u003Cb>febrile \u003C\u002Fb> Survenue de la crise avec une fièvre supérieure à 38°C \u003Cu> fébrile se lie à la notion de fièvre \u003C\u002Fu>\u003Cbr>* \u003Cb>symetrique \u003C\u002Fb> Manifestations motrices symétriques \u003Cu> directement lié à symétrique \u003C\u002Fu>\u003Cbr>* \u003Cb>forge \u003C\u002Fb> durant moins de 15 minutes et sans déficit \u003Cu> forger évoque une action courte et intense, comme la crise qui dure moins de 15 minutes sans laisser de séquelles \u003C\u002Fu>\u003Cbr>* \u003Cb>une unique \u003C\u002Fb> 1 unique crise par épisode fébrile donné \u003Cu> unique précise le nombre de crises \u003C\u002Fu>\u003Cbr>* \u003Cb>bulle \u003C\u002Fb> Moins de 3 épisodes au total \u003Cu> une bulle évoque quelque chose de rare et limité, semblable à moins de 3 épisodes au total \u003C\u002Fu>\u003Cbr>* \u003Cb>dans la prairie \u003C\u002Fb> hyperthermique \u003Cu> la prairie évoque un espace ouvert et naturel, hyperthermique évoque la chaleur comme celle du soleil sur une prairie \u003C\u002Fu>\u003Cbr>\u003Cbr>[DATE:09\u002F04\u002F2024 VERSION:2.1 MODEL:openai\u002Fgpt-4-0125-preview]\u003Cbr>\u003Cbr>\u003C!--SEPARATOR-->\n\n---\n\n\u003C\u002Fdetails>\n\n### Explainer\nProvides clear, detailed explanations when you struggle with cards by:\n- Breaking down complex concepts\n- Highlighting key relationships\n- Adding helpful context\n- Using analogies and examples\n\nParticularly useful for understanding why you got a card wrong and filling knowledge gaps.\n\n\u003Cdetails>\n\u003Csummary>\nClick to see an example\n\u003C\u002Fsummary>\n\nThe mnemonics made for the card above about infant fever ended up with this content in the AnkiExplainer field (I translated it french to English for universal documentation):\n\n---\n\n\n* \u003Cb>EXPLANATION\u003C\u002Fb> A simple febrile seizure is characterized by its uniqueness and brevity during a febrile episode, which helps distinguish it from complex seizures or other neurological disorders.\u003Cbr>* \u003Cb>MECHANISM\u003C\u002Fb> Fever can lower the seizure threshold in certain children, which explains why an elevation in body temperature can trigger a seizure in predisposed individuals.\u003Cbr>\u003Cbr>[DATE:09\u002F04\u002F2024 VERSION:1.7 LLMMODEL:openai\u002Fgpt-4-0125-preview]\u003Cbr>\u003Cbr>\u003C!--SEPARATOR-->\n\n---\n\n\u003C\u002Fdetails>\n\n\n### Mnemonics Helper\nA lightweight interactive CLI tool for quick mnemonic generation that:\n- Takes a concept and finds semantically similar existing mnemonics\n- Generates multiple new mnemonic options using LLMs\n- Lets you choose from generated options with vim-style navigation\n- Automatically saves selected mnemonics for future reference\n- Works independently of Anki, perfect for brainstorming sessions\n\nUnlike the Mnemonics Creator which processes Anki cards in batch, this tool provides an interactive interface for generating mnemonics one concept at a time. Those new mnemonics can automatically be added to a dataset file that can readily be used by the other tools. This allows rapidly tailoring the scripts to your own imagination.\n\n\n## FAQ\n\n\u003Cdetails>\n\u003Csummary>\nClick to read more\n\u003C\u002Fsummary>\n\n### What are the core benefits of those tools?\nBasically if you run these tools each evening on cards you failed that day it will steadily improve your deck quality and learning effectiveness:\n- Automatically enhance cards you struggle with\n- Save time on manual card improvements\n- Create stronger memory connections\n- Track improvements with detailed history\n- Preserve card structure while enhancing content\n\n\n### What is the [Major System](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FMnemonic_major_system)?\nThe Major System is a powerful memory technique that converts numbers into consonant sounds, which can then be turned into memorable words. For example:\n- 0 = S sound (as in \"sea\")\n- 1 = T sound (as in \"tea\") \n- 2 = N sound (as in \"new\")\n- etc.\n\nThis makes it easier to remember numbers by turning them into words. For example, \"92\" could become \"pen\" (P=9, N=2).\n\nYou can read more about it [on wikipedia](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FMnemonic_major_system)\n\n### What are Memory Anchors?\nMemory anchors are existing associations you already know well that can be used to create new memories. For example, if you already strongly associate \"Napoleon\" with \"France\", you can use Napoleon as an anchor when learning new facts about French history.\n\nThe tools can use your personal set of memory anchors to generate mnemonics that build on your existing knowledge.\n\n### Which LLM providers are supported?\nThe tools use [LiteLLM](https:\u002F\u002Fdocs.litellm.ai\u002Fdocs\u002F) which provides a unified interface to virtually any LLM provider including:\n- OpenAI\n- Anthropic\n- Google\n- [MiniMax](https:\u002F\u002Fwww.minimaxi.com\u002F) (MiniMax-M2.7, MiniMax-M2.7-highspeed — 204K context)\n- OpenRouter\n- Azure\n- AWS Bedrock\n- Local models\n- And many more\n\nJust specify the model in LiteLLM format (e.g. \"openai\u002Fgpt-4\", \"anthropic\u002Fclaude-3-opus\", or \"minimax\u002FMiniMax-M2.7\") and it will handle the rest. For MiniMax, place your API key in a file named `MINIMAX` inside the `API_KEYS\u002F` directory (the tools will load it as `MINIMAX_API_KEY`).\n\n### What languages are supported?\nThe tools work in any language supported by the LLM you choose to use. Since these scripts support virtually all LLM providers through LiteLLM, you can use any model that works well with your language. For example:\n- OpenAI's models support 100+ languages\n- Anthropic's Claude supports 100+ languages\n- You can use local models specifically trained for your language\n- etc.\n\nThe tools will preserve all language-specific formatting, including:\n- Right-to-left text\n- Special characters and diacritics\n- Language-specific punctuation\n- etc.\n\n### How do the Mnemonics Work?\nThe mnemonics tools use several proven memory techniques:\n- [Major System](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FMnemonic_major_system) for numbers\n- Vivid imagery and visualization\n- Personal memory anchors\n- Phonetic similarities\n- Humor and absurdity\n- Story-based connections\n\nThis creates memorable associations that help strengthen recall while preserving accuracy.\n\n### Where can I find example datasets for each tool?\nThe `examples\u002F` folder contains training datasets and example files for each tool. While these were originally written in French and hastily translated to English, they provide good templates for creating your own datasets. Check the Example Files section below for details on each file.\n\n### What's the future of this project?\nThis toolkit was developed and battle-tested while studying tens of thousands of Anki cards during medical school. It proved invaluable for maintaining and enhancing a large flashcard collection during intense study periods.\n\nHowever, as research commitments have grown, I now have limited time to transform these scripts into a more user-friendly package. The tools work well but need:\n- Packaging as a proper Anki addon\n- Installation via PyPI\n- Code deduplication and cleanup\n- Better documentation\n\nI'm actively looking for contributors of all skill levels to help make these tools more accessible to the wider Anki community. Whether you're a seasoned developer or just getting started, all contributions are welcome! I can provide guidance and direction based on extensive experience with the codebase, while you help with the technical aspects of packaging and distribution.\n\nCheck out the detailed roadmap below to see what needs improving. If you're interested in helping transform these battle-tested scripts into a polished Anki addon, please don't hesitate to reach out - I'm always happy to chat and help you get started!\n\n### Why is there code duplication across the tools?\nThis project evolved organically alongside my Python skills while solving real needs during medical school. Each tool was developed independently when needed, prioritizing functionality over code elegance. While they all work reliably, there's significant opportunity to unify their codebases around a common API.\n\nI can provide detailed guidance on refactoring and consolidating the code, but lack the time to implement these changes myself. Check the roadmap below if you're interested in helping streamline the codebase while preserving its battle-tested functionality.\n\n### When Should I Use Each Tool?\n- **Mnemonics Creator**: Best for memorizing numbers, sequences, lists, and abstract concepts\n- **Illustrator**: Ideal for visual learners and complex topics that benefit from imagery\n- **Reformulator**: Use when card wording is unclear or you want variety in phrasing. Don't worry about running it on well-formatted cards - the LLM is trained to recognize and preserve cards that already follow best practices, avoiding unnecessary changes that could disrupt your learning\n- **Explainer**: Great for understanding why you got a card wrong and filling knowledge gaps\n- **Mnemonics Helper**: Simple script to quickly ask an LLM to come up with new mnemonics by taking into accountsthe [semantic similarity](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FSemantic_similarity) of the new subject vs your previous mnemonics.\n\n### What happens if I run a script multiple times on the same card?\nFor most tools (Mnemonics Creator, Illustrator, Explainer), the previous content will be preserved in a collapsible HTML section using the `\u003Cdetails>` and `\u003Csummary>` tags. The new content appears above this section. This makes it easy to:\n- See the latest generated content first\n- Access previous versions by expanding the collapsible sections\n- Track how the card evolved over time\n\nThe Reformulator works differently - it replaces the content of the original field directly, but saves all previous versions and metadata in a separate `AnkiReformulator` field. This preserves the card's readability while maintaining a complete history.\n\n### How can I track which cards were modified?\nEach tool meticulously tracks modifications through tags and metadata to ensure transparency and reversibility. For example, when a tool processes a card, it adds a dated tag like `AnkiIllustrator::done::02\u002F07\u002F2023`. This makes it easy to:\n- Quickly identify which cards were modified by each tool\n- Track when modifications were made\n- Find cards that haven't been processed yet\n- Rollback changes if needed (especially with the Reformulator)\n\nYou can use these tags in the Anki browser to assess how many cards could benefit from each tool and review the modifications made. Note that notes for which a script failed will have a tag added to it. For example `AnkiI\n::failed`.\n\n### How much does it cost to run these tools?\nThe cost depends on your usage patterns and which features you enable:\n- Start small with a few cards to get comfortable with each tool\n- Built-in safeguards prevent accidental overspending:\n  - Maximum cards per run can be limited\n  - Cost tracking per script is stored in the database\n  - Failed API calls don't count towards your quota\n  - You can set hard spending limits\n- Typical costs per card:\n  - Reformulator: ~$0.02-0.04 (text only)\n  - Mnemonics: ~$0.02-0.04 (text only)\n  - Explainer: ~$0.03-0.06 (more complex reasoning)\n  - Illustrator: ~$0.02 + image cost ($0.04-0.12 per image)\n\nThe database tracks total spending per script, making it easy to budget and monitor costs. You can also use cheaper models for initial testing before scaling up to more capable ones.\n\n### Can I use these tools on mobile?\nWhile you need to run the scripts themselves from a computer (not your phone), all changes are made directly to your Anki notes. This means:\n- Run the scripts from your computer\u002Fserver\n- Sync Anki on your computer\n- The improved cards will appear on AnkiMobile\u002FAnkiDroid after syncing\n- All generated content (reformulations, mnemonics, images, etc.) works perfectly on mobile\n\n### Example Files\nThe `examples\u002F` folder contains example files to help you get started. Note that these examples were originally written in French (except for system prompts) and were quickly translated to English - some examples may not make perfect sense but should still demonstrate the basic usage:\n- `anki_ai_utils_tmux_launcher.sh`: A tmux-based launcher script I used every morning to automatically process cards I struggled with the previous day\n- `anchors.json`: Example memory anchors mapping file \n- `dataset_anchors.txt`: Training examples for memory anchor processing\n- `explainer_dataset.txt`: Examples for the Explainer tool\n- `illustrator_dataset.txt`: Training data for image generation\n- `illustrator_sanitize_dataset.txt`: Examples for sanitizing image prompts\n- `mnemonics_dataset.txt`: Training data for mnemonic generation\n- `reformulator_dataset.txt`: Examples for card reformulation\n- `string_formatting.py`: Handles cloze deletions and text formatting\n\n### Aren't you concerned about LLM hallucinations?\n\nWhile hallucinations are a valid concern when using LLMs as search engines or relying on their compressed inner knowledge, these tools take a different approach that minimizes this risk:\n\n1. **Few-shot Learning**: By providing carefully crafted examples, we guide the LLM to follow specific patterns and formats, reducing the chance of inventing information.\n\n2. **Structured Output**: The tools enforce strict output formats that make hallucinations easier to detect and correct.\n\n3. **Preservation of Source Material**: Rather than generating new facts, the tools focus on reformulating and enhancing existing content from your cards.\n\n4. **Model Agnosticism**: As new, more reliable models emerge, you can easily switch to them without changing your workflow.\n\n\n5. **Specialization**: By focusing on specific tasks (reformulation, mnemonic creation, etc.), we reduce the scope for hallucinations compared to general-purpose chat.\n\nWhile no system is perfect, this approach has proven reliable through extensive testing during medical school. As LLMs continue to improve, we can expect hallucinations to become increasingly rare.\n\n### What's the format of dataset files?\nDataset files (like `explainer_dataset.txt`, `reformulator_dataset.txt`, etc.) are simple text files where messages are separated by `----`. The first message is assumed to be a system prompt, followed by alternating user and assistant messages. This format mirrors a typical LLM conversation flow while remaining easy to read and edit.\n\n\u003C\u002Fdetails>\n\n## Usage \u002F Getting started\n\n\u003Cdetails>\n\u003Csummary>\nClick to read more\n\u003C\u002Fsummary>\n\nTo get started using those scripts (and until someone comes along to help me turn it into an addon!), the steps are roughly:\n0. **Note: if you don't understand those steps, I recommend self teaching you using LLMs. The steps always differ slightly depending on if you are on macos\u002Flinux\u002Fwindows but the idea is always the same**\n1. Make sure you have python installed in your console. The recommended python version is 3.12.7 or 3.11.something because that's what I used at the time. If you try to use more recent versions you will probably encounter problems.\n2. git clone https:\u002F\u002Fgithub.com\u002Fthiswillbeyourgithub\u002FAnkiAIUtils\u002F\n3. I recommend creating a virtual environment for python inside this new folder, for example `uv venv` then `source .venv\u002Fbin\u002Factivate` on my linux.\n4. Run a script, for that refer to the individual usage sections below.\n\n#### Reformulator\nThe Reformulator can be run from the command line:\n\n```bash\npython reformulator.py \\\n    --query \"(rated:2:1 OR rated:2:2) -is:suspended\" \\\n    --dataset_path \"data\u002Freformulator_dataset.txt\" \\\n    --string_formatting \"data\u002Fstring_formatting.py\" \\\n    --ntfy_url \"ntfy.sh\u002FYOUR_TOPIC\" \\\n    --main_field_index 0 \\\n    --llm \"openai\u002Fgpt-4\" \\\n    --embedding_model \"openai\u002Ftext-embedding-3-small\" \\\n    --max_token 4000 \\\n    --llm_temp 0\n```\n\nKey arguments:\n- `query`: Anki browser query to select cards (defaults to recently failed cards)\n- `dataset_path`: Example prompts for reformulation\n- `string_formatting`: Custom text formatting functions\n- `ntfy_url`: Optional notifications via ntfy.sh\n- `main_field_index`: Index of the field to reformulate (0 for first field)\n- `llm`: LLM model to use in litellm format\n- `embedding_model`: Model for semantic similarity search\n- `max_token`: Maximum tokens per query\n- `llm_temp`: LLM temperature (0 for consistent output)\n\nAdditional options:\n- `--debug`: Enable debug mode\n- `--force`: Process cards even if already reformulated\n- `--print_db_then_exit`: Display database contents and exit\n- `--parallel`: Number of parallel processes (default 4)\n- `--exclude_media`: Skip cards containing media\n- `--mode`: Either 'reformulate' or 'reset' to restore original content. Note that the 'reset' feature is not absolutely guaranteed to work, but if things go wrong there are tons of logs on purpose to make sure you don't lose anything.\n\n#### Mnemonics\nThe Mnemonics Creator can be run from the command line:\n\n```bash\npython mnemonics.py \\\n    --field_names \"body\" \\\n    --query \"(rated:2:1 OR rated:2:2) -is:suspended\" \\\n    --memory_anchors_file \"data\u002Fanchors.json\" \\\n    --dataset_path \"data\u002Fmnemonics_dataset.txt\" \\\n    --string_formatting \"data\u002Fstring_formatting.py\" \\\n    --ntfy_url \"ntfy.sh\u002FYOUR_TOPIC\" \\\n    --llm \"openrouter\u002Fanthropic\u002Fclaude-3-sonnet\" \\\n    --embedding_model \"openai\u002Ftext-embedding-3-small\" \\\n    --n_mnemonic 1\n```\n\nKey arguments:\n- `field_names`: Comma-separated list of note fields to analyze\n- `query`: Anki browser query to select cards (defaults to recently failed cards)\n- `memory_anchors_file`: JSON file mapping concepts to memory anchors\n- `dataset_path`: Example prompts for mnemonic generation\n- `string_formatting`: Custom text formatting functions\n- `ntfy_url`: Optional notifications via ntfy.sh\n- `llm`: LLM model to use in litellm format\n- `embedding_model`: Model for semantic similarity search\n- `n_mnemonic`: Number of mnemonics to generate per card\n\nAdditional options:\n- `--debug`: Enable debug mode\n- `--force`: Process cards even if they already have mnemonics\n- `--note_mode`: Don't count cards of the same note twice\n- `--do_sync`: Sync Anki before and after processing\n\n#### Mnemonics Creator CLI\nThe Mnemonics Creator CLI provides an interactive interface for generating mnemonics:\n\n```bash\npython mnemonics_creator.py \\\n    --top_k 100 \\\n    --n_gen 10 \\\n    --model \"openrouter\u002Fanthropic\u002Fclaude-3-sonnet\" \\\n    --embed_model \"openai\u002Ftext-embedding-3-small\"\n```\n\nKey arguments:\n- `top_k`: Number of similar existing mnemonics to use as examples (default: 100)\n- `n_gen`: Number of new mnemonics to generate per query (default: 10)\n- `model`: LLM model to use in litellm format\n- `embed_model`: Model for semantic similarity search\n- `query`: Optional initial query to process\n- `gui`: Enable GUI interface (not yet implemented)\n\nThe CLI provides an interactive interface where you can:\n- Enter concepts to generate mnemonics for\n- See similar existing mnemonics as context\n- Choose from multiple generated options\n- Navigate with vim-style keys (j\u002Fk) or numbers\n- Save selected mnemonics to your collection\n\n#### Explainer\nThe Explainer can be run from the command line:\n\n```bash\npython explainer.py \\\n    --field_names \"body\" \\\n    --query \"(rated:2:1 OR rated:2:2) -is:suspended\" \\\n    --dataset_path \"data\u002Fexplainer_dataset.txt\" \\\n    --string_formatting \"data\u002Fstring_formatting.py\" \\\n    --ntfy_url \"ntfy.sh\u002FYOUR_TOPIC\" \\\n    --llm \"openrouter\u002Fanthropic\u002Fclaude-3-sonnet\" \\\n    --embedding_model \"openai\u002Ftext-embedding-3-small\" \\\n    --llm_max_token 3000\n```\n\nKey arguments:\n- `field_names`: Comma-separated list of note fields to analyze\n- `query`: Anki browser query to select cards (defaults to recently failed cards)\n- `dataset_path`: Example prompts for generating explanations\n- `string_formatting`: Custom text formatting functions\n- `ntfy_url`: Optional notifications via ntfy.sh\n- `llm`: LLM model to use in litellm format\n- `embedding_model`: Model for semantic similarity search\n- `llm_max_token`: Maximum tokens per query\n\nAdditional options:\n- `--debug`: Enable debug mode\n- `--force`: Process cards even if they already have explanations\n- `--note_mode`: Don't count cards of the same note twice\n- `--do_sync`: Sync Anki before and after processing\n\n#### Illustrator \nThe Illustrator can be run from the command line:\n\n```bash\npython illustrator.py \\\n    --field_names \"front,back\" \\\n    --query \"(rated:2:1 OR rated:2:2) -is:suspended\" \\\n    --memory_anchors_file \"data\u002Fanchors.json\" \\\n    --dataset_path \"data\u002Fillustrator_dataset.txt\" \\\n    --dataset_sanitize_path \"data\u002Fillustrator_sanitize.txt\" \\\n    --string_formatting \"data\u002Fstring_formatting.py\" \\\n    --ntfy_url \"ntfy.sh\u002FYOUR_TOPIC\" \\\n    --n_image 1\n```\n\nKey arguments:\n- `field_names`: Comma-separated list of note fields to analyze\n- `query`: Anki browser query to select cards (defaults to recently failed cards)\n- `memory_anchors_file`: JSON file mapping concepts to memory anchors\n- `dataset_path`: Example prompts for image generation\n- `dataset_sanitize_path`: Examples for sanitizing unsafe prompts\n- `string_formatting`: Custom text formatting functions\n- `ntfy_url`: Optional notifications via ntfy.sh\n- `n_image`: Number of images to generate per card\n\nAdditional options:\n- `--debug`: Enable debug mode\n- `--force`: Process cards even if they already have illustrations\n- `--disable_notif`: Disable ntfy.sh notifications\n\n\u003C\u002Fdetails>\n\n### Roadmap\n\n\u003Cdetails>\n\u003Csummary>\nClick to read more\n\u003C\u002Fsummary>\n\n\u003Ci>This TODO list is maintained automatically by [MdXLogseqTODOSync](https:\u002F\u002Fgithub.com\u002Fthiswillbeyourgithub\u002FMdXLogseqTODOSync)\u003C\u002Fi>\n\u003C!-- BEGIN_TODO -->\n- turn those scripts into addons (for that, please help me for the rest of the TODO and it should make the addonification more straightforward)\n- ### Applies to all tools\n- load API keys from env variable instead\n- do a unique class that could be used to unify all those codes\n    - arguments:\n        - name (to differentiate each children: for example \"illustrator\")\n        - query\n        - output field name\n        - template\n        - tags_regex (to tell which tags to include in the template)\n        - llm name\n        - embedding_model\n        - llm_max_token\n        - llm_temp\n        - tkn_warn_limit (to know when to stop)\n        - exclude_media\n        - exclude_version\n        - exclude_done\n        - n_note_limit\n        - do_sync\n        - callback (function like ntfy_url)\n        - debug\n        - parallel\n        - force\n        - print_db_then_exit\n    - methods:\n        - string_format (can be overloaded)\n        - load_history\n        - save_history\n        - total_cost\n        - execute_query (to find those cards and apply the filters given by arguments)\n        - loop_over_notes (that check that compute_new_field is indeed declared)\n        - addtags et removetags\n    - note:\n        - in the init, check that indeed there is a version attribute\n        - make sure to use a self.lock\n    - rewrite each script to use this class\n    - the --help should be redirected to the class of each project\n    - make each class use the same entrypoint\n- use toml instead of json? it allows setting comments too\n- use beartype everywhere for static typing and code cleanliness\n- store all inference in a compressed sqlite db instead of a json. It gets too large\n- add check that we indeed removed all the done tags\n- actually there's no need to store the \"Done\" tags because all important info is stored in the field\n- use xml formatting for the examples\n    - make use of \u003Cthinking> tags too\n- tell user how much time each answer took\n- add an arg to include tags or not in the LLM context for a given note, as otherwise the LLM can get confused by some acronyms\n    - but with a regex arg to keep only the tags that match the regex. This way we can keep only a portion of them for the LLM\n- make it installable with a setup.py on pypi\n-\n- ### Mnemonics Creator\n    - Add keybindings\n        - binding e to edit a proposition\n        - binding to restart generation\n        - binding to enter chat mode and construct the mnemonics with him\n-\n- ### Illustrator\n- use an llm to extract numbers\n    - ask it to do quick transformations like turn 48h into 2 days, modify units, etc,\n- add support for note containing media like audio, images etc\n- add a mode without actually creating images. This could be used like a mnemonics after all.\n-\n- ### Reformulator\n- Add 5 to 10 example for the LLM of how to manage media like iimages etc then add support for them\n- make it work with specific fstring template for field replacement. Otherwise it can only reformulate a single field\n    - better: add an arg to specify the single output field, and an arg to specify a comma separated list of input fields\n-\n- ### explainer\n- compute all embeddings at the start, making it faster\n- it's actually quite terrible. Use one LLM call to ask for which follow up questions to ask, then another LLM call to answer each using async\n    - save each new question answer as a \u003Cdetails> tag to make it easy to access on phones by touching the field\n-\n- ### Ankimnemonics\n- comment out the mnemonics that dont respect the rule of adding the subject first\n- understand why it sometimes hangs during a run\n- make it distinguish 'has to appear in plain' vs 'has to appear as mnemonic'?\n-\n- ### AnkiAiFilter\n- use an eval llm like in [wdoc](https:\u002F\u002Fwdoc.readthedocs.io\u002Fen\u002Flatest\u002F) to better filer an anki query\n    - actually wdoc can already be used for that! Maybe it should be converted into an addon?\n-\n- ### Tagger (In project)\n- always prepend tags by ankitagger: but customizable\n- always sort those tags by alphabetical order\n- add modes:\n    - mode \"predefined\": the user gives a list of tags and the LLM finds which to apply to each note given a query\n    - mode \"natural_list\": where the LLM creates the list itself\n        - loop over each note and ask it to generate tags\n        - but also show the list of tags until now\n          then finally loop all over again and ask the LLM to tell which tag from a list should apply after filtering via embeddings\n        - but still allow starting from a premade list\n- arg for image support if media found\n    - if the card contains an image, it should be hashed, then a cached call to a func that asks a vision model to describe the type of image, then use the embedding of this answer to suggest the appropriate tags to suggest to the LLM for classification\n    - image should have their own tags, like \"imagery\", \"decision tree\", \"classification\", \"table\" etc\n\u003C!-- END_TODO -->\n\n## Credits\n\nThis project makes heavy use of [AnkiConnect](https:\u002F\u002Fgit.foosoft.net\u002Falex\u002Fanki-connect) to interact with Anki.\n\u003C\u002Fdetails>\n","# Anki AI 工具集\n一套功能强大的 AI 驱动工具，旨在通过自动优化你难以掌握的卡片来提升你的 [Anki](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FAnki_(software)) 闪卡学习体验，并已在医学院中经过验证。举个例子：每当你答错一张卡片时，系统就会为你生成 ChatGPT 解释、Dall-E 插图、记忆术等，同时也会支持你自定义的记忆法。\n\n**快来看看我在 [GitHub 个人主页](https:\u002F\u002Fgithub.com\u002Fthiswillbeyourgithub) 上的其他 Anki 和 AI 相关项目吧！**\n\n### 简单示例\n**这些脚本可以让每一张答错的卡片自动添加新的字段，包含解释、记忆术和插图等内容。** 这一过程会充分尊重 **你自己的记忆法**，甚至可以结合 [主要记忆系统](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FMnemonic_major_system)，并且还具备 **众多** 其他功能。\n\nAnkiIllustrator 所促进的工作流程的一个示例，请观看 [pixorise 的 YouTube 频道](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=QzxHpjryJHg0)，那里充满了优秀的图像记忆术，尤其适合“记忆宫殿”式的学习方法。\n\n## 开发者注 \u002F 求助呼吁\n这套脚本集合是我为实现自己在医学院入学时就渴望拥有的 AI 功能而不断努力的成果。所有脚本目前应该都能正常运行，不过是在借助 [aider](https:\u002F\u002Faider.chat\u002F) 大量编写文档后匆忙发布的。因此，文档中某些部分可能存在轻微偏差或不够精确的情况。此外，在发布过程中，部分脚本也可能出现了小问题。无论如何，**我怀着满满的热情与用心发布这个项目，就是希望能激励更多人将其打包成 Anki 插件。** 我目前没有足够的时间去学习如何将这些脚本封装成插件并设计相应的用户界面，所以任何帮助都将不胜感激。为此，请查看下面的待办事项清单，并随时提出问题！\n\n## 核心功能\n\n- **自适应学习**：利用 [语义相似度](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FSemantic_similarity) 动态匹配你的卡片与训练数据集中最相关的示例。你添加的示例越多，效果就越出色！\n\n- **个性化记忆钩子**：复用你自定义记忆库中的固定记忆法，构建专属的个性化记忆体系。内置专门的工具，帮助你创建和管理记忆库。\n\n- **自动化就绪**：可编程运行——例如，使用 cron 定时任务自动优化你昨天做错的卡片，通过图片、记忆术和解释使其更易于记忆。\n\n- **通用兼容性**：直接在 Anki 笔记中进行原地修改，可在所有 Anki 客户端（Windows、Mac、Linux、Android、iOS）上无缝工作。丰富的日志记录功能确保你可以追踪更改，并在需要时回滚。\n\n- **提供商无关性**：通过 LiteLLM 支持所有 LLM 提供商和模型，让你根据需求选择最适合的选项。\n\n- **无限可扩展性**：你可以向训练数据集中添加任意数量的示例；语义筛选功能会自动为每张卡片挑选最相关的条目。\n\n## 工具\n\n### Illustrator\n使用 AI 图像生成技术为你的卡片创建定制化的记忆图像。它能够：\n- 分析卡片内容以识别关键概念；\n- 生成富有创意的视觉记忆钩子；\n- 保留已生成图像的历史记录；\n- 同时支持 DALL-E2、DALL-E3 和 Stable Diffusion；\n- 自动调整图像格式，使其居中显示并达到最佳尺寸；\n- 可为每张卡片处理多张图像，且布局保持一致。\n\n非常适合视觉型学习者，或那些从图像中受益较多的复杂主题。\n\nAnkiIllustrator 所促进的工作流程的一个示例，请观看 [pixorise 的 YouTube 频道](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=QzxHpjryJHg0)，那里充满了优秀的图像记忆术，尤其适合“记忆宫殿”式的学习方法。\n\n\u003Cdetails>\n\u003Csummary>\n点击查看示例\n\u003C\u002Fsummary>\n\n例如，我有一张法语闪卡：\n\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fthiswillbeyourgithub_AnkiAIUtils_readme_969e515ba2c4.png)\n\u003Cdetails>\n\u003Csummary>如果看不懂法语，请点这里\u003C\u002Fsummary>\n\n笔记内容翻译成中文如下：\n```\n单纯性热性惊厥的诊断标准：\n- 年龄大于1岁\n- 发热高于38°C (100.4°F) 时出现惊厥\n- 对称性运动表现持续时间少于15分钟且无后遗症\n- 每次发热仅发生一次惊厥\n- 总发作次数不超过3次\n```\n\n\u003C\u002Fdetails>\n\n`illustrator.py` 为我生成了这张图片：\n![](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fthiswillbeyourgithub_AnkiAIUtils_readme_fa493e8ed052.png)\n\n同时还生成了以下文字内容，用于理解其思考过程：（请注意，这部分始终以英文呈现，无论原始语言为何）\n```\n主题：'单纯性热性惊厥的诊断标准'\n记忆锚点：'热性\u002F发烧：壁炉（发音类似 febrile）'\n音标联想：'1 联想为泰语中的 T 音，如 tea、tie；3 联想为 M 音，如 mow、my、meh；8 联想为 F 音，如 fire、faux、few；5 联想为 L 音，如 low、lee、lie'\n备注：\n* 这些标准非常具体，应以易于记忆的方式呈现。\n逐步分解：\n* 年龄大于1岁：一个拿着茶杯的幼儿（T 代表 1）\n* 发热超过38°C 时的惊厥：一个周围环绕火焰的体温计（F 代表 8）\n* 持续时间少于15分钟且无后遗症的对称性运动表现：一只显示15分钟的钟表，两侧有对称移动的两个相同小人\n* 每次发热仅发生一次惊厥：一道闪电击中壁炉（壁炉代表发烧）\n* 总发作次数不超过3次：三支体温计，但只有两支显示高温\n想象画面：\n* 一个拿着茶杯的幼儿站在壁炉旁，一道闪电正击中壁炉。\n* 壁炉上方是一只显示15分钟的钟表，钟表两侧是对称移动的小人。\n* 幼儿旁边是一支周围燃烧着火焰的体温计，以及三支体温计，其中两支显示高温。\n主题：'一个拿着茶杯的幼儿站在被闪电击中的壁炉旁，一只显示15分钟的钟表上有对称的小人，一支燃烧的体温计，还有三支体温计，其中两支显示高温'\n描述词：'教育性、色彩丰富、引人入胜、生动、细致'\n风格：'插画'\n写实程度：'半写实'\n一个拿着茶杯的幼儿站在被闪电击中的壁炉旁，一只显示15分钟的钟表上有对称的小人，一支燃烧的体温计，还有三支体温计，其中两支显示高温，教育性、色彩丰富、引人入胜、生动、细致，插画，半写实\n\n[日期：2024年4月9日 版本：2.5 LLM 模型：openai\u002Fgpt-4-0125-preview 图像模型：openai\u002Fdall-e-3]\n```\n\n\u003C\u002Fdetails>\n\n### 重写器\n一款智能工具，可在保留卡片核心含义和结构的前提下重新措辞你的抽认卡。它在以下情况下非常有用：\n- 卡片表述不佳或不够清晰\n- 想通过变换表达方式来强化记忆\n- 需要让卡片更简洁或更自然流畅\n- 你偏好的卡片格式随着时间推移发生了变化\n\n该工具利用大型语言模型（LLM）对内容进行改写，同时仔细保留填空标记和媒体内容。这对于长期使用Anki的用户尤其有价值——例如，在医学院学习期间，经过几个学期后，你对“完美”抽认卡的理解往往会不断演变。重写器可以帮助你轻松更新所有旧卡片，使其符合当前偏好的格式和风格。\n\n\u003Cdetails>\n\u003Csummary>\n点击查看示例\n\u003C\u002Fsummary>\n\n例如，对于这张表述不佳的抽认卡：\n\n```\n双侧对称性肺泡综合征，靠近肺门，常伴有胸腔积液，应考虑什么？\n{{c1::APE}}\n```\n\n重写器会将其改进为：\n\n```\n在出现双侧对称性肺泡综合征、靠近肺门且常伴有胸腔积液的情况下，应考虑哪些情况？\n{{c1::如果出现双侧对称性肺泡综合征、靠近肺门且常伴有胸腔积液，则应考虑APE。}}\n```\n\n重写器还可以根据需要使卡片更加简洁。例如，它可以将同一张卡片重新格式化为：\n\n```\n双侧对称性肺泡综合征、靠近肺门、常伴有胸腔积液的关键特征：\n- {{c1::考虑APE}}\n```\n\n重写器真正的强大之处在于它的灵活性——唯一的限制就是你的想象力。它可以：\n- 使问题在语法上完整且清晰\n- 将内容组织成规范的问题、项目符号列表、表格，或任何你喜欢的格式\n- 通过在必要时重复关键背景信息，使答案自成一体\n- 调整文字的详略程度，从简明摘要到详细解释\n- 在提高清晰度的同时保留精确的医学术语\n- 在增强内容质量的同时保持填空标记的格式\n- 适应任何格式风格（段落、列表、图表等）\n- 将内容转化为记忆术、类比或记忆宫殿\n- 为复杂主题创建层次化的结构\n- 生成多种变体，以通过交错练习加强记忆\n\n重写器不仅仅是一个用来修复表述不佳卡片的工具，它更是一位创意伙伴，可以帮助你探索新的信息组织和呈现方式。无论你想创建视觉思维导图、构建记忆宫殿，还是开发独特的记忆系统，重写器都能帮助你实现这些想法，同时保持Anki卡片的完整性。\n\n\u003C\u002Fdetails>\n\n\n### 记忆术生成器\n根据你的卡片生成易于记忆的记忆术，具体功能包括：\n- 为每张卡片生成多个记忆术选项\n- 使用成熟的记忆技巧，如[主要系统](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FMnemonic_major_system)\n- 结合你现有的记忆锚点\n- 保留上下文和准确性\n\n有助于建立持久的记忆连接，尤其适用于数字和序列的记忆。\n\n\u003Cdetails>\n\u003Csummary>\n点击查看示例\n\u003C\u002Fsummary>\n\n针对上面关于婴儿热性惊厥的卡片，生成的记忆术最终出现在AnkiMnemonics字段中，内容如下：\n\n---\n\n\n1.  “快乐的赫菲斯托斯发烧了，把他的唯一香蕉伸向火堆”\u003Cbr>* \u003Cb>快乐 \u003C\u002Fb> 年龄大于1岁 \u003Cu> “快乐”让人联想到成熟，因此表示年龄已超过1岁 \u003C\u002Fu>\u003Cbr>* \u003Cb>发烧的赫菲斯托斯 \u003C\u002Fb> 发作时体温高于38°C \u003Cu> 赫菲斯托斯是锻造之神，与火相关，而“发烧”则直接点明了这一概念 \u003C\u002Fu>\u003Cbr>* \u003Cb>伸出他唯一的香蕉 \u003C\u002Fb> 每次发热发作仅有一次惊厥 \u003Cu> “唯一的香蕉”暗示着仅发生一次惊厥 \u003C\u002Fu>\u003Cbr>* \u003Cb>靠近火堆 \u003C\u002Fb> 总发作次数少于3次 \u003Cu> “火堆”象征着发热，而其“靠近”的位置则暗示了数量上的限制，即总发作次数不超过3次 \u003C\u002Fu>\u003Cbr>\u003Cbr>2.  “一个孩子绊倒在火堆里，对称地跳舞，只有一下抽搐，而且火堆不超过三个”\u003Cbr>* \u003Cb>一个孩子绊倒 \u003C\u002Fb> 年龄大于1岁 \u003Cu> 孩子刚开始学步的形象让人联想到刚过1岁的年纪 \u003C\u002Fu>\u003Cbr>* \u003Cb>在火堆里 \u003C\u002Fb> 发作时体温高于38°C \u003Cu> “火堆”代表高温，也就是发热 \u003C\u002Fu>\u003Cbr>* \u003Cb>对称地跳舞 \u003C\u002Fb> 运动症状呈对称性 \u003Cu> “跳舞”意味着运动，“对称地”则表明身体两侧的动作一致 \u003C\u002Fu>\u003Cbr>* \u003Cb>只有一下抽搐 \u003C\u002Fb> 每次发热发作仅有一次惊厥 \u003Cu> “一下”强调了每次发作中惊厥的唯一性 \u003C\u002Fu>\u003Cbr>* \u003Cb>而且火堆不超过三个 \u003C\u002Fb> 总发作次数少于3次 \u003Cu> “火堆不超过三个”用火堆的数量来比喻发热发作的次数，形象地表达了总发作次数不多的概念 \u003C\u002Fu>\u003Cbr>\u003Cbr>3.  “一个发烧的、动作对称的孩子，在草原上锻造了一个独一无二的泡泡”\u003Cbr>* \u003Cb>一个孩子 \u003C\u002Fb> 年龄大于1岁 \u003Cu> “孩子”表明对象是年幼者，因此年龄超过1岁 \u003C\u002Fu>\u003Cbr>* \u003Cb>发烧 \u003C\u002Fb> 发作时体温高于38°C \u003Cu> “发烧”直接关联到发热的概念 \u003C\u002Fu>\u003Cbr>* \u003Cb>对称 \u003C\u002Fb> 运动症状呈对称性 \u003Cu> 直接对应“对称”这一特征 \u003C\u002Fu>\u003Cbr>* \u003Cb>锻造 \u003C\u002Fb> 持续时间少于15分钟且无后遗症 \u003Cu> “锻造”让人联想到短暂而剧烈的动作，就像持续时间短、不会留下后遗症的惊厥一样 \u003C\u002Fu>\u003Cbr>* \u003Cb>独一无二 \u003C\u002Fb> 每次发热发作仅有一次惊厥 \u003Cu> “独一无二”明确了惊厥的唯一性 \u003C\u002Fu>\u003Cbr>* \u003Cb>泡泡 \u003C\u002Fb> 总发作次数少于3次 \u003Cu> “泡泡”象征着稀有和有限，正好对应总发作次数不多的情况 \u003C\u002Fu>\u003Cbr>* \u003Cb>在草原上 \u003C\u002Fb> 体温过高 \u003Cu> “草原”代表着开阔的自然环境，“体温过高”则让人联想到阳光照耀下的草原般炽热的感觉 \u003C\u002Fu>\u003Cbr>\u003Cbr>[日期：2024年4月9日 版本：2.1 模型：openai\u002Fgpt-4-0125-preview]\u003Cbr>\u003Cbr>\u003C!--分隔符-->\n\n---\n\n\u003C\u002Fdetails>\n\n### 解释器\n当你难以理解某些卡片时，提供清晰、详细的解释，具体功能包括：\n- 将复杂概念拆解开来\n- 突出关键关系\n- 补充有用的背景信息\n- 使用类比和示例\n\n尤其有助于理解自己为何答错某张卡片，并填补知识空白。\n\n\u003Cdetails>\n\u003Csummary>\n点击查看示例\n\u003C\u002Fsummary>\n\n针对上面关于婴儿热性惊厥的卡片，生成的记忆术最终出现在AnkiExplainer字段中，内容如下（我将其从法语翻译成英语以便通用记录）：\n\n---\n\n\n* \u003Cb>解释\u003C\u002Fb> 简单性热性惊厥的特点是在发热过程中具有唯一性和短暂性，这有助于将其与其他复杂性惊厥或神经系统疾病区分开来。\u003Cbr>* \u003Cb>机制\u003C\u002Fb> 发热可能会降低某些儿童的惊厥阈值，这就解释了为什么体温升高会在易感人群中引发惊厥。\u003Cbr>\u003Cbr>[日期：2024年4月9日 版本：1.7 LLM模型：openai\u002Fgpt-4-0125-preview]\u003Cbr>\u003Cbr>\u003C!--分隔符-->\n\n---\n\n\u003C\u002Fdetails>\n\n### 记忆术助手\n一款轻量级的交互式命令行工具，用于快速生成记忆术，具备以下功能：\n- 接受一个概念，并查找语义相似的现有记忆术\n- 使用大语言模型生成多个新的记忆术选项\n- 支持通过类似 Vim 的导航方式从生成的选项中选择\n- 自动保存所选记忆术以供日后参考\n- 独立于 Anki 运行，非常适合头脑风暴环节\n\n与批量处理 Anki 卡片的记忆术创建工具不同，此工具提供交互式界面，可逐个概念生成记忆术。这些新记忆术会自动添加到数据集文件中，方便其他工具直接使用，从而快速根据个人创意定制脚本。\n\n\n## 常见问题解答\n\n\u003Cdetails>\n\u003Csummary>\n点击展开\n\u003C\u002Fsummary>\n\n### 这些工具的核心优势是什么？\n基本上，如果您每天晚上运行这些工具来处理当天未能掌握的卡片，您的卡片库质量和学习效率将稳步提升：\n- 自动优化您感到困难的卡片\n- 节省手动改进卡片的时间\n- 建立更牢固的记忆连接\n- 通过详细的历史记录跟踪改进情况\n- 在增强内容的同时保持卡片结构不变\n\n\n### 什么是【主要系统】(Major System)？\n主要系统是一种强大的记忆技巧，它将数字转换为辅音音素，再将这些音素组合成易于记忆的单词。例如：\n- 0 = S 音（如“sea”）\n- 1 = T 音（如“tea”） \n- 2 = N 音（如“new”）\n- 等等。\n\n这样就可以通过将数字转化为单词来更容易地记住它们。例如，“92”可以变成“pen”（P=9，N=2）。\n\n您可以在 [维基百科](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FMnemonic_major_system) 上了解更多相关信息。\n\n### 什么是记忆锚点？\n记忆锚点是您已经非常熟悉的既有联想，可用于构建新的记忆。例如，如果您已经强烈地将“拿破仑”与“法国”联系在一起，那么在学习法国历史的新知识时，就可以以拿破仑作为记忆锚点。\n\n这些工具可以利用您个人的记忆锚点集合，生成基于已有知识的记忆术。\n\n### 支持哪些大语言模型提供商？\n这些工具使用 [LiteLLM](https:\u002F\u002Fdocs.litellm.ai\u002Fdocs\u002F)，它为几乎任何大语言模型提供商提供了统一的接口，包括：\n- OpenAI\n- Anthropic\n- Google\n- [MiniMax](https:\u002F\u002Fwww.minimaxi.com\u002F)（MiniMax-M2.7、MiniMax-M2.7-highspeed — 204K 上下文）\n- OpenRouter\n- Azure\n- AWS Bedrock\n- 本地模型\n- 以及更多\n\n只需按照 LiteLLM 格式指定模型（例如“openai\u002Fgpt-4”、“anthropic\u002Fclaude-3-opus”或“minimax\u002FMiniMax-M2.7”），其余工作将由工具自动完成。对于 MiniMax，请将您的 API 密钥放入 `API_KEYS\u002F` 目录下的名为 `MINIMAX` 的文件中（工具会将其加载为 `MINIMAX_API_KEY`）。\n\n### 支持哪些语言？\n这些工具支持您所选择的大语言模型所支持的任何语言。由于这些脚本通过 LiteLLM 支持几乎所有大语言模型提供商，您可以使用任何对您的语言效果良好的模型。例如：\n- OpenAI 的模型支持 100 多种语言\n- Anthropic 的 Claude 支持 100 多种语言\n- 您也可以使用专门为您的语言训练的本地模型\n- 等等。\n\n这些工具会保留所有语言特定的格式，包括：\n- 从右到左的文字\n- 特殊字符和变音符号\n- 语言特定的标点符号\n- 等等。\n\n### 记忆术是如何工作的？\n记忆术工具使用了几种经过验证的记忆技巧：\n- 数字方面使用【主要系统】(Major System)\n- 生动的图像和可视化\n- 个人记忆锚点\n- 发音相似性\n- 幽默和荒诞\n- 基于故事的关联\n\n这些方法能够创建令人难忘的联想，在保证准确性的同时强化记忆提取能力。\n\n### 在哪里可以找到每个工具的示例数据集？\n`examples\u002F` 文件夹中包含了每个工具的训练数据集和示例文件。虽然这些文件最初是用法语编写的，后来匆忙翻译成英语，但它们仍可作为创建您自己的数据集的良好模板。请参阅下方的“示例文件”部分，了解每个文件的详细信息。\n\n### 该项目的未来发展方向是什么？\n这套工具是在医学院期间学习数万张 Anki 卡片的过程中开发并经过实战检验的。它在高强度学习阶段维护和优化大型抽认卡库方面发挥了巨大作用。\n\n然而，随着科研任务的增加，我现在已无太多时间将这些脚本改造成更加用户友好的软件包。目前这些工具虽然运行良好，但仍需：\n- 打包成正式的 Anki 插件\n- 通过 PyPI 进行安装\n- 代码去重与清理\n- 更完善的文档\n\n我正在积极寻找各层次的贡献者，帮助使这些工具更易于被更广泛的 Anki 社区使用。无论您是经验丰富的开发者还是刚刚入门，我们都欢迎您的参与！我可以根据我在该代码库上的丰富经验提供指导和方向，而您则可以帮助完成打包和分发的技术性工作。\n\n请查看下面的详细路线图，了解需要改进的地方。如果您有兴趣帮助将这些经过实战检验的脚本转化为精良的 Anki 插件，请随时与我联系——我非常乐意与您交流并协助您入门！\n\n### 为什么各个工具之间存在代码重复？\n该项目是在我学习 Python 的过程中，为解决医学院期间的实际需求而逐步发展起来的。每个工具都是在需要时独立开发的，优先考虑功能性而非代码的优雅性。虽然它们都能可靠地运行，但仍有很大的机会围绕共同的 API 统一代码库。\n\n我可以提供详细的重构和整合代码的指导，但我本人没有足够的时间来实施这些改动。如果您有兴趣在保留其经过实战检验的功能性的前提下简化代码库，请查看下面的路线图。\n\n### 我应该在什么情况下使用每个工具？\n- **记忆术创建工具**：最适合记忆数字、序列、列表和抽象概念\n- **插画工具**：非常适合视觉型学习者以及受益于图像表达的复杂主题\n- **改写工具**：当卡片措辞不清晰或希望有多种表述方式时使用。无需担心对格式良好的卡片进行操作——大语言模型经过训练，能够识别并保留符合最佳实践的卡片，避免不必要的更改扰乱您的学习过程\n- **解释工具**：非常适合理解自己为何答错某张卡片，并填补知识空白\n- **记忆术助手**：一款简单的脚本，可通过考虑新主题与您先前记忆术之间的【语义相似性】(Semantic similarity)，快速请求大语言模型生成新的记忆术。\n\n### 如果我在同一张卡片上多次运行脚本，会发生什么？\n对于大多数工具（记忆术生成器、插画师、解释器），之前的内容会使用 `\u003Cdetails>` 和 `\u003Csummary>` 标签保存在一个可折叠的 HTML 区域中。新的内容则显示在这个区域之上。这样可以方便地：\n- 首先查看最新生成的内容\n- 通过展开可折叠区域访问之前的版本\n- 跟踪卡片随时间的变化过程\n\n而“重写器”则有所不同——它会直接替换原始字段的内容，但会将所有之前的版本和元数据保存到一个单独的 `AnkiReformulator` 字段中。这样做既保持了卡片的可读性，又保留了完整的历史记录。\n\n### 我如何追踪哪些卡片被修改过？\n每款工具都会通过标签和元数据仔细记录修改情况，以确保透明性和可逆性。例如，当工具处理一张卡片时，它会添加一个带日期的标签，如 `AnkiIllustrator::done::02\u002F07\u002F2023`。这使得你可以轻松地：\n- 快速识别哪些卡片被每款工具修改过\n- 跟踪修改发生的时间\n- 查找尚未处理的卡片\n- 在需要时回滚更改（尤其是使用“重写器”时）\n\n你可以在 Anki 浏览器中利用这些标签来评估有多少卡片可以从每款工具中受益，并查看已做的修改。需要注意的是，如果某个脚本执行失败，相应的笔记会被加上一个标签，比如 `AnkiI::failed`。\n\n### 运行这些工具的成本是多少？\n成本取决于你的使用模式以及启用的功能：\n- 可以先从小规模开始，用几张卡片熟悉每款工具\n- 内置的安全措施可防止意外超支：\n  - 每次运行的卡片数量可以限制\n  - 每个脚本的费用统计会存储在数据库中\n  - API 调用失败不会计入配额\n  - 你可以设置严格的支出上限\n- 每张卡片的典型成本：\n  - 重写器：约 $0.02–0.04（仅文本）\n  - 记忆术：约 $0.02–0.04（仅文本）\n  - 解释器：约 $0.03–0.06（涉及更复杂的推理）\n  - 插画师：约 $0.02 加上图片费用（每张图片 $0.04–0.12）\n\n数据库会跟踪每个脚本的总支出，便于你进行预算和监控成本。你也可以先使用较便宜的模型进行初步测试，再逐步升级到功能更强的模型。\n\n### 我能在手机上使用这些工具吗？\n虽然你需要在电脑上运行这些脚本（而不是手机），但所有更改都会直接应用到你的 Anki 笔记中。这意味着：\n- 在电脑或服务器上运行脚本\n- 同步电脑端的 Anki\n- 同步后，改进后的卡片会出现在 AnkiMobile 或 AnkiDroid 上\n- 所有生成的内容（改写、记忆术、图片等）在移动端都能完美运行。\n\n### 示例文件\n`examples\u002F` 文件夹中包含一些示例文件，可以帮助你快速入门。请注意，这些示例最初是用法语编写的（系统提示除外），随后被迅速翻译成英语——因此部分示例可能不太通顺，但仍能展示基本用法：\n- `anki_ai_utils_tmux_launcher.sh`：这是我每天早上用来自动处理前一天遇到困难卡片的基于 tmux 的启动脚本。\n- `anchors.json`：示例记忆锚点映射文件\n- `dataset_anchors.txt`：用于记忆锚点处理的训练示例\n- `explainer_dataset.txt`：解释器工具的示例\n- `illustrator_dataset.txt`：用于图像生成的训练数据\n- `illustrator_sanitize_dataset.txt`：用于清理图像提示的示例\n- `mnemonics_dataset.txt`：用于记忆术生成的训练数据\n- `reformulator_dataset.txt`：卡片改写的示例\n- `string_formatting.py`：用于处理隐藏式填空和文本格式化。\n\n### 你不担心大语言模型会产生幻觉吗？\n\n尽管在将大语言模型用作搜索引擎或依赖其压缩的内部知识时，幻觉确实是一个值得关注的问题，但这些工具采用了不同的方法，能够有效降低这种风险：\n\n1. **少样本学习**：通过提供精心设计的示例，我们引导大语言模型遵循特定的模式和格式，从而减少编造信息的可能性。\n2. **结构化输出**：工具会强制执行严格的输出格式，使幻觉更容易被检测和纠正。\n3. **保留源材料**：这些工具并不生成新事实，而是专注于改写和增强你卡片中的现有内容。\n4. **模型无关性**：随着更可靠的新模型出现，你可以轻松切换到它们，而无需改变工作流程。\n\n5. **任务专业化**：通过专注于特定任务（如改写、记忆术生成等），与通用聊天模型相比，幻觉发生的范围被大大缩小。\n\n虽然没有任何系统是完美的，但这种方法在医学院期间经过大量测试已被证明非常可靠。随着大语言模型的不断改进，我们可以预期幻觉现象会越来越少见。\n\n### 数据集文件的格式是什么？\n数据集文件（如 `explainer_dataset.txt`、`reformulator_dataset.txt` 等）是简单的文本文件，消息之间用 `----` 分隔。其中第一条消息被视为系统提示，之后是用户和助手交替发送的消息。这种格式模拟了典型的 LLM 对话流程，同时易于阅读和编辑。\n\n\u003C\u002Fdetails>\n\n## 使用方法 \u002F 入门\n\n\u003Cdetails>\n\u003Csummary>\n点击查看更多\n\u003C\u002Fsummary>\n\n要开始使用这些脚本（在有人帮我把它做成插件之前），大致步骤如下：\n0. **注意：如果你不理解这些步骤，我建议你使用大语言模型自学。步骤会根据你使用的操作系统（macOS、Linux 或 Windows）略有不同，但核心思路是一致的。**\n1. 确保你的终端中已安装 Python。推荐使用 Python 3.12.7 或 3.11.x 版本，因为这是我当时使用的版本。如果尝试使用更新的版本，可能会遇到问题。\n2. 使用 `git clone https:\u002F\u002Fgithub.com\u002Fthiswillbeyourgithub\u002FAnkiAIUtils\u002F` 克隆仓库。\n3. 建议在这个新创建的文件夹中为 Python 创建一个虚拟环境，例如在我的 Linux 系统上可以运行 `uv venv`，然后执行 `source .venv\u002Fbin\u002Factivate`。\n4. 运行某个脚本，请参考下面的各个使用部分。\n\n### 重述器\n重述器可以通过命令行运行：\n\n```bash\npython reformulator.py \\\n    --query \"(rated:2:1 OR rated:2:2) -is:suspended\" \\\n    --dataset_path \"data\u002Freformulator_dataset.txt\" \\\n    --string_formatting \"data\u002Fstring_formatting.py\" \\\n    --ntfy_url \"ntfy.sh\u002FYOUR_TOPIC\" \\\n    --main_field_index 0 \\\n    --llm \"openai\u002Fgpt-4\" \\\n    --embedding_model \"openai\u002Ftext-embedding-3-small\" \\\n    --max_token 4000 \\\n    --llm_temp 0\n```\n\n关键参数：\n- `query`: Anki 浏览器查询语句，用于选择卡片（默认为最近失败的卡片）。\n- `dataset_path`: 用于重述的示例提示。\n- `string_formatting`: 自定义文本格式化函数。\n- `ntfy_url`: 可选的 ntfy.sh 通知地址。\n- `main_field_index`: 需要重述的字段索引（0 表示第一个字段）。\n- `llm`: 使用 litellm 格式的 LLM 模型。\n- `embedding_model`: 用于语义相似度搜索的模型。\n- `max_token`: 每次查询的最大 token 数。\n- `llm_temp`: LLM 的温度参数（0 表示输出一致）。\n\n其他选项：\n- `--debug`: 启用调试模式。\n- `--force`: 即使卡片已经重述过，也强制处理。\n- `--print_db_then_exit`: 显示数据库内容并退出。\n- `--parallel`: 并发进程数（默认 4）。\n- `--exclude_media`: 跳过包含媒体的卡片。\n- `--mode`: 可以是 `reformulate`（重述）或 `reset`（恢复原始内容）。请注意，“reset” 功能并不能完全保证成功，但如果出现问题，我们特意保留了大量的日志，以确保你不会丢失任何数据。\n\n### 记忆术生成器\n记忆术生成器也可以通过命令行运行：\n\n```bash\npython mnemonics.py \\\n    --field_names \"body\" \\\n    --query \"(rated:2:1 OR rated:2:2) -is:suspended\" \\\n    --memory_anchors_file \"data\u002Fanchors.json\" \\\n    --dataset_path \"data\u002Fmnemonics_dataset.txt\" \\\n    --string_formatting \"data\u002Fstring_formatting.py\" \\\n    --ntfy_url \"ntfy.sh\u002FYOUR_TOPIC\" \\\n    --llm \"openrouter\u002Fanthropic\u002Fclaude-3-sonnet\" \\\n    --embedding_model \"openai\u002Ftext-embedding-3-small\" \\\n    --n_mnemonic 1\n```\n\n关键参数：\n- `field_names`: 需要分析的笔记字段列表，用逗号分隔。\n- `query`: Anki 浏览器查询语句，用于选择卡片（默认为最近失败的卡片）。\n- `memory_anchors_file`: 将概念映射到记忆锚点的 JSON 文件。\n- `dataset_path`: 用于生成记忆术的示例提示。\n- `string_formatting`: 自定义文本格式化函数。\n- `ntfy_url`: 可选的 ntfy.sh 通知地址。\n- `llm`: 使用 litellm 格式的 LLM 模型。\n- `embedding_model`: 用于语义相似度搜索的模型。\n- `n_mnemonic`: 每张卡片需要生成的记忆术数量。\n\n其他选项：\n- `--debug`: 启用调试模式。\n- `--force`: 即使卡片已经有记忆术，也强制处理。\n- `--note_mode`: 不重复计算同一张笔记中的卡片。\n- `--do_sync`: 在处理前后同步 Anki 数据。\n\n### 记忆术生成器 CLI\n记忆术生成器 CLI 提供了一个交互式界面来生成记忆术：\n\n```bash\npython mnemonics_creator.py \\\n    --top_k 100 \\\n    --n_gen 10 \\\n    --model \"openrouter\u002Fanthropic\u002Fclaude-3-sonnet\" \\\n    --embed_model \"openai\u002Ftext-embedding-3-small\"\n```\n\n关键参数：\n- `top_k`: 作为示例使用的相似现有记忆术数量（默认 100）。\n- `n_gen`: 每次查询生成的新记忆术数量（默认 10）。\n- `model`: 使用 litellm 格式的 LLM 模型。\n- `embed_model`: 用于语义相似度搜索的模型。\n- `query`: 可选的初始查询。\n- `gui`: 启用 GUI 界面（尚未实现）。\n\nCLI 提供了一个交互式界面，你可以：\n- 输入要生成记忆术的概念。\n- 查看相关的现有记忆术作为参考。\n- 从多个生成的选项中选择。\n- 使用 vim 风格的键（j\u002Fk）或数字键进行导航。\n- 将选定的记忆术保存到你的收藏中。\n\n### 解释器\n解释器可以通过命令行运行：\n\n```bash\npython explainer.py \\\n    --field_names \"body\" \\\n    --query \"(rated:2:1 OR rated:2:2) -is:suspended\" \\\n    --dataset_path \"data\u002Fexplainer_dataset.txt\" \\\n    --string_formatting \"data\u002Fstring_formatting.py\" \\\n    --ntfy_url \"ntfy.sh\u002FYOUR_TOPIC\" \\\n    --llm \"openrouter\u002Fanthropic\u002Fclaude-3-sonnet\" \\\n    --embedding_model \"openai\u002Ftext-embedding-3-small\" \\\n    --llm_max_token 3000\n```\n\n关键参数：\n- `field_names`: 需要分析的笔记字段列表，用逗号分隔。\n- `query`: Anki 浏览器查询语句，用于选择卡片（默认为最近失败的卡片）。\n- `dataset_path`: 用于生成解释的示例提示。\n- `string_formatting`: 自定义文本格式化函数。\n- `ntfy_url`: 可选的 ntfy.sh 通知地址。\n- `llm`: 使用 litellm 格式的 LLM 模型。\n- `embedding_model`: 用于语义相似度搜索的模型。\n- `llm_max_token`: 每次查询的最大 token 数。\n\n其他选项：\n- `--debug`: 启用调试模式。\n- `--force`: 即使卡片已经有解释，也强制处理。\n- `--note_mode`: 不重复计算同一张笔记中的卡片。\n- `--do_sync`: 在处理前后同步 Anki 数据。\n\n### 插画师\n插画师也可以通过命令行运行：\n\n```bash\npython illustrator.py \\\n    --field_names \"front,back\" \\\n    --query \"(rated:2:1 OR rated:2:2) -is:suspended\" \\\n    --memory_anchors_file \"data\u002Fanchors.json\" \\\n    --dataset_path \"data\u002Fillustrator_dataset.txt\" \\\n    --dataset_sanitize_path \"data\u002Fillustrator_sanitize.txt\" \\\n    --string_formatting \"data\u002Fstring_formatting.py\" \\\n    --ntfy_url \"ntfy.sh\u002FYOUR_TOPIC\" \\\n    --n_image 1\n```\n\n关键参数：\n- `field_names`: 需要分析的笔记字段列表，用逗号分隔。\n- `query`: Anki 浏览器查询语句，用于选择卡片（默认为最近失败的卡片）。\n- `memory_anchors_file`: 将概念映射到记忆锚点的 JSON 文件。\n- `dataset_path`: 用于生成插图的示例提示。\n- `dataset_sanitize_path`: 用于净化不安全提示的示例。\n- `string_formatting`: 自定义文本格式化函数。\n- `ntfy_url`: 可选的 ntfy.sh 通知地址。\n- `n_image`: 每张卡片需要生成的图片数量。\n\n其他选项：\n- `--debug`: 启用调试模式。\n- `--force`: 即使卡片已经有插图，也强制处理。\n- `--disable_notif`: 禁用 ntfy.sh 通知。\n\u003C\u002Fdetails>\n\n### 路线图\n\n\u003Cdetails>\n\u003Csummary>\n点击查看更多\n\u003C\u002Fsummary>\n\n\u003Ci>此待办事项列表由 [MdXLogseqTODOSync](https:\u002F\u002Fgithub.com\u002Fthiswillbeyourgithub\u002FMdXLogseqTODOSync) 自动维护\u003C\u002Fi>\n\u003C!-- BEGIN_TODO -->\n- 将这些脚本改造成插件（为此，请帮助我完成剩余的待办事项，这样插件化过程会更加直接）\n- ### 适用于所有工具\n- 改为从环境变量加载 API 密钥\n- 创建一个通用类，用于统一所有代码\n    - 参数：\n        - name（用于区分不同子模块：例如“illustrator”）\n        - query\n        - 输出字段名\n        - template\n        - tags_regex（用于指定模板中包含哪些标签）\n        - llm 名称\n        - embedding_model\n        - llm_max_token\n        - llm_temp\n        - tkn_warn_limit（用于判断何时停止）\n        - exclude_media\n        - exclude_version\n        - exclude_done\n        - n_note_limit\n        - do_sync\n        - callback（如 ntfy_url 的函数）\n        - debug\n        - parallel\n        - force\n        - print_db_then_exit\n    - 方法：\n        - string_format（可被重载）\n        - load_history\n        - save_history\n        - total_cost\n        - execute_query（查找卡片并应用参数中的过滤条件）\n        - loop_over_notes（检查是否确实声明了 compute_new_field）\n        - addtags 和 removetags\n    - 注意事项：\n        - 在初始化时，检查是否确实存在 version 属性\n        - 确保使用 self.lock\n    - 重写每个脚本以使用该类\n    - 将 --help 重定向到每个项目的类\n    - 使每个类使用相同的入口点\n- 使用 toml 替代 json？它还支持设置注释\n- 在所有地方使用 beartype 进行静态类型检查和代码整洁化\n- 将所有推理结果存储在压缩的 sqlite 数据库中，而不是 json 文件。后者会变得过于庞大\n- 添加检查，确保已移除所有“已完成”标签\n- 实际上无需存储“已完成”标签，因为所有重要信息都已存储在字段中\n- 对示例使用 xml 格式\n    - 同时利用 \u003Cthinking> 标签\n- 告知用户每次回答花费的时间\n- 添加一个参数，用于控制是否将标签纳入 LLM 的上下文中，否则 LLM 可能会被某些缩写词混淆\n    - 但通过 regex 参数仅保留与正则表达式匹配的标签。这样我们可以只让 LLM 处理部分标签\n- 使其可以通过 setup.py 在 pypi 上安装\n-\n- ### 记忆术生成器\n    - 添加快捷键\n        - 绑定 e 键编辑命题\n        - 绑定重新开始生成\n        - 绑定进入聊天模式并与用户共同构建记忆术\n-\n- ### 插画师\n- 使用 LLM 提取数字\n    - 请求 LLM 进行快速转换，例如将 48 小时转换为 2 天、单位换算等\n- 增加对包含音频、图片等媒体的笔记的支持\n- 添加一种不实际生成图像的模式。这实际上也可以用作记忆术\n-\n- ### 重构器\n- 为 LLM 提供 5 到 10 个处理图片等媒体的示例，然后增加对它们的支持\n- 使其能够使用特定的 fstring 模板进行字段替换。否则它只能重构单个字段\n    - 更好的做法是添加一个参数来指定输出字段，以及一个参数来指定输入字段的逗号分隔列表\n-\n- ### 解释器\n- 在开始时计算所有嵌入向量，从而提高速度\n- 目前的实现相当糟糕。可以先用一次 LLM 调用来确定需要提出哪些后续问题，然后再用另一次 LLM 调用异步回答每个问题\n    - 将每个新问题的答案保存为 \u003Cdetails> 标签，以便在手机上只需轻触字段即可轻松访问\n-\n- ### Ankimnemonics\n- 注释掉那些不遵守先添加主题规则的记忆术\n- 弄清楚为什么有时运行过程中会卡住\n- 使其能够区分“必须以明文形式出现”和“必须以记忆术形式出现”？\n-\n- ### AnkiAiFilter\n- 使用类似于 [wdoc](https:\u002F\u002Fwdoc.readthedocs.io\u002Fen\u002Flatest\u002F) 中的评估 LLM 来更好地过滤 Anki 查询\n    - 实际上 wdoc 已经可以用于此目的！也许应该将其转换为插件？\n-\n- ### 标签器（正在进行中）\n- 总是将标签前缀为 ankitagger:，但可自定义\n- 总是按字母顺序对这些标签排序\n- 添加模式：\n    - “预设”模式：用户提供标签列表，LLM 根据查询为每条笔记找到应应用的标签\n    - “自然列表”模式：LLM 自己创建标签列表\n        - 遍历每条笔记，请求 LLM 生成标签\n        - 同时显示迄今为止的标签列表\n        - 最后再次遍历，并请求 LLM 根据嵌入向量筛选出应适用的标签\n        - 但仍允许从预先准备好的列表开始\n- 如果发现媒体，则添加图像支持的参数\n    - 如果卡片包含图像，应先对其进行哈希处理，然后缓存调用一个视觉模型来描述图像类型，再利用该回答的嵌入向量，为 LLM 推荐合适的分类标签\n    - 图像应有其专属标签，如“图像”、“决策树”、“分类”、“表格”等\n\u003C!-- END_TODO -->\n\n## 致谢\n\n本项目大量使用了 [AnkiConnect](https:\u002F\u002Fgit.foosoft.net\u002Falex\u002Fanki-connect) 与 Anki 进行交互。\n\u003C\u002Fdetails>","# AnkiAIUtils 快速上手指南\n\nAnkiAIUtils 是一套强大的 AI 工具集，旨在通过自动生成解释、助记符（Mnemonics）和插图来增强你的 Anki 卡片学习体验。它特别擅长利用语义相似度匹配你自定义的训练数据，并支持保留你个人的记忆锚点。\n\n## 环境准备\n\n在开始之前，请确保你的开发环境满足以下要求：\n\n*   **操作系统**: Windows, macOS 或 Linux。\n*   **Python**: 版本 3.8 或更高。\n*   **Anki**: 已安装并包含需要处理的卡片库。\n*   **LLM API Key**: 你需要一个支持的 LLM 提供商 API Key（如 OpenAI, Anthropic 等）。本项目通过 `LiteLLM` 实现提供商无关性。\n*   **图像生成 API (可选)**: 如果使用插图功能，需要 DALL-E 2\u002F3 或 Stable Diffusion 的 API Key。\n\n**前置依赖安装**:\n建议使用虚拟环境以避免依赖冲突。\n\n```bash\npython -m venv venv\n# Windows\nvenv\\Scripts\\activate\n# macOS\u002FLinux\nsource venv\u002Fbin\u002Factivate\n\n# 安装核心依赖 (假设项目根目录有 requirements.txt)\npip install -r requirements.txt\n```\n\n> **注意**: 如果 `requirements.txt` 中包含国内难以访问的源，建议在 `pip install` 时添加清华或阿里镜像源加速：\n> `pip install -r requirements.txt -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple`\n\n## 安装步骤\n\n由于该项目目前主要以脚本形式发布（尚未打包为 Anki 插件），安装过程即克隆代码库并配置环境变量。\n\n1.  **克隆仓库**:\n    ```bash\n    git clone https:\u002F\u002Fgithub.com\u002Fthiswillbeyourgithub\u002FAnkiAIUtils.git\n    cd AnkiAIUtils\n    ```\n\n2.  **配置 API Key**:\n    项目依赖环境变量来读取 API Key。你可以直接在终端设置，或创建 `.env` 文件。\n\n    *   **临时设置 (终端)**:\n        ```bash\n        # Linux\u002FmacOS\n        export OPENAI_API_KEY=\"sk-...\"\n        export LITELLM_MODEL=\"openai\u002Fgpt-4o\" \n        \n        # Windows PowerShell\n        $env:OPENAI_API_KEY=\"sk-...\"\n        $env:LITELLM_MODEL=\"openai\u002Fgpt-4o\"\n        ```\n\n    *   **永久设置 (.env 文件)**:\n        在项目根目录创建 `.env` 文件：\n        ```env\n        OPENAI_API_KEY=sk-your-key-here\n        LITELLM_MODEL=openai\u002Fgpt-4o\n        # 如果需要图像生成\n        IMAGE_MODEL=openai\u002Fdall-e-3\n        ```\n\n3.  **验证安装**:\n    运行任意脚本的帮助命令以确认依赖加载正常（具体命令视脚本而定，通常如下）：\n    ```bash\n    python illustrator.py --help\n    ```\n\n## 基本使用\n\nAnkiAIUtils 包含三个核心工具：**Illustrator** (生成插图), **Reformulator** (重写卡片), 和 **Mnemonics Creator** (生成助记符)。所有脚本直接修改 Anki 数据库中的笔记字段。\n\n### 1. 生成助记符与解释 (Mnemonics & Explanations)\n\n此功能会分析你标记为“困难”的卡片，生成包含助记符、主要系统（Major System）编码和详细解释的新字段。\n\n**使用示例**:\n假设你想处理昨天失败的卡片，并生成助记符：\n\n```bash\npython mnemonics_creator.py --deck \"Medical School::Cardiology\" --days-ago 1 --limit 10\n```\n\n*   `--deck`: 指定要处理的 Anki 牌组名称。\n*   `--days-ago`: 仅处理过去 X 天内复习过的卡片。\n*   `--limit`: 限制本次运行的卡片数量（建议首次运行时设小值测试）。\n\n脚本执行后，会在对应的笔记中添加一个新字段（通常命名为 `AnkiMnemonics` 或类似名称），内容包含多个助记选项及其原理解析。\n\n### 2. 生成记忆插图 (Illustrator)\n\n为卡片生成基于内容的视觉记忆钩子（Visual Hooks），支持 DALL-E 3 和 Stable Diffusion。\n\n**使用示例**:\n为特定牌组的卡片生成插图：\n\n```bash\npython illustrator.py --deck \"Medical School::Pharmacology\" --model openai\u002Fdall-e-3 --style \"semi-realistic\"\n```\n\n*   该脚本会自动分析卡片内容，提取关键概念（Anchors）。\n*   生成图像并自动调整格式（居中、适当大小）插入到笔记的图片字段中。\n*   同时会生成一段文本日志，解释 AI 生成图像的构思过程（Prompt 分解）。\n\n### 3. 智能重写卡片 (Reformulator)\n\n优化表述不清的卡片，使其更符合你当前的记忆习惯，同时保留挖空（Cloze）格式和媒体资源。\n\n**使用示例**:\n批量优化旧卡片的措辞：\n\n```bash\npython reformulator.py --deck \"All\" --format-style \"concise_question\" --preserve-cloze true\n```\n\n*   `--format-style`: 定义目标格式（如：简洁问答、列表形式、完整句子等）。\n*   `--preserve-cloze`: 确保不破坏原有的 `{{c1::...}}` 挖空结构。\n*   此工具非常适合统一整个牌组的风格，或将早期的粗糙笔记升级为高质量笔记。\n\n### 自动化工作流建议\n\n你可以结合系统的定时任务（如 Linux 的 `cron` 或 Windows 的任务计划程序）实现自动化。例如，每天凌晨自动处理前一天复习失败的卡片：\n\n```bash\n# Crontab 示例：每天早上 7 点运行助记符生成器\n0 7 * * * cd \u002Fpath\u002Fto\u002FAnkiAIUtils && source venv\u002Fbin\u002Factivate && python mnemonics_creator.py --failed-since-yesterday\n```\n\n> **重要提示**: 所有脚本均直接修改 Anki 数据库。在首次大规模运行前，请务必在 Anki 中**备份你的集合 (File -> Export -> Anki Collection Package)**，以便在效果不满意时回滚。","医学生小林在备考病理学时，面对大量复杂的机制卡片反复记忆失败，传统复习方式让他陷入瓶颈。\n\n### 没有 AnkiAIUtils 时\n- **解释匮乏**：每次记错卡片，只能手动查阅厚重的教材或搜索零散的网络资料，耗时且难以获得针对该知识点的精准解释。\n- **记忆钩子缺失**：对于抽象的生化通路或解剖结构，缺乏生动的助记符（Mnemonics），只能依靠死记硬背，遗忘速度极快。\n- **视觉化困难**：大脑难以构建抽象概念的图像，而手动绘制或使用搜索引擎寻找匹配的图片效率极低，且往往不够直观。\n- **复习策略僵化**：无法根据个人的记忆薄弱点动态调整学习内容，所有卡片“一视同仁”，导致时间在已掌握内容上被浪费。\n- **个性化不足**：现有的辅助工具无法识别和利用小林自己习惯的记忆逻辑，生成的内容往往与他的思维模式不兼容。\n\n### 使用 AnkiAIUtils 后\n- **智能即时解析**：每当小林标记卡片为“忘记”，AnkiAIUtils 自动调用大模型生成简明扼要的定制化解释，直接填充到卡片字段，无需跳出软件查书。\n- **专属助记生成**：工具结合小林预设的个人助记库，自动生成符合他思维习惯的口诀或联想故事，甚至能利用“主要系统”将数字编码为图像。\n- **一键视觉增强**：针对难懂的病理机制，AnkiAIUtils 自动调用 DALL-E 3 或 Stable Diffusion 生成精准的示意图，将抽象文字转化为直观的“记忆宫殿”素材。\n- **自适应学习流**：基于语义相似度分析，工具自动从历史数据中匹配最相关的案例补充到错题中，让复习内容随小林的进度动态进化。\n- **无缝兼容体验**：所有增强内容直接写入本地 Anki 笔记，完美同步至手机和电脑端，小林在任何设备上都能享受到升级后的学习体验。\n\nAnkiAIUtils 将原本枯燥低效的“死记硬背”转变为个性化的“智能内化”过程，让每一次犯错都成为构建深度记忆的契机。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fthiswillbeyourgithub_AnkiAIUtils_1846d445.png","thiswillbeyourgithub","Olivier Cornelis","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fthiswillbeyourgithub_bb017cbe.png","🧠 + 🩺 + 💻 = 🧑‍⚕️me🧑‍⚕️\r\n\r\nMore details at olicorne.org","olicorp","Paris, France",null,"https:\u002F\u002Folicorne.org","https:\u002F\u002Fgithub.com\u002Fthiswillbeyourgithub",[82],{"name":83,"color":84,"percentage":85},"Python","#3572A5",100,842,28,"2026-04-08T11:29:57","AGPL-3.0",4,"Windows, macOS, Linux, Android, iOS","未说明（支持通过 LiteLLM 调用云端 API，本地运行 Stable Diffusion 时通常建议具备 GPU，但文中未指定具体型号或显存要求）","未说明",{"notes":95,"python":93,"dependencies":96},"该工具是一套直接修改 Anki 笔记的脚本集合，目前尚未打包为 Anki 插件，需手动运行。核心特性是‘模型无关’，通过 LiteLLM 支持所有主流 LLM 提供商（如 OpenAI DALL-E\u002FGPT），因此主要依赖网络 API 而非本地重型模型。若用户选择本地部署 Stable Diffusion 进行绘图，则需自行配置相应的本地 AI 环境。作者呼吁社区协助将其打包为带图形界面的 Anki 插件。",[97],"LiteLLM",[14,15,35],[100,101,102,103,104,105,106,107,108,109,110,111],"anki","dalle-2","dalle-3","illustrations","learning","llm","medical","mnemonics","openai","spaced-repetition","stable-diffusion","summary","2026-03-27T02:49:30.150509","2026-04-09T09:28:33.643870",[115,120,125],{"id":116,"question_zh":117,"answer_zh":118,"source_url":119},25924,"在 macOS 上安装依赖时，为什么会出现意外构建 grpcio 的情况导致安装失败？","这通常是由于 Python 版本不兼容导致的。如果您使用的是较新的 Python 版本（如 3.13），某些依赖包可能没有预编译的二进制文件（wheel），从而触发源码构建过程并引发错误。解决方案是将 Python 版本切换到 3.11。切换后再次运行 `pip3 install -r requirements.txt` 即可顺利安装。","https:\u002F\u002Fgithub.com\u002Fthiswillbeyourgithub\u002FAnkiAIUtils\u002Fissues\u002F9",{"id":121,"question_zh":122,"answer_zh":123,"source_url":124},25925,"requirements.txt 文件中是否缺少了 py-ankiconnect 依赖？","是的，该项目已确认 `py-ankiconnect` 应该被包含在 `requirements.txt` 中。维护者已在后续更新（Issue #5）中修复了此问题。如果您遇到缺失该包的错误，请确保拉取了最新的代码仓库，或者手动运行 `pip install py-ankiconnect` 进行安装。","https:\u002F\u002Fgithub.com\u002Fthiswillbeyourgithub\u002FAnkiAIUtils\u002Fissues\u002F1",{"id":126,"question_zh":127,"answer_zh":128,"source_url":129},25926,"为什么 GitHub README 文档的大部分内容被隐藏，只显示了 reformulator 示例？","这是由于 README 文件的 Markdown 语法结构问题导致的，具体内容被错误地折叠在了示例部分。这是一个文档显示层面的 Bug，用户可以直接查看仓库中的原始 Markdown 文件，或者等待维护者修复语法以正常展开阅读完整文档。","https:\u002F\u002Fgithub.com\u002Fthiswillbeyourgithub\u002FAnkiAIUtils\u002Fissues\u002F2",[]]