DID Spaces memory system component for AIGNE Framework, providing cloud-based memory storage capabilities with DID Spaces.
Introduction
@aigne/did-space-memory is the DID Spaces memory system component of AIGNE Framework, providing cloud-based memory storage and retrieval functionality using DID Spaces. This component uses decentralized storage services to provide secure and reliable memory persistence capabilities for AI applications.
Features
Cloud Storage: Uses DID Spaces for secure cloud-based memory storage
Decentralized: Based on decentralized identity and storage technologies
Automatic Management: Supports automatic memory file management and README generation
Secure Authentication: Supports multiple authentication methods to ensure data security
YAML Format: Uses YAML format for memory storage, making it easy to read and maintain
TypeScript Support: Complete type definitions providing an excellent development experience
Installation
Using npm
npm install @aigne/did-space-memory
Using yarn
yarn add @aigne/did-space-memory
Using pnpm
pnpm add @aigne/did-space-memory
Basic Usage
import { AIAgent, AIGNE } from"@aigne/core";
import { DIDSpacesMemory } from"@aigne/did-space-memory";
import { OpenAIChatModel } from"@aigne/openai";
// Create AI model instanceconst model = newOpenAIChatModel({
apiKey: process.env.OPENAI_API_KEY,
model: "gpt-4-turbo",
});
// Create DID Spaces memory systemconst memory = newDIDSpacesMemory({
url: process.env.DID_SPACES_URL!,
auth: {
authorization: process.env.DID_SPACES_AUTHORIZATION!,
},
});
// Create AI agent with cloud-based memoryconst agent = AIAgent.from({
name: "CloudAssistant",
instructions: "You are a helpful assistant with cloud-based memory.",
memory: memory,
inputKey: "message",
});
// Use AIGNE execution engineconst aigne = newAIGNE({ model });
// Invoke agentconst userAgent = await aigne.invoke(agent);
// Send messageconst response = await userAgent.invoke({
message: "I'm John, a doctor, and I like Bitcoin",
});
console.log(response.message);
// Query memoryconst response2 = await userAgent.invoke({
message: "What is my profession?",
});
console.log(response2.message);
const client = memory.client;
// List all memory filesconst memories = await client.listObjects({
prefix: "/memories/",
});
// Read specific memory fileconst memoryContent = await client.getObject({
key: "/memories/conversation-123/memory.yaml",
});
Environment Variables Configuration
Create a .env file and configure the following variables:
DID_SPACES_URL=https://your-did-spaces-url.com
DID_SPACES_AUTHORIZATION=your-authorization-token
# Or use access token
DID_SPACES_ACCESS_TOKEN=your-access-token
License
Elastic-2.0
FAQs
DID Spaces memory for AIGNE framework
We found that @aigne/did-space-memory demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.It has 2 open source maintainers collaborating on the project.
Package last updated on 06 Dec 2025
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
GitHub has revoked npm classic tokens for publishing; maintainers must migrate, but OpenJS warns OIDC trusted publishing still has risky gaps for critical projects.
Rust’s crates.io team is advancing an RFC to add a Security tab that surfaces RustSec vulnerability and unsoundness advisories directly on crate pages.
Socket found a Rust typosquat (finch-rust) that loads sha-rust to steal credentials, using impersonation and an unpinned dependency to auto-deliver updates.