Use AI to develop MarginNote templates and add-ons
This documentation site is built with Mintlify as an AI-native docs site. That means AI tools can make full use of the services offered here to read, search, ask questions, and produce content quickly.
Copy this prompt to let AI get started
AI-native services
This site provides llms.txt, llms-full.txt, skill.md, and an MCP server so that AI tools can read the documentation as reference material for writing add-ons and templates.
Connect to your AI tool
Click the small arrow next to the Copy page button at the top of any page to feed this documentation to ChatGPT, Claude, VS Code, or another AI tool. You can also install the site as a personal MCP server, or copy the page text and paste it into your AI tool.
We recommend using the MCP server for add-on development. It also helps us improve this documentation.
Generate code that follows the MN Rails conventions
You can certainly build an add-on step by step by following this documentation, but we recommend creating the project with MN Rails instead.MN Rails generates a project layout that follows the MarginNote add-on conventions, ships a rich set of templates and scaffolds, and keeps AI-assisted development effective and consistent.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Marginnote Dev Docs","description":"Marginnote 开发文档","colors":{"primary":"#2463EB","light":"#2FAFFA","dark":"#003EB3"},"logo":{"light":"https://mintcdn.com/museday/y1Bz2GSS2JNGRZOc/images/marginnote-logo-light.svg?fit=max\u0026auto=format\u0026n=y1Bz2GSS2JNGRZOc\u0026q=85\u0026s=1ccb00655fe9a2b34470692fba763927","dark":"https://mintcdn.com/museday/y1Bz2GSS2JNGRZOc/images/marginnote-logo-dark.svg?fit=max\u0026auto=format\u0026n=y1Bz2GSS2JNGRZOc\u0026q=85\u0026s=b5383a7b12c0bb1c00c7b2c9713e1d05"},"favicon":{"light":"https://mintcdn.com/museday/BRabgiuiRoq1Eyyd/images/favicon.png?fit=max\u0026auto=format\u0026n=BRabgiuiRoq1Eyyd\u0026q=85\u0026s=916fbcd344837f6d60b80b59eb43aa44","dark":"https://mintcdn.com/museday/BRabgiuiRoq1Eyyd/images/favicon.png?fit=max\u0026auto=format\u0026n=BRabgiuiRoq1Eyyd\u0026q=85\u0026s=916fbcd344837f6d60b80b59eb43aa44"},"api":{"playground":{"display":"simple","proxy":false}},"seo":{"indexing":"all"},"icons":{"library":"fontawesome"},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","add-mcp","cursor","vscode","grok","aistudio"],"display":"header"},"styling":{"latex":false},"navigation":{"languages":[{"language":"zh-CN","default":true,"navbar":{"links":[{"href":"https://www.marginnote.com.cn/","label":"官网"},{"href":"https://bbs.marginnote.com.cn/","label":"论坛"},{"href":"https://manual.marginnote.com.cn/mn4/","label":"使用手册"}]},"href":"zh/introduction"},{"language":"en","navbar":{"links":[{"href":"https://www.marginnote.com/","label":"Official Site"},{"href":"https://forum.marginnote.com/","label":"Forum"},{"href":"https://manual.marginnote.com.cn/mn4/en/","label":"Manual"}]},"href":"en/introduction"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"museday","hasAudioNarration":false,"actualSubdomain":"museday","customDomains":["dev.marginnote.com.cn"],"gitSource":{"type":"github","owner":"temsys-shen","repo":"marginnote-extension-docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"feedback":{"thumbs":true,"edits":true,"issues":true,"agentFeedback":false},"entitlements":{"AI_CHAT":{"status":"DISABLED"},"WEB_MCP":{"status":"DISABLED"},"NARRATION":{"status":"DISABLED"}},"buildId":"6af8225259fc4106fcc29baf","clientVersion":"0.0.4143","searchFilterCounts":[{"language":"zh-CN","tag":"API 参考","count":105},{"language":"zh-CN","tag":"手写会话","count":35},{"language":"zh-CN","tag":"卡片与摘录","count":28},{"language":"zh-CN","tag":"模板配置","count":9},{"language":"zh-CN","tag":"学习集与卡组","count":9},{"language":"en","tag":"Basics","count":7},{"language":"zh-CN","tag":"基础","count":7},{"language":"zh-CN","tag":"导出与 Anki","count":7},{"language":"zh-CN","tag":"文档与页面","count":7},{"language":"en","tag":"Add-ons In-Depth","count":5},{"language":"zh-CN","tag":"深入插件","count":5},{"language":"zh-CN","tag":"任务包与同步诊断","count":4},{"language":"en","tag":"Getting Started","count":2}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"en/ai-dev","slug":"/en/ai-dev","pageMetadata":{"title":"Building with AI","description":"Use AI to develop MarginNote templates and add-ons","href":"/en/ai-dev"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Use AI to develop MarginNote templates and add-ons\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,..._provideComponents(),...props.components},{Heading,Prompt,Tip}=_components;if(!Heading)_missingMdxReference(`Heading`,true);if(!Prompt)_missingMdxReference(`Prompt`,true);if(!Tip)_missingMdxReference(`Tip`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`This documentation site is built with `,_jsx(_components.a,{href:`https://mintlify.com/`,children:`Mintlify`}),` as an AI-native docs site. That means AI tools can make full use of the services offered here to read, search, ask questions, and produce content quickly.`]}),`\n`,_jsx(Prompt,{description:`Copy this prompt to let AI get started`,actions:[`copy`],children:`Read [https://dev.marginnote.com.cn/en/ai-dev](https://dev.marginnote.com.cn/en/ai-dev), understand the documentation, confirm what the user wants, and help the user develop MarginNote add-ons and templates.`}),`\n`,_jsx(Heading,{level:`1`,id:`ai-native-services`,children:`AI-native services`}),`\n`,_jsxs(_components.p,{children:[`This site provides `,_jsx(_components.a,{href:`/llms.txt`,children:_jsx(_components.code,{children:`llms.txt`})}),`, `,_jsx(_components.a,{href:`/llms-full.txt`,children:_jsx(_components.code,{children:`llms-full.txt`})}),`, `,_jsx(_components.a,{href:`/skill.md`,children:_jsx(_components.code,{children:`skill.md`})}),`, and an MCP server so that AI tools can read the documentation as reference material for writing add-ons and templates.`]}),`\n`,_jsx(Heading,{level:`2`,id:`connect-to-your-ai-tool`,children:`Connect to your AI tool`}),`\n`,_jsxs(_components.p,{children:[`Click the small arrow next to the `,_jsx(_components.code,{children:`Copy page`}),` button at the top of any page to feed this documentation to ChatGPT, Claude, VS Code, or another AI tool. You can also install the site as a personal MCP server, or copy the page text and paste it into your AI tool.`]}),`\n`,_jsx(Tip,{children:_jsx(_components.p,{children:`We recommend using the MCP server for add-on development. It also helps us improve this documentation.`})}),`\n`,_jsx(Heading,{level:`1`,id:`generate-code-that-follows-the-mn-rails-conventions`,children:`Generate code that follows the MN Rails conventions`}),`\n`,_jsxs(_components.p,{children:[`You can certainly build an add-on step by step by following this documentation, but we recommend creating the project with `,_jsx(_components.a,{href:`/en/mnrails`,children:`MN Rails`}),` instead.`]}),`\n`,_jsx(_components.p,{children:`MN Rails generates a project layout that follows the MarginNote add-on conventions, ships a rich set of templates and scaffolds, and keeps AI-assisted development effective and consistent.`})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Building with AI","description":"Use AI to develop MarginNote templates and add-ons","href":"/en/ai-dev"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"AI-native services","slug":"ai-native-services","depth":1,"children":[]},{"title":"Connect to your AI tool","slug":"connect-to-your-ai-tool","depth":2,"children":[]},{"title":"Generate code that follows the MN Rails conventions","slug":"generate-code-that-follows-the-mn-rails-conventions","depth":1,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"museday","siteName":"Marginnote Dev Docs","title":"Building with AI - Marginnote Dev Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"zh-CN":{"href":"/zh/ai-dev","matchLevel":1},"en":{"href":"/en/ai-dev","matchLevel":0}}},"lastModified":"2026-11-10T15:24:57.224Z","originalFileLocation":"en/ai-dev.mdx","locale":"en"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Use AI to develop MarginNote templates and add-ons\">\u003cmeta data-mint-head name=\"application-name\" content=\"Marginnote Dev Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/museday/1Jpv9N0JGK_nIPGC/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/museday/1Jpv9N0JGK_nIPGC/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/museday/1Jpv9N0JGK_nIPGC/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/museday/1Jpv9N0JGK_nIPGC/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/museday/1Jpv9N0JGK_nIPGC/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/museday/1Jpv9N0JGK_nIPGC/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/museday/1Jpv9N0JGK_nIPGC/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/museday/1Jpv9N0JGK_nIPGC/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/museday/1Jpv9N0JGK_nIPGC/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Building with AI - Marginnote Dev Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Use AI to develop MarginNote templates and add-ons\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Marginnote Dev Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://dev.marginnote.com.cn/en/ai-dev\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://museday.mintlify.site/_mintlify/api/og/v2?division=Getting+Started\u0026amp;title=Building+with+AI\u0026amp;description=Use+AI+to+develop+MarginNote+templates+and+add-ons\u0026amp;theme=4d23c94a9203ce15466fab0a\u0026amp;signature=2680ab65e2734530647c357d55c7eff2638b7f3330aabca903084afd05d15c27\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Building with AI - Marginnote Dev Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Use AI to develop MarginNote templates and add-ons\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://museday.mintlify.site/_mintlify/api/og/v2?division=Getting+Started\u0026amp;title=Building+with+AI\u0026amp;description=Use+AI+to+develop+MarginNote+templates+and+add-ons\u0026amp;theme=4d23c94a9203ce15466fab0a\u0026amp;signature=2680ab65e2734530647c357d55c7eff2638b7f3330aabca903084afd05d15c27\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/museday/1Jpv9N0JGK_nIPGC/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Marginnote Dev Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#2463EB\">\u003clink data-mint-head rel=\"canonical\" href=\"https://dev.marginnote.com.cn/en/ai-dev\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/en/ai-dev.md\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"en\" href=\"https://dev.marginnote.com.cn/en/ai-dev\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"zh-CN\" href=\"https://dev.marginnote.com.cn/zh/ai-dev\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"x-default\" href=\"https://dev.marginnote.com.cn/zh/ai-dev\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://dev.marginnote.com.cn/#organization\",\"name\":\"Marginnote Dev Docs\",\"url\":\"https://dev.marginnote.com.cn\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/museday/y1Bz2GSS2JNGRZOc/images/marginnote-logo-light.svg?fit=max\u0026auto=format\u0026n=y1Bz2GSS2JNGRZOc\u0026q=85\u0026s=1ccb00655fe9a2b34470692fba763927\"}},{\"@type\":\"WebSite\",\"@id\":\"https://dev.marginnote.com.cn#website\",\"name\":\"Marginnote Dev Docs\",\"url\":\"https://dev.marginnote.com.cn\",\"publisher\":{\"@id\":\"https://dev.marginnote.com.cn/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://dev.marginnote.com.cn/en/ai-dev#webpage\",\"url\":\"https://dev.marginnote.com.cn/en/ai-dev\",\"name\":\"Building with AI\",\"description\":\"Use AI to develop MarginNote templates and add-ons\",\"dateModified\":\"2026-11-10T15:24:57.224Z\",\"isPartOf\":{\"@id\":\"https://dev.marginnote.com.cn#website\"},\"breadcrumb\":{\"@id\":\"https://dev.marginnote.com.cn/en/ai-dev#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://dev.marginnote.com.cn/en/ai-dev#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Getting Started\",\"item\":\"https://dev.marginnote.com.cn/en/introduction\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Building with AI\",\"item\":\"https://dev.marginnote.com.cn/en/ai-dev\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://dev.marginnote.com.cn/en/ai-dev#article\",\"headline\":\"Building with AI\",\"name\":\"Building with AI\",\"description\":\"Use AI to develop MarginNote templates and add-ons\",\"url\":\"https://dev.marginnote.com.cn/en/ai-dev\",\"mainEntityOfPage\":{\"@id\":\"https://dev.marginnote.com.cn/en/ai-dev#webpage\"},\"dateModified\":\"2026-11-10T15:24:57.224Z\",\"publisher\":{\"@id\":\"https://dev.marginnote.com.cn/#organization\"},\"isPartOf\":{\"@id\":\"https://dev.marginnote.com.cn#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Marginnote Dev Docs\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Marginnote Dev Docs\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/en/ai-dev.md","siteName":"Marginnote Dev Docs","nav":{"global":null,"languages":[{"language":"zh-CN","default":true,"navbar":{"links":[{"href":"https://www.marginnote.com.cn/","label":"官网"},{"href":"https://bbs.marginnote.com.cn/","label":"论坛"},{"href":"https://manual.marginnote.com.cn/mn4/","label":"使用手册"}]},"pages":[{"title":"zh-CN","href":"/zh/ai-dev"}]},{"language":"en","navbar":{"links":[{"href":"https://www.marginnote.com/","label":"Official Site"},{"href":"https://forum.marginnote.com/","label":"Forum"},{"href":"https://manual.marginnote.com.cn/mn4/en/","label":"Manual"}]},"pages":[{"group":"Getting Started","icon":"flag-pennant","pages":[{"title":"Introduction","description":"Customize MarginNote with scene templates and add-ons","href":"/en/introduction"},{"title":"Building with AI","href":"/en/ai-dev"}]},{"group":"Basics","icon":"mug-hot","pages":[{"title":"Scene add-on basics","mode":"default","description":null,"href":"/en/plugin-base"},{"title":"Creating an add-on project with MN Rails","href":"/en/mnrails"},{"title":"Interacting with MN through window.mn","href":"/en/sdk"},{"title":"Setting an add-on icon","href":"/en/logo"},{"title":"Controlling the UI","href":"/en/ui"},{"title":"Data exchange","href":"/en/data-interact"},{"title":"Event system","href":"/en/events"}]},{"group":"Add-ons In-Depth","icon":"plug","pages":[{"title":"Network restrictions","href":"/en/network"},{"title":"Path system","href":"/en/paths"},{"title":"Card and excerpt menu commands","href":"/en/menu-commands"},{"title":"Using MN's built-in AI","href":"/en/use-inner-ai"},{"title":"Beyond the panel","href":"/en/jsaddon"}]}]}]},"basePath":"","title":"Building with AI - Marginnote Dev Docs","buildId":"dpl_Fyv1NbzwP68g2bEH2Roy98uY1zmE","deploymentId":"dpl_Fyv1NbzwP68g2bEH2Roy98uY1zmE","dynamics":["869c33ed97"],"chunks":["Prompt-C6y0YkYB.js","clsx-Dq9TQuNi.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-D2J8knkn.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js"]}