YH Hsu
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.

      Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Explore these features while you wait
      Complete general settings
      Bookmark and like published notes
      Write a few more notes
      Complete general settings
      Write a few more notes
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    5
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    ### [AI / ML領域相關學習筆記入口頁面](https://hackmd.io/@YungHuiHsu/BySsb5dfp) #### [Deeplearning.ai GenAI/LLM系列課程筆記](https://learn.deeplearning.ai/) ##### GenAI - [Large Language Models with Semantic Search。大型語言模型與語義搜索 ](https://hackmd.io/@YungHuiHsu/rku-vjhZT) - [LangChain for LLM Application Development。使用LangChain進行LLM應用開發](https://hackmd.io/1r4pzdfFRwOIRrhtF9iFKQ) - [Finetuning Large Language Models。微調大型語言模型](https://hackmd.io/@YungHuiHsu/HJ6AT8XG6) ##### RAG - [Preprocessing Unstructured Data for LLM Applications。大型語言模型(LLM)應用的非結構化資料前處理](https://hackmd.io/@YungHuiHsu/BJDAbgpgR) - [Building and Evaluating Advanced RAG。建立與評估進階RAG](https://hackmd.io/@YungHuiHsu/rkqGpCDca) - [[GenAI][RAG] Multi-Modal Retrieval-Augmented Generation and Evaluaion。多模態的RAG與評估 ](https://hackmd.io/@YungHuiHsu/B1LJcOlfA) ##### AI Agents 原理可參考這篇綜論: [How Agents for LLM Perform Task Planning。大型語言模型的代理如何進行任務規劃](https://hackmd.io/@YungHuiHsu/rkK52BkQp) - 相關framework選擇 - [AI Agents in LangGraph](https://hackmd.io/@YungHuiHsu/BJTKpkEHC) - [Building Agentic RAG with LlamaIndex](https://learn.deeplearning.ai/courses/building-agentic-rag-with-llamaindex/lesson/1/introduction) - [Multi AI Agent Systems with crewAI](https://learn.deeplearning.ai/courses/multi-ai-agent-systems-with-crewai/lesson/1/introduction) - [Functions, Tools and Agents with LangChain](https://learn.deeplearning.ai/courses/functions-tools-agents-langchain/lesson/1/introduction) - Agent相關 - [Long-Term Agentic Memory With LangGraph](https://hackmd.io/@YungHuiHsu/S1f1cyOnke) --- # [Long-Term Agentic Memory With LangGraph](https://learn.deeplearning.ai/courses/long-term-agentic-memory-with-langgraph/lesson/ovv0p/introduction?courseName=long-term-agentic-memory-with-langgraph) * [Introduction to Agent Memory](https://hackmd.io/@YungHuiHsu/S1f1cyOnke) * [Baseline Email Assistant、Email Assistant with Semantic Memory](https://hackmd.io/@YungHuiHsu/ryOkald2kl) * [Email Assistant with Semantic + Episodic Memory](https://hackmd.io/@YungHuiHsu/r15H8kQTkx) * [Email Assistant with Semantic + Episodic + Procedural Memory](https://hackmd.io/@YungHuiHsu/ByDawymp1e) - 課程完整程式碼: [github/Long-Term-Agentic-Memory-With-LangGraph](https://github.com/YunghuiHsu/Long-Term-Agentic-Memory-With-LangGraph) - [簡報: How AI Agents Optimize Performance Through Experience_Memory](https://drive.google.com/file/d/1OOlJSuGwk_B5cBcmFj3tSoBFUxqFg2qy/view?usp=sharing) --- ## 補充: LangGraph 的 Memory管理機制設計 #### What are types of memory? 認知心理學中,人的三種記憶類型 ![image](https://hackmd.io/_uploads/S1-pjbl0yl.png) > [Types of long term memory, Tulving (1944)](https://slideplayer.com/slide/15044299/) ![image](https://hackmd.io/_uploads/HkT72bx0kg.png =400x) [Types of Long-Term Memory](https://www.simplypsychology.org/long-term-memory.html) ```mermaid graph TD A[Memory<br>記憶] --> B[Explicit<br>顯性記憶] A --> C[Implicit<br>隱性記憶] B --> B1[Episodic<br>情節記憶] B --> B2[Semantic<br>語意記憶] C --> C1[Skills<br>技能與動作] C --> C2[Priming<br>啟動效應] C --> C3[Classical<br>Conditioning<br>古典制約] C --> C4[Emotional<br>Conditioning<br>情緒反射] ``` :::info **Procedural Memory(程序記憶)**:不需有意識回想,自動啟動的記憶,也稱為非陳述性記憶。 - Skills(技能):例如騎腳踏車、打字,透過練習學會,自動執行的動作記憶。 - Priming(啟動效應) - Priming 是一種潛意識記憶現象,指的是:「當你先接觸某個刺激後,會無意識地影響你對後續資訊的處理方式。」 - 我們的大腦會在背景中建立「關聯網絡」,一個概念被啟動後,與之相關的其他概念也會被默默活化。 - 這種活化過程可以讓人「更快反應」或「偏向某種判斷」,即使沒有意識地思考。 - 例如:候選人藉由重複出現、口號訴求、視覺色彩、價值語言等方式,在潛意識中建立「值得信賴」、「關心人民」等形象。 - Classical Conditioning(古典制約):例如聽到鈴聲就肚子餓,因為刺激與反應重複連結。 - Other(其他):例如習慣形成或情緒反射,屬於其他非意識型記憶類型。 ::: | 記憶類型 | 儲存內容 | 人類範例 | AI Agent 範例 | |----------|-----------|-----------|----------------| | **Semantic**(語意) | 事實<br>Facts | 學校學到的知識 | 關於使用者的事實資料 | | **Episodic**(情節) | 經驗<br>Experiences | 自己做過的事 | Agent 過去執行的動作序列(範例) | | **Procedural**(隱性/程序) |指令/規格<br>Instructions/rules | 本能、技能(如騎腳踏車<br>Instincts or motor skills | Agent 的系統提示詞或行為邏輯設定 | 這個分類方法 CoALA 論文中對參考認知心理學對人類記憶與 AI 記憶的對應研究。 --- 在 LLM Agents (大型語言模型代理) 的架構中,這三種記憶類型有以下對應與功能: 1. **Semantic Memory (語意記憶)** - **儲存內容**:儲存的是「事實性知識」或「長期穩定的資訊」。 - **在人類中的對應**:像是在學校學到的知識。 - **在 LLM 中的應用**: - 儲存有關使用者的背景資料、偏好、興趣等長期資訊。 - 例如:「使用者的名字」、「最喜歡的顏色是藍色」或「使用者對科技新聞感興趣」。 - 此類資訊通常不會頻繁更新,屬於較固定的背景知識。 2. **Episodic Memory (情節記憶)** - **儲存內容**:儲存模型與使用者的「互動記錄」及「過去行為」(Few-shot Example)。 - **在人類中的對應**:像是「我昨天去了超市」或「我在某年參加過某場演唱會」。 - **在 LLM 中的應用**: - 儲存模型在過去對話中的行為、決策及回應。 - 例如:「昨天你問了我關於Python的問題」、「上次我推薦了某本書」。 - 此類記憶有助於模型理解對話上下文,提升連貫性。 3. **Procedural Memory (程序性/內在 記憶)** - **儲存內容**:儲存「如何完成某件事」的指令或技能(System Prompt)。 - **在人類中的對應**:像是「如何打網球」或「如何開車」。 - **在 LLM 中的應用**: - 包括代理系統的「Prompt 模板」、「行動計畫」或「多步驟工作流」。 - 例如:「先查找資料,再進行彙整,最後以條列式回答」。 - Procedural memory 讓 LLM Agents 更具執行複雜任務的能力。 --- - LangGraph的記憶管理機制來自於[Cognitive Architectures for Language Agents](https://arxiv.org/pdf/2309.02427)這篇paper ![image](https://hackmd.io/_uploads/SJ_OskN6Je.png) > 圖 1:大型語言模型(LLMs)的不同應用方式。 A:在自然語言處理(NLP)中,LLM 將文字作為輸入,並輸出文字。 B:語言代理人(Language Agents)(Ahn 等人, 2022;Huang 等人, 2022c)將 LLM 置於與外部環境的直接回饋迴圈中,透過將觀察轉換為文字,並使用 LLM 來選擇動作。 C:認知型語言代理人(Cognitive Language Agents)(Yao 等人, 2022b;Shinn 等人, 2023;Wang 等人, 2023a)進一步利用 LLM 透過學習與推理等過程來管理代理人的內部狀態。 ![image](https://hackmd.io/_uploads/Hksq6kNTkl.png) > 圖 2 展示了認知架構(Cognitive Architectures)如何整合知覺輸入、長期記憶、決策程序與動作執行,以模擬類似人類的智能代理人系統。這裡分為兩個子圖: 🧠 A:**Soar 認知架構的整體架構圖** 此圖展示了 Soar 架構的核心組件與資訊流動方式,模擬人類認知過程: | 模組 | 說明 | |--------------------------|----------------------------------------------------------------------| | **Symbolic Long-Term Memories** | 長期記憶分為三種:<br> - **Procedural**(程序記憶):儲存行為規則(Productions)<br> - **Semantic**(語意記憶):儲存事實知識<br> - **Episodic**(情節記憶):儲存過去經驗或事件 | | **Symbolic Working Memory** | 工作記憶,儲存當前感知、目標、中間推理結果,作為決策的依據 | | **Decision Procedure** | 根據工作記憶的內容評估規則(Productions)是否符合條件,並選擇最適行動 | | **Preference Memory** | 儲存對行動選項的偏好值,輔助決策程序 | | **RL(Reinforcement Learning)**| 強化學習模組,用於調整規則的偏好值,根據行為結果學習 | | **Chunking / Learning Modules**| 學習新知識並寫入記憶(semantic/episodic/procedural) | | **感知與動作模組** | 包括 Visual/Other Perception、Motor,實現與外部世界的互動 | ➡️ 所有感知輸入與行動命令皆經由「Embodiment」層與真實或模擬環境互動。 ![image](https://hackmd.io/_uploads/H1YCCkEp1l.png) > 圖 4:語言代理人的認知架構(CoALA) A:CoALA 定義了一組相互作用的模組與流程。決策程序(Decision Procedure)負責執行代理人的原始碼,這些原始碼包含與 LLM(提示模板與解析器)、內部記憶(檢索與學習),以及外部環境(對應與連結)的互動程序。 B:在時間流程上,代理人的決策程序與外部環境形成一個迴圈,每次循環中,代理人會透過記憶檢索與推理,進行規劃(包括提出與評估候選的學習或對應行動)。接著選擇並執行最合適的行動。執行後可能產生新的觀察,進而啟動下一輪循環。 - A:模組化架構(CoALA 系統結構圖) | 區塊 | 說明 | |-------------------------|------| | **Procedural Memory** | 程序性記憶包含兩部分:<br>- **LLM**:語言模型能力(透過 prompt、parse 使用)<br>- **Agent Code**:定義與記憶、環境互動的規則與邏輯 | | **Semantic Memory** | 儲存事實知識(e.g., 世界知識、規則)<br>支援**Retrieval** 與 **Learning** | | **Episodic Memory** | 儲存經驗與歷史(e.g., 對話紀錄、任務經驗)<br>支援**Retrieval** 與 **Learning** | | **Working Memory** | 儲存當前上下文,包括觀察、任務狀態、推理中間結果<br>供 Decision Procedure 與 Memory 模組使用 | | **Decision Procedure** | 執行代理人的決策邏輯(類似程式碼主迴圈),整合各模組做出選擇 | | **Actions / Observations** | 代理人與外部世界的互動結果<br>來源包括:<br>- **Dialogue**(對話)<br>- **Physical**(物理環境)<br>- **Digital**(系統介面) | ➡️ 每個記憶模組皆具備學習(Learning)與檢索(Retrieval)能力。 --- :::info 根據[LangGraph官網的Guides Concepts/Memory](https://langchain-ai.github.io/langgraph/concepts/memory/?ref=blog.langchain.dev)的記憶管理機制概念,主要依照threads之間是否能共享資料進行區分 - Short-term (within-thread) memory v.s. Long-term (cross-thread) memory ![image](https://hackmd.io/_uploads/rk1EvkE6ye.png) | 分類 | Short-term memory(短期記憶) | Long-term memory(長期記憶) | |-------------------|--------------------------------------------------|------------------------------------------------------| | 別名 | Thread-scoped memory | Cross-thread memory | | 存取範圍 | 僅限單一對話 thread | 可跨 thread 共用 | | 使用場景 | 目前對話中持續追蹤上下文 | 在多個對話中記住持久資訊 | | 資料更新時機 | 當 graph 被啟動或步驟完成時更新 | 依照開發者儲存行為自行寫入 | | 儲存方式 | 透過 `Checkpointer` 寫入 database | 透過 `Store` 寫入特定的命名空間 | | 資料結構 | 最近的 AI / Human 訊息序列 | 可自訂的多筆訊息記憶庫 | | 回讀時機 | 每次步驟開始時讀取 | 任意時機可讀取 | - [LangGraph官網的persistence機制](https://langchain-ai.github.io/langgraph/concepts/persistence/) ![image](https://hackmd.io/_uploads/rJby_JNpyx.png) > > | 圖示元素 | 說明 | > |-----------------|----------------------------------------------------------------------| > | **Graph** | 流程圖的起點與控制流,包含狀態(`state`)與節點(node) | > | **Node** | 每一個節點是一步操作,按順序或平行執行,構成 super-step | > | **Super-steps** | 節點的執行單元,一個 sequential node 為一個 super-step,平行節點共享 | > | **Checkpoint** | 每次 super-step 執行後,將 state 和 metadata 儲存的快照 | > | **StateSnapshot** | `Checkpoint` 的資料結構類型,封裝了 state、下一步節點、ID 等資訊 | > | **Thread** | 多個 checkpoint 的集合,對應一次完整執行流程 | > - 長期記憶使用的`Memory Store` 機制 ![image](https://hackmd.io/_uploads/ByV3uyEayx.png) ::: --- ## [LangGraph官網對Long-term memory的介紹](https://langchain-ai.github.io/langgraph/concepts/memory/?ref=blog.langchain.dev#framework-for-thinking-about-long-term-memory) :::info 🧠 長期記憶(Long-term Memory) 在 LangGraph 中,**長期記憶** 允許系統在不同的對話或會話之間**保留資訊**。與僅限於單一 thread 的**短期記憶**不同,長期記憶是透過自訂的「**namespace(命名空間)**」儲存的。 - 🗃️ 記憶儲存方式 LangGraph 會將長期記憶以 **JSON 文件格式** 儲存在記憶體儲存系統中(可參考官方文件)。每筆記憶都會被組織在: - 一個自訂的 **命名空間**(類似資料夾) - 一個獨立的 **key**(像是檔名) 命名空間通常會包含使用者 ID、組織 ID,或其他方便分類的標籤。這種結構支援階層式管理,也支援跨命名空間的搜尋(可透過內容篩選)。 - 以下是範例程式碼: ```python from langgraph.store.memory import InMemoryStore # 自訂嵌入函式(實務上應替換成真實的 embedding) def embed(texts: list[str]) -> list[list[float]]: return [[1.0, 2.0] * len(texts)] # 建立記憶體儲存(開發用,正式環境建議接 DB) store = InMemoryStore(index={"embed": embed, "dims": 2}) user_id = "my-user" application_context = "chitchat" namespace = (user_id, application_context) # 儲存記憶 store.put( namespace, "a-memory", { "rules": [ "User likes short, direct language", "User only speaks English & python", ], "my-key": "my-value", }, ) # 透過 ID 取得記憶 item = store.get(namespace, "a-memory") # 透過 filter + 向量相似度搜尋記憶 items = store.search( namespace, filter={"my-key": "my-value"}, query="language preferences" ) ``` - 🧭 長期記憶的設計思考框架 長期記憶本身是一個複雜課題,沒有「一體適用」的方案。不過,你可以透過以下問題來建立思考架構: - 1️⃣ 記憶的類型是什麼? 人類的記憶可分為:事實(facts)、經驗(experiences)、規則(rules)。 AI agent 也可以以同樣方式使用記憶。例如 agent 可以記住使用者的偏好,以更有效完成任務。 - 2️⃣ 什麼時候要更新記憶? - **即時更新**:在主要應用邏輯中即時寫入(on the hot path),例如在回覆使用者前記住某些事。 - **背景更新**:作為背景程序異步執行,定期掃描資料並寫入記憶。 ::: --- ## Introduction to Agent Memory。Agent 記憶機制介紹 ### 記憶寫入/儲存機制 (Memory Storage Mechanisms) ![image](https://hackmd.io/_uploads/H16-blNTye.png) 記憶寫入策略比較 | 項目 | In the hot path(熱路徑) | In the background(背景處理) | | ------------------ | --------------------------------------------------------------------------------- | ---------------------------------------------------------------------- | | **記憶寫入時機** | 每次使用者訊息後立即更新記憶 | 定期或條件式地,在背景中批次更新記憶 | | **優點** | - 記憶即時更新<br>- 可立即應用於後續互動<br>- 使用者可被通知記憶更新 | - 無延遲<br>- 應用邏輯與記憶管理分離<br>- 可以更專注地處理記憶任務 | | **缺點** | - 增加 agent 負擔與決策延遲<br>- 記憶過濾決策需另建工具<br>- 多工可能降低記憶品質 | - 記憶延遲導致其他 thread 缺乏最新上下文<br>- 需妥善設計觸發頻率與機制 | | **典型策略或工具** | 例如 ChatGPT 使用 `save_memories` 工具,每則訊息判斷是否上傳記憶 | 常用策略:<br>- 固定時間後更新<br>- cron 任務<br>- 手動/邏輯觸發 | | **應用示意圖** | 使用者訊息 → 更新記憶 → 回覆 | 使用者訊息 → 回覆 →(延遲 30 分鐘後)記憶更新 | --- ## 以Email Assistant為例 with Semantic Memory - Al assistants often need context, personalization, ability to adapt to your feedback ![image](https://hackmd.io/_uploads/ByEVQed3ye.png =800x) - Maintain context over time, adapt to our preferences, **learn from past interactions** 1. **Inbox (收件匣)** ➔ 所有郵件進入收件匣等待處理。 2. **Triage (分流)** ➔ 使用 **Episodic Memory** 判斷哪些郵件需優先處理。 3. **LLM (大型語言模型)** ➔ 根據郵件內容決定是否需安排會議 (Calendar Tool)、撰寫回應 (Writing Tool) 或更新記憶 (Memory Tool)。 4. **Agent (代理)** ➔ 協調多個工具並根據使用者偏好最佳化回應行為。 ✅ **Episodic Memory (情節記憶)** ✅ **Semantic Memory (語意記憶)** ✅ **Procedural Memory (程序性記憶)** #### Semantic Memory(語意記憶) ![image](https://hackmd.io/_uploads/Skx8IeOhJg.png =800x) Semantic Memory 在此系統中分為兩個核心部分: 1. **Semantic Memory Profile (語意記憶檔案)** - **會議偏好** (Meeting preferences) - **回應優先順序** (Response priorities) - **VIP 聯絡人** (VIP contacts) 2. **Semantic Memory Collection (語意記憶資料庫)** - **事實性資訊 (Facts)** - **過去互動記錄 (Past interactions)** #### Semantic Memory(語意記憶)+ Episodic Memory(情節記憶) ![image](https://hackmd.io/_uploads/S1ehLxdn1e.png =800x) - **定義:** 儲存「過去事件」的記憶,幫助系統理解並根據以往經驗做出判斷。 - **在圖中的角色:** - 應用於 **Triage (分流)** 階段,使用「Few-shot examples」快速判斷郵件的重要性。 - **成功範例 (Success examples):** - ✅ 緊急客戶請求 - ✅ 來自 VIP 的會議邀請 - **失敗範例 (Failure examples):** - ❌ 垃圾郵件 (Spam) - ❌ 電子報 (Newsletters) - ❌ 低優先度通知 (Low-priority updates) - 🔎 **功能** - 快速判斷郵件的優先級,減少處理不必要郵件的時間。 - 模型根據「過去經驗」自動標記郵件並過濾垃圾信。 #### Semantic(語意記憶)+ Episodic(情節記憶) + Procedural Memory(程序性記憶) - ![image](https://hackmd.io/_uploads/SyeVPxd21g.png =1200x) - **定義:** 儲存「如何執行某項任務」的知識,類似於機器人學習的技能或操作規則。 - **在圖中的角色:** - **System Prompts (系統提示)** 應用於: - Calendar Tool (行事曆工具) - 📆 **會議時長** (Meeting duration) - ⏳ **緩衝時間設置** (Buffer times) - Writing Tool (撰寫工具) - ✍️ **郵件風格與語氣偏好** (Writing style and tone preferences) - 🔁 **回應模式** (Response patterns) - 🔎 **功能** - 讓系統自動執行多步驟任務並根據不同情境調整。 - 例如,系統可根據用戶的指示選擇「正式」、「非正式」、「簡潔」等回應風格。

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password
    or
    Sign in via Google Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully