Skip to main content
Paper·arxiv.org
ai-agentsmachine-learningresearchautomationcontext-engineeringfilegram

FileGram: Grounding Agent Personalization in File-System Behavioral Traces

FileGram personalizes local AI agents by using file system activity as behavioral traces, enabling more context-aware and privacy-preserving AI assistants. This addresses data constraints and enhances agent relevance in a user's digital workflow.

intermediate1 hour5 steps
The play
  1. Grasp FileGram's Concept
    Understand how leveraging file system behavioral traces (e.g., file access, modification) can provide a rich, privacy-preserving data source for local AI agent personalization.
  2. Identify Key Behavioral Signals
    Determine which specific file system events or patterns are most indicative of user intent, context, or preferences for your AI agent's domain. Focus on events that reveal workflow or project engagement.
  3. Implement Trace Collection
    Set up a local, privacy-preserving mechanism to monitor and log relevant file system activities. Ensure data is processed locally and not exposed externally, adhering to FileGram's core principle.
  4. Integrate Traces into Agent Model
    Design and implement a method to incorporate these collected behavioral traces into your AI agent's learning or decision-making model. This could involve feature engineering from traces or direct input into context-aware modules.
  5. Evaluate Personalization Impact
    Develop metrics to assess the effectiveness of personalization grounded in file system traces. Measure improvements in agent utility, relevance, or user satisfaction compared to non-personalized or statically personalized agents.
Starter code
import time
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler

class FileActivityHandler(FileSystemEventHandler):
    def on_modified(self, event):
        if not event.is_directory:
            print(f"File modified: {event.src_path}")
    
    def on_created(self, event):
        if not event.is_directory:
            print(f"File created: {event.src_path}")

    def on_deleted(self, event):
        if not event.is_directory:
            print(f"File deleted: {event.src_path}")

    def on_moved(self, event):
        if not event.is_directory:
            print(f"File moved from {event.src_path} to {event.dest_path}")

if __name__ == "__main__":
    path = "."  # Monitor current directory. Change to target directory.
    event_handler = FileActivityHandler()
    observer = Observer()
    observer.schedule(event_handler, path, recursive=True)
    observer.start()
    try:
        while True:
            time.sleep(1)
    except KeyboardInterrupt:
        observer.stop()
    observer.join()
Source
FileGram: Grounding Agent Personalization in File-System Behavioral Traces — Action Pack