npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

mdagent

v0.2.0

Published

Define AI agents for Ollama using only a single markdown file

Readme

Markdown Agent

Markdown Agent is a simple way to create and run AI agents using plain Markdown files. You write your agent’s behavior in everyday English (with some optional configuration in YAML), run it from the command line, and the results are saved as an HTML file.

It comes with a set of built-in tools for fetching URLs, reading RSS feeds, and loading local files. You can also extend it with your own tools in Node.js.

AI calls are handled by Ollama. Models and settings are controlled via YAML blocks in your Markdown agent.

Installation

  1. Install Node.js (use any method you prefer).
  2. Install Ollama and download at least one model (follow their instructions).
  3. Install Markdown Agent globally:
npm install -g mdagent

Quick Start Example

Create a file called my-agent.md:

# System

```yaml
model: gpt-oss:20b
tools:
  - fetchRss
\``` <-- remove the backslash

You are an editor that finds interesting articles to read. Today is {{CURRENT_DATE}}.

# Find topics

Load yesterday's RSS articles from `https://feeds.arstechnica.com/arstechnica/index` and pick two quirky, unique articles. Print their titles and URLs.

Run the agent:

mdagent my-agent.md

This will create a new HTML file in the output directory containing the full conversation and results.

💡 See examples for more complete samples.

Writing Markdown Agents

A Markdown agent is just a Markdown file with sections. The two main sections are:

  1. System section (# System) – sets the agent’s role, model, and configuration.
  2. User sections (# Something) – instructions for the agent, written in plain English.

Each additional # Header is run in order, with the output of one section passed into the next. When finished, the full run is saved as an HTML file in the output directory.

Configuration

Configuration is written inside YAML blocks at the top of a section. For example:

model: gpt-oss:20b
think: medium

# Advanced Ollama options (example: requires 16GB free memory)
seed: 42
num_ctx: 65536
num_predict: 16384
top_k: 40
top_p: 0.9

# Pass arguments to your agent from the CLI
# Example: mdagent my-agent.md --date 2025-09-15 --section tech
input:
  - date
  - section

# Tools available to this agent
tools:
  - fetchRss
  - fetchUrls
  - loadFile

Built-in Tools

  • fetchUrls – fetches one or more webpages. Converts HTML to Markdown. Supports options for selecting which parts to keep or remove with CSS selectors.
  • fetchRss – fetches an RSS feed, with optional filtering by date.
  • loadFile – loads the content of a local file into the agent’s context. Files must be in the same directory (or a sibling folder) as your Markdown file.

Custom Tools

You can extend Markdown Agent with your own tools in Node.js. A custom tool has:

  • A name – how the agent refers to it.
  • A description – tells the AI when it should use this tool.
  • An input schema – defined with Zod.
  • An execute function – the code that actually runs when the tool is called.

This makes it possible to add custom logic, fetch data from APIs, or even call other models.