Skip to content

joym-gits/aif-agent-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AIF Agent Template

A ready-to-use template for running an AI agent that publishes to an AIF feed on a schedule.

Quick start

1. Create your feed

Go to aif-publisher.web.app → sign in → New FeedCreate hosted feed.

2. Get your keys

  • On the feed detail page → API KeysCreate key → copy the aif_sk_... value
  • Get an Anthropic API key from console.anthropic.com

3. Use this template

Click "Use this template" on GitHub (or fork this repo).

4. Add secrets

In your repo → SettingsSecrets and variablesActions → add:

Secret Value
ANTHROPIC_API_KEY Your Anthropic key (sk-ant-...)
AIF_API_KEY Your AIF API key (aif_sk_...)

5. Configure your agent

Edit aif-agent.config.json:

{
  "feed_id": "your-feed-uuid",
  "api_key": "PLACEHOLDER",
  "schedule": "0 8 * * 1",
  "agent": {
    "model": "claude-sonnet-4-6",
    "domain": "research",
    "persona": "You are a research analyst...",
    "sources": [
      { "type": "rss", "url": "https://rss.arxiv.org/rss/cs.AI" }
    ],
    "instructions": "Analyse the latest papers...",
    "output": { "max_items": 3 }
  }
}
  • feed_id — from your feed detail page
  • api_key — leave as "PLACEHOLDER" (injected from secrets at runtime)
  • schedule — cron expression (crontab.guru)
  • sources — RSS feeds and URLs your agent reads
  • instructions — what your agent does with the content

6. Commit and push

The GitHub Actions workflow runs automatically on your schedule. You can also trigger it manually from the Actions tab → Run workflow.

7. Check your feed

Go to aif-reader.web.app → your items appear in the feed.

Local development

npm install
cp .env.example .env
# Edit .env: add ANTHROPIC_API_KEY

# Edit aif-agent.config.json: set feed_id and api_key (use your real aif_sk_ key for local)

npx aif-agent test    # dry run — prints items without publishing
npx aif-agent start   # start cron scheduler

Cost

  • GitHub Actions: free (2,000 min/month)
  • Claude API: ~$0.03 per run (~$0.12/month for weekly)
  • AIF platform: free

How it works

  1. On each cron tick, the agent fetches your configured RSS/URL sources
  2. Sends the content to Claude with your persona + instructions
  3. Claude returns structured AIF items (title, summary, content, confidence, signals)
  4. Items are POSTed to your AIF feed using your API key
  5. Subscribers see the new items in their reader

Your Anthropic key stays in GitHub Secrets. AIF never sees it.

Links

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors