
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
@aigne/example-afs-memory
Advanced tools
A demonstration of using AIGNE Framework with memory-based AFS modules
This example demonstrates how to create a chatbot with long-term memory using the AIGNE Framework. The chatbot can remember user information across conversations and recall details shared in previous interactions.
The example uses two powerful AFS (Agentic File System) modules:
Agentic File System (AFS) is a virtual file system abstraction that provides AI agents with unified access to various storage backends. For comprehensive documentation, see AFS Documentation.
export OPENAI_API_KEY=YOUR_OPENAI_API_KEY # Set your OpenAI API key
# First conversation - introduce yourself
npx -y @aigne/example-afs-memory --input "I'm Bob, and I like blue color"
# Response: Nice to meet you, Bob — I've saved that your favorite color is blue...
# Second conversation - the bot remembers you!
npx -y @aigne/example-afs-memory --input "Tell me all info about me you known"
# Response: Here's what I currently have stored about you:
# * Name: Bob
# * Interests / favorite color: blue
# Run in interactive chat mode
npx -y @aigne/example-afs-memory --chat
git clone https://github.com/AIGNE-io/aigne-framework
cd aigne-framework/examples/afs-memory
pnpm install
Setup your OpenAI API key in the .env.local file:
OPENAI_API_KEY="" # Set your OpenAI API key here
You can use different AI models by setting the MODEL environment variable along with the corresponding API key. The framework supports multiple providers:
MODEL="openai:gpt-4.1" with OPENAI_API_KEYMODEL="anthropic:claude-3-7-sonnet-latest" with ANTHROPIC_API_KEYMODEL="gemini:gemini-2.0-flash" with GEMINI_API_KEYMODEL="bedrock:us.amazon.nova-premier-v1:0" with AWS credentialsMODEL="deepseek:deepseek-chat" with DEEPSEEK_API_KEYMODEL="openrouter:openai/gpt-4o" with OPEN_ROUTER_API_KEYMODEL="xai:grok-2-latest" with XAI_API_KEYMODEL="ollama:llama3.2" with OLLAMA_DEFAULT_BASE_URLFor detailed configuration examples, please refer to the .env.local.example file in this directory.
# Run in interactive mode
pnpm start
# Run with a single message
pnpm start --input "I'm Bob, and I like blue color"
# First conversation - introduce yourself
$ pnpm start --input "I'm Bob, and I like blue color"
Response: Nice to meet you, Bob — I've saved that your favorite color is blue.
If you'd like, I can remember more about you (location, hobbies, projects, etc.)...
# Second conversation - the bot remembers you!
$ pnpm start --input "Tell me all info about me you known"
Response: Here's what I currently have stored about you:
* Name: Bob
* Interests / favorite color: blue
Would you like to add or update anything (location, hobbies, projects, family, etc.)?
This example uses two complementary memory modules that work together to provide intelligent, personalized conversations:
Purpose: Records every conversation turn to provide recent context.
How it works:
Example:
# First conversation
$ pnpm start --input "I'm Bob, and I like blue color"
Response: Nice to meet you, Bob — I've saved that your favorite color is blue...
# The conversation is automatically saved to /history/{uuid}
Purpose: Intelligently extracts and stores structured user information from conversations.
How it works:
/user-profile-memoryWhat it remembers:
Example:
# After Bob introduces himself, the profile is automatically created:
{
"name": [{ "name": "Bob" }],
"interests": [{ "content": "blue color" }]
}
# In the next conversation, the bot can recall this information:
$ pnpm start --input "Tell me all info about me you known"
Response: Here's what I currently have stored about you:
* Name: Bob
* Interests / favorite color: blue
When you send a message, the system automatically:
Step 1: Inject User Profile into System Prompt
You are a friendly chatbot
<related-memories>
User Profile Memory: This contains structured information about the user...
- name:
- name: Bob
interests:
- content: blue color
</related-memories>
Step 2: Add Recent Conversation History
[
{
"role": "system",
"content": "You are a friendly chatbot... [profile injected here]"
},
{
"role": "user",
"content": "I'm Bob and I like blue color"
},
{
"role": "assistant",
"content": "Nice to meet you, Bob..."
},
{
"role": "user",
"content": "Tell me all info about me you known"
}
]
Step 3: AI Generates Personalized Response
The AI can now:
This package includes full TypeScript type definitions.
FAQs
A demonstration of using AIGNE Framework with memory-based AFS modules
The npm package @aigne/example-afs-memory receives a total of 475 weekly downloads. As such, @aigne/example-afs-memory popularity was classified as not popular.
We found that @aigne/example-afs-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
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.