### Install Membase Hub Client Dependencies Source: https://github.com/unibaseio/plugin-membase/blob/main/src/examples/membase-readme.md Installs all required Node.js dependencies for the Membase Hub client example, ensuring the project is ready to run. ```bash npm install ``` -------------------------------- ### Run Membase Hub Client Example Source: https://github.com/unibaseio/plugin-membase/blob/main/src/examples/membase-readme.md Executes the Membase Hub client example script using ts-node, which allows running TypeScript files directly without prior compilation. ```bash npx ts-node src/examples/membase-example.ts ``` -------------------------------- ### ElizaOS Membase Plugin Development Setup Commands Source: https://github.com/unibaseio/plugin-membase/blob/main/README.md Sequential pnpm commands for setting up the development environment for the Membase plugin. This includes installing dependencies, building the plugin, running it in development mode, and executing it with a specific character configuration. ```bash pnpm install pnpm run build pnpm run dev pnpm exec node --loader ts-node/esm ./src/scripts/load-with-plugin.ts --characters=./characters/eternalai.character.json ``` -------------------------------- ### Install ElizaOS Membase Plugin Source: https://github.com/unibaseio/plugin-membase/blob/main/README.md Instructions for installing the @elizaos/plugin-membase package using pnpm, a fast package manager. ```bash pnpm install @elizaos/plugin-membase ``` -------------------------------- ### Initialize Membase Hub Client Source: https://github.com/unibaseio/plugin-membase/blob/main/src/examples/membase-readme.md Initializes a new instance of the Membase Hub client. This client object is essential for all subsequent interactions with the Membase server, requiring the server's URL for connection. ```typescript const hubUrl = 'https://your-membase-server.com'; const client = new Client(hubUrl); ``` -------------------------------- ### Download Files from Membase Hub Source: https://github.com/unibaseio/plugin-membase/blob/main/src/examples/membase-readme.md Illustrates the process of downloading file content from the Membase Hub. The `downloadHub` method retrieves the file data, which can then be saved locally or processed further. ```typescript const downloadedData = await client.downloadHub(owner, 'example-data.txt'); if (downloadedData) { // Save downloaded content to local file await fs.writeFile(path.join(__dirname, 'downloaded-file.txt'), downloadedData); } ``` -------------------------------- ### Upload Files to Membase Hub Source: https://github.com/unibaseio/plugin-membase/blob/main/src/examples/membase-readme.md Demonstrates how to upload both file metadata and content to the Membase Hub. The `uploadHub` method handles file information, while `uploadHubData` is used for uploading the actual binary content, especially recommended for larger files. ```typescript // Upload file information const uploadResult = await client.uploadHub( owner, 'example-file.txt', '这是一个示例文件', true // Wait for upload to complete ); // Upload file content const fileData = Buffer.from('这是示例文件的内容'); const dataUploadResult = await client.uploadHubData( owner, 'example-data.txt', fileData ); ``` -------------------------------- ### Trigger Membase Memory Upload with Natural Language Commands Source: https://github.com/unibaseio/plugin-membase/blob/main/README.md Examples of natural language commands that automatically trigger the Membase plugin to handle memory uploads within the ElizaOS ecosystem. These commands demonstrate how users can interact with the system to store information. ```text "save message in membase"; "store memory on membase"; ``` -------------------------------- ### Manage Conversations in Membase Hub Source: https://github.com/unibaseio/plugin-membase/blob/main/src/examples/membase-readme.md Shows how to interact with conversation data in the Membase Hub. This includes retrieving a list of all conversations associated with an owner and fetching detailed information for a specific conversation by its ID. ```typescript // Get conversation list const conversations = await client.listConversations(owner); // Get specific conversation details const conversationDetails = await client.getConversation(owner, conversationId); ``` -------------------------------- ### Configure ElizaOS Membase Plugin Environment Variables Source: https://github.com/unibaseio/plugin-membase/blob/main/README.md Required environment variables for the Membase plugin, including the Membase hub endpoint and the associated account address. These variables are crucial for connecting to the decentralized storage network. ```typescript MEMBASE_HUB= MEMBASE_ACCOUNT= ``` -------------------------------- ### ElizaOS Membase Plugin API: MMEBASE_UPLOAD Action Source: https://github.com/unibaseio/plugin-membase/blob/main/README.md Detailed API reference for the MMEBASE_UPLOAD action, including its purpose and various aliases. This action is used to upload messages and memories to the Membase decentralized storage. ```APIDOC MMEBASE_UPLOAD - Uploads message to membase. - Aliases: - UPLOAD_MEMORY_TO_MEMBASE - STORE_MEMORY_ON_MEMBASE - SAVE_MMEORY_TO_MEMBASE - PUBLISH_MEMORY_TO_MEMBASE - UPLOAD_MESSAGE_TO_MEMBASE - STORE_MESSAGE_ON_MEMBASE - SAVE_MESSAGE_TO_MEMBASE - PUBLISH_MESSAGE_TO_MEMBASE ``` -------------------------------- ### Basic Membase Plugin Integration in TypeScript Source: https://github.com/unibaseio/plugin-membase/blob/main/README.md A basic import statement for integrating the @elizaos/plugin-membase into a TypeScript project. This line makes the plugin's functionalities available for use within your application. ```typescript import { mPlugin } from "@elizaos/plugin-membase"; ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.