Auto-filing Scripts and Knowledge Sharing
31 March 2026

I have particular filing system for any of the downloads or information that I get via email or search on the web. Here's how it goes:
Knowledge Inboxes
Firstly, anything that comes by email to any inboxes the attachment is scraped and put in one of two folders in my directory either inbox personal or inbox Work. One is for work emails and the other for personal. This inbox idea is taken from Getting Things Done by David Allen. It enables me to collect information in one specific place and file it where I can find it later. As opposed to trying to find something in my email from 18 months ago, which is a nightmare.
Secondly, the PARA methodology for filling everything away so that I know where it is. This methodology enables me to find knowledge on relevant current projects when I need it but also find information from the past that can help me in the future. This system was popularised in the book Second Brain by Thiago Forte.
PARA method for organising information
Projects - what are you currently working on? Is the new information relevant for this?
Areas - different areas of your life that you want to manage over time e.g. health
Resources - topics or interests that may be useful in the future e.g. electronics.
Archives - inactive items from the other 3 categories
Building a script to help me sort my Inboxes
My prompt:
<aside>
My directory on my OneDrive has a specific structure. Four Categories. Projects - for key projects that I am currently working on. Areas - these are areas of my live e.g. Bills that I need to manage on an Ad-hoc basis Resources - information in key categories e.g. sales that I can call information from if needed. Archive - information from previous projects that is No longer needed.
I have both an Inbox Work and Inbox Personal folder. All downloads from browsers or emails or whatsapp go here.
I would like to train an agent to be able to automatically sort the files that are downloaded, but I want to be able to give it feedback so that it can improve the accuracy of sortation.
Please can you help me build this.
</aside>
Claude Response:
<aside>
Q: How should the script be triggered? A: Run it manually whenever I want
Q: What file types will mostly land in your Inboxes? (Select all that apply) A: Documents (PDF, Word, Excel), Images (JPG, PNG, screenshots)
Q: Do you have sub-folders inside Projects / Areas / Resources? A: Yes, many sub-folders already exist
</aside>
This script uses OpenAI's gpt-4o-mini model to automatically sort files from two inbox folders (Work and Personal) into a PARA-structured filing system. For each file, it sends the filename, your live folder tree (3 levels deep), and any learned sorting rules to the model, which returns a suggested destination. You can approve, redirect, or skip each suggestion. When you redirect, the script logs the correction and over time promotes repeated patterns into rules, reducing reliance on the AI for similar files in future. A breakdown of the how the python script works below:
1. Scanning the inboxes Collects all supported files from both inbox folders:
for fname in sorted(os.listdir(inbox)): ext = os.path.splitext(fname)[1].lower() if ext in SUPPORTED_EXTENSIONS: files.append((fpath, label))
2. Building the folder tree Reads your actual PARA folder structure 3 levels deep to send to the model:
lines.append(f"{category}/") lines.append(f" {l1}/") lines.append(f" {l2}/") lines.append(f" {l3}/")
3. Injecting learned rules Past corrections and promoted patterns are added to the prompt:
parts.append("Learned patterns (apply these first):") parts.append(f' - Files matching "{p["match"]}" → {p["destination"]}') parts.append("Recent user corrections:") parts.append(f' - "{c["filename"]}" was moved to {c["destination"]}')
4. Asking the model Sends system + user prompt to gpt-4o-mini and parses the JSON response:
response = client.chat.completions.create( model="gpt-4o-mini", messages=[ {"role": "system", "content": system}, {"role": "user", "content": user}, ], ) return json.loads(raw.strip())
5. Presenting the suggestion Shows the model's suggestion and reason, awaiting your decision:
print(f" File : {filename}") print(f" Suggest: {rel_dest}") print(f" Reason : {suggestion['reason']}") print(" [A] Approve [R] Redirect [D] Delete [S] Skip")
6. Moving the file Creates the destination folder if needed, handles name conflicts with a timestamp:
os.makedirs(dest_folder, exist_ok=True) if os.path.exists(dest_path): dest_path = os.path.join(dest_folder, f"{name}_{ts}{ext}") shutil.move(src, dest_path)
7. Learning from corrections Logs redirects and promotes repeated patterns into rules:
if len(matching) >= 3: rules["patterns"].append({"match": word, "destination": actual}) print(f" ✦ New rule learned: files containing '{word}' → {dest}")
Knowledge sharing in startups
Building my own little Python script for my personal knowledge management made me think in-depth on knowledge sharing in startups and how LLMs may impact them.
Michael Polanyi described that knowledge is either explicit and tacit. Explicit knowledge is easily articulated, codified, and stored (documents etc.). Tacit knowledge is within the individual's mind rooted in personal experience and context, so it is more difficult to codify and store (negotiating contracts).
Research conducted by the McKinsey Global Institute found that companies harnessing effective knowledge management practices can enhance aggregate worker productivity by up to 25%.
How do we make knowledge sharing a success?
I’ve seen 5 different ways that knowledge (both explicit and tacit) is transferred throughout organisations:
- Personal Interaction knowledge sharing (1:1 > meetings > presentations > town halls) (ordered highest to lowest in knowledge volume) - primary lever for tacit knowledge.
- Digital Message Interaction knowledge sharing - (email > slack / teams > other communication apps)
- Document knowledge sharing - (sent as part of a message from 2 > shared drive
- Company Wiki - a document that contains relevant knowledge that it is deemed employees need to know.
- Company Website - an overview of company products/services or mission
Primarily knowledge is held within teams unless it is actively shared as part of a combined project. For example, the Marketing team would use their own shared drive and primarily work with each other. Therefore, information about marketing plans or knowledge is limited in its spread across the company.
Encouraging knowledge-sharing in the business can come from ensuring that there are unified goals across the business, cross-functional projects, working on improving cross-functional workflows, training on how to best share knowledge, and giving employees the safety to share knowledge
Impact of Ai on knowledge-sharing
Three technologies will help: 1) Connections between different systems either by developers or low code solutions 2) Semantic search powered by LLMs to draw and synthesise information from multiple sources. 3) Anti-knowledge degradation software that can help to maintain up to date internal knowledge from external sources.
It won’t all be positive. The cost of ‘knowledge’ generation is low, so internal business systems may get overrun with information that is tangential to its. This could increase the cost of using LLM based systems for search and lower answer quality for semantic searches.
As with many analytical systems if you put rubbish in you get rubbish out so there is still a significant role for employees to play in knowledge management even with AI tools. This can be file naming conventions, put knowledge in writing, and continually sharing on shared systems.