
Security News
Deno 2.6 + Socket: Supply Chain Defense In Your CLI
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.
@aigne/default-memory
Advanced tools
Default memory system component for AIGNE Framework, providing SQLite-based memory storage capabilities.
@aigne/default-memory is the default memory system component of AIGNE Framework, providing SQLite database-based memory storage and retrieval functionality. This component implements standard memory management interfaces and is an ideal choice for building AI applications.
npm install @aigne/default-memory
yarn add @aigne/default-memory
pnpm add @aigne/default-memory
import { AIAgent, AIGNE } from "@aigne/core";
import { DefaultMemory } from "@aigne/default-memory";
import { OpenAIChatModel } from "@aigne/openai";
// Create AI model instance
const model = new OpenAIChatModel({
apiKey: process.env.OPENAI_API_KEY,
model: "gpt-4-turbo",
});
// Create default memory system
const memory = new DefaultMemory({
storage: {
url: "file:memory.db",
},
retrieveMemoryCount: 10,
retrieveRecentMemoryCount: 5,
autoUpdate: true,
});
// Create AI agent with memory
const agent = AIAgent.from({
name: "Assistant",
instructions: "You are a helpful assistant with memory capabilities.",
memory: memory,
inputKey: "message",
});
// Use AIGNE execution engine
const aigne = new AIGNE({ model });
// Invoke agent
const userAgent = await aigne.invoke(agent);
// Send message
const response = await userAgent.invoke({
message: "My name is John and I work as a software developer",
});
console.log(response.message);
// Query memory later
const response2 = await userAgent.invoke({
message: "What do you remember about me?",
});
console.log(response2.message);
import { DefaultMemory, DefaultMemoryStorage } from "@aigne/default-memory";
// Use custom storage configuration
const memory = new DefaultMemory({
storage: {
url: "file:custom-memory.db",
// Other storage configurations
},
retrieveMemoryCount: 20,
retrieveRecentMemoryCount: 10,
});
// Or use custom storage instance
const customStorage = new DefaultMemoryStorage({
url: "file:custom-memory.db",
});
const memory2 = new DefaultMemory({
storage: customStorage,
});
const memory = new DefaultMemory({
storage: {
url: "file:memory.db",
},
// Set total number of memories to retrieve
retrieveMemoryCount: 15,
// Set number of recent memories to retrieve
retrieveRecentMemoryCount: 8,
// Enable auto update
autoUpdate: true,
});
import { DefaultMemory } from "@aigne/default-memory";
// Create shared memory system
const sharedMemory = new DefaultMemory({
storage: {
url: "file:shared-memory.db",
},
});
// Multiple agents can share the same memory system
const agent1 = AIAgent.from({
name: "Agent1",
instructions: "You are assistant 1",
memory: sharedMemory,
});
const agent2 = AIAgent.from({
name: "Agent2",
instructions: "You are assistant 2",
memory: sharedMemory,
});
Elastic-2.0
FAQs
Default memory for AIGNE framework
We found that @aigne/default-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.
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.

Security News
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.