
Security News
Software Engineering Daily Podcast: Feross on AI, Open Source, and Supply Chain Risk
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.
@aigne/example-afs-local-fs
Advanced tools
A demonstration of using AIGNE Framework with AFS LocalFS module
This example demonstrates how to create a chatbot that can interact with your local file system using the AIGNE Framework and AIGNE CLI. The example utilizes the SystemFS module to provide file system access to AI agents through the AIGNE File System (AFS) interface.
AIGNE 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.
User asks: "What is AIGNE?"
Behind the scenes:
afs_search → searches all files for "AIGNE"/modules/local-fs/docs/getting-started/what-is-aigne.mdafs_read → reads the specific fileThe power: AI agents intelligently search your file system and retrieve exactly what's needed - no manual navigation required!
export OPENAI_API_KEY=YOUR_OPENAI_API_KEY
# Mount AIGNE framework docs (clone first)
git clone https://github.com/AIGNE-io/aigne-framework
npx -y @aigne/example-afs-local-fs --path ./aigne-framework --chat
# Or mount any directory
npx -y @aigne/example-afs-local-fs --path ~/Documents --description "My Documents" --chat
# Ask a specific question
npx -y @aigne/example-afs-local-fs --path . --input "What is AIGNE?"
Here's what happens when you ask "What is AIGNE?" with the framework docs mounted:
👤 You: "What is AIGNE?"
🤖 Agent thinks: I should search the docs for information about AIGNE...
→ Calls: afs_search(query: "AIGNE")
📁 Found 15 matching files:
• docs/getting-started/what-is-aigne.md ⭐ (most relevant)
• README.md
• docs/core-concepts/overview.md
...
🤖 Agent thinks: Let me read the most relevant file...
→ Calls: afs_read("docs/getting-started/what-is-aigne.md")
📄 File loaded (2.4 KB)
🤖 AI: "AIGNE is a framework and runtime engine for building LLM-powered
applications and AI agents. It provides:
• A unified Agentic File System (AFS) interface
• Support for multiple LLM providers (OpenAI, Anthropic, etc.)
• Tools for building autonomous agents
• Integration with external services via MCP
Would you like me to walk you through a quick-start tutorial, or
would you prefer to see specific examples?"
Key insight: The agent intelligently searches, finds the right file, reads it, and synthesizes a helpful answer - all automatically!
As an example, running npx -y @aigne/example-afs-system-fs --path . --input "What files are in the current directory?" requires an AI model. If this is your first run, you need to connect one.

Choose the first option and your browser will open the official AIGNE Hub page. Follow the prompts to complete the connection. If you're a new user, the system automatically grants 400,000 tokens for you to use.

Choose the second option, enter the URL of your self-hosted AIGNE Hub, and follow the prompts to complete the connection. If you need to set up a self-hosted AIGNE Hub, visit the Blocklet Store to install and deploy it: Blocklet Store.

Using OpenAI as an example, you can configure the provider's API key via environment variables. After configuration, run the example again:
export OPENAI_API_KEY="" # Set your OpenAI API key here
For more details on third-party model configuration (e.g., OpenAI, DeepSeek, Google Gemini), see .env.local.example.
After configuration, run the example again.
The aigne observe command starts a local web server to monitor and analyze agent execution data. It provides a user-friendly interface to inspect traces, view detailed call information, and understand your agent’s behavior during runtime. This tool is essential for debugging, performance tuning, and gaining insight into how your agent processes information and interacts with tools and models.
Start the observation server.

View a list of recent executions.

git clone https://github.com/AIGNE-io/aigne-framework
cd aigne-framework/examples/afs-local-fs
pnpm install
# Run with your current directory
pnpm start --path .
# Run with a specific directory
pnpm start --path ~/Documents --description "My Documents"
# Run in interactive chat mode
pnpm start --path . --chat
import { LocalFS } from "@aigne/afs-local-fs";
const localFS = new LocalFS({
localPath: './aigne-framework',
description: 'AIGNE framework documentation'
});
import { AFS } from "@aigne/afs";
import { AFSHistory } from "@aigne/afs-history";
const afs = new AFS()
.mount(new AFSHistory({ storage: { url: ":memory:" } }))
.mount(localFS); // Mounted at /modules/local-fs
import { AIAgent } from "@aigne/core";
const agent = AIAgent.from({
instructions: "Help users find and read files from the local file system.",
inputKey: "message",
afs, // Agent gets: afs_list, afs_read, afs_write, afs_search
});
That's it! The agent can now intelligently search and retrieve files from your local directory.
afs_list - List files and directories (with recursive depth control)afs_read - Read file contents and metadataafs_write - Create or update filesafs_search - Fast full-text search using ripgrep (supports regex)All operations are sandboxed to the mounted directory for safety.
# Mount AIGNE docs and ask questions
git clone https://github.com/AIGNE-io/aigne-framework
npx -y @aigne/example-afs-local-fs --path ./aigne-framework --input "What is AIGNE?"
# Ask about specific features
npx -y @aigne/example-afs-local-fs --path ./aigne-framework --input "How does AFS work?"
# Search your codebase
npx -y @aigne/example-afs-local-fs --path . --input "Find all TypeScript files with TODO comments"
# Interactive mode - ask follow-up questions
npx -y @aigne/example-afs-local-fs --path ~/Documents --chat
In chat mode, try:
Mount your project docs and let users ask questions:
const afs = new AFS()
.mount(new LocalFS({ localPath: './docs', description: 'Project documentation' }));
// Users can now ask: "How do I configure authentication?"
Give AI agents access to your codebase:
const afs = new AFS()
.mount(new LocalFS({ localPath: './src', description: 'Source code' }));
// Agent can search, read, and explain code
Let AI help organize your files:
const afs = new AFS()
.mount(new LocalFS({ localPath: '~/Downloads', description: 'Downloads folder' }));
// Ask: "Find all PDFs from last week" or "Organize these files by type"
Mount multiple directories simultaneously:
const afs = new AFS()
.mount("/docs", new LocalFS({ localPath: './docs' }))
.mount("/src", new LocalFS({ localPath: './src' }))
.mount("/tests", new LocalFS({ localPath: './tests' }));
// Agent can search across all mounted directories
This package includes full TypeScript type definitions.
FAQs
A demonstration of using AIGNE Framework with AFS LocalFS module
We found that @aigne/example-afs-local-fs 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
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.

Security News
GitHub has revoked npm classic tokens for publishing; maintainers must migrate, but OpenJS warns OIDC trusted publishing still has risky gaps for critical projects.

Security News
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.