SlothVault: A Zero-Effort Local MCP + RAG Agent That Rewards Digital Laziness published: true A developer built SlothVault, a local-first personal RAG utility that ingests unorganized notes into a vault and retrieves relevant entries via an open-weight agent. The project pairs the all-MiniLM-L6-v2 sentence-transformer embedding model with Qwen2.5-1.5B-Instruct for answer synthesis, exposing retrieve_from_vault and add_to_vault as Model Context Protocol tool functions behind a Gradio interface. This is a submission for the Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady SlothVault is a local-first personal RAG utility built for anyone too tired or busy to manually sort, tag, and organize digital clutter. Every day, developers and researchers accumulate messy context fragments: Most productivity guides advise spending hours building complex databases in Notion or Obsidian. SlothVault takes the lazy approach: dump your unorganized notes into a local vault and let an open-weight agent fetch what you need in seconds. .txt files on the fly. retrieve from vault and add to vault . python import json import torch import numpy as np import gradio as gr from transformers import pipeline from sentence transformers import SentenceTransformer from sklearn.metrics.pairwise import cosine similarity 1. Load Local Open-Weight Models embed model = SentenceTransformer "all-MiniLM-L6-v2" device = "cuda" if torch.cuda.is available else "cpu" llm pipeline = pipeline "text-generation", model="Qwen/Qwen2.5-1.5B-Instruct", torch dtype=torch.bfloat16 if torch.cuda.is available else torch.float32, device map="auto" if torch.cuda.is available else None 2. In-Memory Vault & Seed Data vault docs = "WiFi Password for Home Lab is 'lazy sloth 42'. Do not share externally.", "Invoice 8841 from Cloud hosting was $45.20, due on November 5th.", "Doctor appointment rescheduled to Friday at 4:30 PM with Dr. Sharma.", "Project roadmap milestone 2 requires TabPFN model benchmarking by next Tuesday." vault embeddings = embed model.encode vault docs 3. Model Context Protocol MCP Tool Functions def mcp retrieve from vault query: str, top k: int = 2 : global vault docs, vault embeddings if not vault docs: return q vec = embed model.encode query scores = cosine similarity q vec, vault embeddings 0 top indices = np.argsort scores ::-1 :top k return {"text": vault docs i , "similarity score": round float scores i , 3 } for i in top indices def mcp add to vault new text: str : global vault docs, vault embeddings cleaned = new text.strip if not cleaned: return "Empty note." vault docs.append cleaned new embedding = embed model.encode cleaned vault embeddings = np.vstack vault embeddings, new embedding return f"Added to vault. Total items: {len vault docs }" 4. Agent Synthesis SYSTEM PROMPT = "You are SlothVault. The user is exhausted. You have executed the MCP tool " "'retrieve from vault' and received matching records. " "Give the exact answer in 1-2 punchy sentences. " "End with a short sloth remark like 'Now go back to resting. 🦥'." def sloth agent search query: str : if not query.strip : return "Ask something you're too lazy to search for " retrieved = mcp retrieve from vault query, top k=2 context str = "\n".join f"- {r 'text' } Match: {r 'similarity score' } " for r in retrieved messages = {"role": "system", "content": SYSTEM PROMPT}, {"role": "user", "content": f"Query: {query}\n\nContext:\n{context str}"} res = llm pipeline messages, max new tokens=120, temperature=0.2 answer = res 0 "generated text" -1 "content" .strip trace = f" {% endraw %} json\n" f"// MCP Tool Execution Trace\n" f'{{"tool": "retrieve from vault", "query": "{query}", "matches": {len retrieved }}}\n' f" {% raw %} \n\n" f" Retrieved Context: \n{context str}\n\n" f"---\n" f" Sloth Answer\n{answer}" return trace def handle upload file obj, raw text : count = 0 if file obj is not None: with open file obj.name, "r", encoding="utf-8", errors="ignore" as f: for line in f.readlines : if line.strip : mcp add to vault line.strip count += 1 if raw text and raw text.strip : mcp add to vault raw text.strip count += 1 return f"Successfully ingested {count} item s into vault." with gr.Blocks theme=gr.themes.Soft , title="SlothVault" as demo: gr.Markdown " SlothVault: Zero-Effort Local MCP + RAG Agent" gr.Markdown "Stop organizing notes manually. Dump raw clutter and let an open-weight agent retrieve it." with gr.Tab " Ask the Sloth Agent" : query in = gr.Textbox label="Ask anything:", value="What is my home lab wifi password and when is the cloud bill due?" search btn = gr.Button " Find It For Me", variant="primary" output box = gr.Markdown search btn.click fn=sloth agent search, inputs=query in, outputs=output box with gr.Tab " Dump More Clutter Add Notes " : note in = gr.Textbox label="Paste note or snippet:", placeholder="e.g., Gate code is 8842" file in = gr.File label="Upload .txt file", file types= ".txt" add btn = gr.Button " Ingest Without Organizing" status box = gr.Markdown add btn.click fn=handle upload, inputs= file in, note in , outputs=status box demo.launch share=True How I Built It SlothVault combines open-weight models, dense semantic retrieval, and the Model Context Protocol MCP : Standardized MCP Tool Contracts: Instead of building an ad-hoc search script, the data operations implement retrieve from vault and add to vault tool definitions, ensuring compatibility with standard agent frameworks. Fast Local Vector Search: sentence-transformers/all-MiniLM-L6-v2 embeds text into 384-dimensional vectors. Cosine similarity matching retrieves the top-ranked context in milliseconds without a heavy external vector database. Local Open-Weight Reasoning: Qwen/Qwen2.5-1.5B-Instruct synthesizes the retrieved chunks on-device, extracting precise facts and avoiding generative hallucinations. Why Does Open Innovation Matter? Absolute Privacy: Personal notes, Wi-Fi credentials, medical reminders, and invoices never leave the machine. Running inference locally keeps sensitive personal data off third-party servers. Zero Operating Cost: Powered by open weights, the agent runs entirely free of token limits, monthly subscriptions, or cloud API paywalls. Offline Reliability: Because the models run on-device, the agent functions normally on a laptop even without an internet connection. Prize Categories Top Prize: Slow and Steady $250 USD