> Discover all available pages from the documentation index: https://mastra.zisheng.pro/ko/llms.txt # 마스트라.getMemory() 그만큼`.getMemory()`메소드는 해당 키를 사용하여 Mastra 레지스트리에서 Memory 인스턴스를 검색합니다. Memory 인스턴스는 Mastra 생성자에 등록되며 저장된 Agent에서 참조할 수 있습니다. ## 사용예 ```typescript const memory = mastra.getMemory('conversationMemory') // Use the memory instance const thread = await memory.createThread({ resourceId: 'user-123', title: 'New Conversation', }) ``` ## 매개변수 **key** (`TMemoryKey extends keyof TMemory`): 가져올 Memory 인스턴스의 레지스트리 키입니다. Mastra 생성자에서 Memory를 등록할 때 사용한 키와 일치해야 합니다. ## 보고 **memory** (`TMemory[TMemoryKey]`): 지정된 키의 Memory 인스턴스입니다. Memory를 찾지 못하면 오류가 발생합니다. ## 예: Memory 등록 및 검색 ```typescript import { Mastra } from '@mastra/core' import { Memory } from '@mastra/memory' import { LibSQLStore } from '@mastra/libsql' const conversationMemory = new Memory({ storage: new LibSQLStore({ id: 'conversation-store', url: ':memory:' }), }) const mastra = new Mastra({ memory: { conversationMemory, }, }) // Later, retrieve the memory instance const memory = mastra.getMemory('conversationMemory') ``` ## 관련된 - [Mastra.listMemory()](https://mastra.zisheng.pro/ko/reference/core/listMemory) - [Memory 개요](https://mastra.zisheng.pro/ko/docs/memory/overview)