Build a 100% Local AI Agent That Summarizes Daily News Straight Into Your Obsidian Vault

Build a 100% Local AI Agent That Summarizes Daily News Straight Into Your Obsidian Vault

In an era where tech news and articles drop by the minute, most of us hit the same wall: information overload. The sheer volume of data is enough to short-circuit your brain. Clicking through every site, every feed, hunting for the signal in the noise — it drains your cognitive energy on things that don't matter.

This is exactly where Cognitive Automation earns its keep. The idea is simple: build automated pipelines that handle the low-level thinking for you — filtering, triaging, and summarizing — so your brain can focus on what actually requires it.

Sure, you could wire this up with cloud tools like Zapier, Make, or the OpenAI API in an afternoon. But that comes at the cost of data privacy and recurring subscription fees that can quietly snowball. In this guide, we're building a personal AI agent that runs 100% on your own machine. It pulls news feeds, hands them to a local LLM for summarization, and drops the results straight into your Obsidian vault — no external servers, no data leaving your network.

---

### How the Local AI Agent Works

Before we write a single line of code, let's map out the data flow for the system we're building:

1. Fetch: A Python script pulls the latest headlines from the RSS feeds of sites you actually care about.

2. Summarize: The article content is sent to Ollama, running locally on your machine, where a local LLM distills the key points.

3. Store: The summary is saved as a Markdown file (.md) in your Obsidian vault, ready for you to read.

Every single step happens on your own hardware. Zero data is transmitted to any external server. That means it's fast, private, and completely under your control.

---

### Prerequisites

For this Cognitive Automation pipeline to work, you'll need the following installed on your machine:

1. Python 3: Used to run the feed-fetching script and orchestrate the AI workflow.

2. Ollama: Runs local LLMs on your machine (download from ollama.com).

3. Obsidian: A Markdown-based note-taking app that powers your Second Brain.

Once Ollama is installed, open your Terminal or Command Prompt and pull the model you want to use. For this guide, we'll use llama3 or gemma2 — both handle multilingual content well:


ollama pull llama3

---

### Writing the Python Script for Your AI Agent

Let's build the brain of our news-summarizing agent. Create a file called summarizer_agent.py and drop in the following code:


import urllib.request
import json
import xml.etree.ElementTree as ET
import os
from datetime import datetime

# Configure your Obsidian vault path and the RSS feed URL to summarize
OBSIDIAN_VAULT_PATH = "/home/linn/notes/Daily Summaries"  # Change to your Obsidian folder path
RSS_FEED_URL = "https://www.blognone.com/atom.xml"  # Example: Blognone news feed
LLM_MODEL = "llama3"  # Model to use in Ollama

def fetch_rss_titles(url):
    print("Fetching news from RSS feed...")
    req = urllib.request.Request(url, headers={'User-Agent': 'Mozilla/5.0'})
    with urllib.request.urlopen(req) as response:
        xml_data = response.read()
    
    root = ET.fromstring(xml_data)
    articles = []
    
    # Supports both RSS 2.0 and Atom feed formats
    namespaces = {'atom': 'http://www.w3.org/2005/Atom'}
    entries = root.findall('atom:entry', namespaces) or root.findall('.//item')
    
    for entry in entries[:5]:  # Grab only the 5 latest to keep processing time reasonable
        title = entry.find('atom:title', namespaces) or entry.find('title')
        link = entry.find('atom:link', namespaces) or entry.find('link')
        
        title_text = title.text.strip() if title is not None else ""
        link_href = link.attrib.get('href', '').strip() if link is not None and 'href' in link.attrib else (link.text.strip() if link is not None else "")
        
        articles.append({"title": title_text, "link": link_href})
    return articles

def generate_summary(article_title):
    prompt = f"Summarize the following news headline concisely in bullet points, focusing on key takeaways and potential impact:\n\nHeadline: {article_title}"
    
    url = "http://localhost:11434/api/generate"
    data = {
        "model": LLM_MODEL,
        "prompt": prompt,
        "stream": False
    }
    
    req = urllib.request.Request(
        url, 
        data=json.dumps(data).encode('utf-8'), 
        headers={'Content-Type': 'application/json'}
    )
    
    try:
        with urllib.request.urlopen(req) as response:
            res_data = json.loads(response.read().decode('utf-8'))
            return res_data.get('response', 'Unable to generate summary')
    except Exception as e:
        return f"Error connecting to Ollama: {str(e)}"

def main():
    articles = fetch_rss_titles(RSS_FEED_URL)
    if not articles:
        print("No new articles found.")
        return
        
    date_str = datetime.now().strftime("%Y-%m-%d")
    content = f"---\ntitle: Daily News Summary {date_str}\ndate: {date_str}\ntags: [news, daily-summary, cognitive-automation]\n---\n\n"
    content += f"# Daily News Summary — {date_str}\n\n"
    
    for i, article in enumerate(articles, 1):
        print(f"Processing article {i}: {article['title']}")
        summary = generate_summary(article['title'])
        content += f"## [{article['title']}]({article['link']})\n\n"
        content += f"**AI Summary:**\n{summary}\n\n---\n\n"
        
    # Ensure the target directory exists
    os.makedirs(OBSIDIAN_VAULT_PATH, exist_ok=True)
    file_path = os.path.join(OBSIDIAN_VAULT_PATH, f"Summary-{date_str}.md")
    
    with open(file_path, "w", encoding="utf-8") as f:
        f.write(content)
    print(f"Daily summary saved to: {file_path}")

if __name__ == "__main__":
    main()

---

### Scheduling the Script for Full Automation

Now that the processing script is ready, the final step is to set it on a timer so it runs hands-free. This is what turns a one-off script into true Cognitive Automation — a system that works for you without you having to remember to trigger it.

#### For Linux and macOS (via Cron)

Open your Terminal and run:


crontab -e

Add this line at the bottom of the file to schedule the script to run at 8:00 AM every day:


0 8 * * * /usr/bin/python3 /home/linn/summarizer_agent.py

(Note: Adjust the Python interpreter path and script path to match your actual system.)

#### For Windows (via Task Scheduler)

1. Open Task Scheduler and select Create Basic Task.

2. Name the task something like Local AI News Summarizer and set the trigger to Daily.

3. Under Action, choose Start a Program.

4. In the Program/script field, point to your python.exe location, and paste the full path to your script in the Add arguments field.

---

### Why This Is Worth Building

Setting up a local-first Cognitive Automation pipeline like this goes far beyond just saving time. Here's what you actually gain:

* No usage caps or metered billing: Run the script as many times as you want, summarize as many articles as you like — there's no per-token pricing, no rate limits, no surprise invoices.

* Genuinely lighter cognitive load: When you sit down in the morning, you don't need to open a dozen browser tabs and wade through headlines. Just open Obsidian, flip to your daily summary file, and absorb the key points in under five minutes.

* Knowledge that compounds: Because every summary lives as a Markdown file in your Obsidian vault, you can instantly create bi-directional links connecting those news items to your project notes, research folders, or any related context in your Second Brain.

Offloading repetitive mental tasks to an automated system frees up the most valuable resource you have — your attention — for the thinking, problem-solving, and creative work that actually moves the needle. Take this blueprint, swap in your favorite feeds, tweak the prompt, and make it yours. Your brain will thank you.

🛒 TREND DEE STORE • ร้านเทรนด์ดี

🛠️ Tools for Frictionless PKM & Second Brain

Curated hardware and tools tailored for this guide