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
- Grasp FileGram's ConceptUnderstand how leveraging file system behavioral traces (e.g., file access, modification) can provide a rich, privacy-preserving data source for local AI agent personalization.
- Identify Key Behavioral SignalsDetermine 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.
- Implement Trace CollectionSet 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.
- Integrate Traces into Agent ModelDesign 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.
- Evaluate Personalization ImpactDevelop 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