Skip to content

adesousa/jared

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Jared Logo

Jared: The AI COO

🐈 Jared is your AI personal assistant. Think of it like the COO (Chief Organisational Officer) of your life/company.

⚑️ Delivers core agent functionality in less than 3,000 lines of code.

πŸ“ Real-time line count: 2,625 lines (run bash scripts/core_agent_lines.sh or bun run lines to verify anytime)

🧬 Agentic as a Service (AGAAS)

Jared is an opinionated AGAAS framework β€” a ready-to-deploy AI agent that runs as a persistent service, not a one-shot chatbot.

Traditional Chatbot AGAAS (Jared)
You ask β†’ it answers β†’ done Always-on, always listening
Single channel Multi-channel simultaneously (Telegram + Slack + Email + ...)
Stateless or session-scoped Persistent SQLite memory across all channels
No initiative Proactive via heartbeat tasks & cron scheduling
Extensions require code Drop a SKILL.md file, restart, done
Generic framework Opinionated: batteries included, decisions made

The AGAAS Philosophy

  1. Agent, not assistant. Jared doesn't wait passively β€” it monitors heartbeat tasks, triggers cron jobs, and delivers results to the right channel proactively.
  2. Service, not CLI. Run it once, connect your channels, and Jared stays alive β€” handling messages from any source, remembering context across sessions.
  3. Opinionated, not configurable-to-death. SQLite for memory (not a vector DB). Markdown for skills (not a plugin SDK). Event bus for routing (not a message queue). Every choice optimizes for simplicity and low token cost.
  4. Ultra-lightweight by design. The entire agent core fits in < 3,000 LOC. If you can read JavaScript, you can understand and customize every line.

Key Features

  • πŸͺΆ Ultra-Lightweight: Core agent logic < 3,000 lines. Just the essentials. No bloat.
  • 🧠 Bun SQLite Memory: Uses a robust native SQL memory system with bun:sqlite to manage Short-Term Context, Categorized Long-Term Memory (Facts, Preferences, Rules, Summaries), and Cherry-Pick Grep (search) capabilities.
  • πŸ“‰ Native Token-Reduction Strategy: Drastically reduces token consumption through intelligent context management and selective memory retrieval.
  • πŸ—ΊοΈ Universal Routing: Jared automatically handles OpenAI-compatible endpoints (Ollama, vLLM, OpenRouter) and applies native adapter patterns for providers with custom schemas (like Google Gemini).
  • πŸ”Œ MCP Support: First-class Node.js implementation of Model Context Protocol for seamless tool extraction from stdio/SSE servers.
  • 🌐 Web Search & Fetch: Built-in Brave Search integration and URL content extraction β€” no external dependencies.
  • 🎯 Markdown Skills: Dynamic skill system inspired by Nanobot/OpenClaw β€” extend Jared by dropping a SKILL.md file into src/skills/.
  • πŸ”’ Exec Guard: Three-layer security for shell commands β€” allowlist, blocklist, and user confirmation mode.
  • πŸ—οΈ Workspace Sandboxing: Restrict agent operations to a dedicated workspace directory with path traversal protection.

πŸ’¬ Supported Channels

Channel What you need
Terminal Console Nothing β€” works out of the box
Telegram Bot token from @BotFather
Discord Bot token + Message Content intent
Slack Bot token (xoxb-...) + App-Level token (xapp-...)
WhatsApp QR code scan
Telegram

1. Create a bot

  • Open Telegram, search @BotFather
  • Send /newbot, follow prompts
  • Copy the token

2. Configure

{
  "channels": {
    "telegram": {
      "enabled": true,
      "token": "YOUR_BOT_TOKEN"
    }
  }
}

3. Run

jared start
Discord

1. Create a bot

2. Enable intents

  • In the Bot settings, enable MESSAGE CONTENT INTENT

3. Configure

{
  "channels": {
    "discord": {
      "enabled": true,
      "token": "YOUR_BOT_TOKEN"
    }
  }
}

4. Invite the bot

  • OAuth2 β†’ URL Generator
  • Scopes: bot
  • Bot Permissions: Send Messages, Read Message History
  • Open the generated invite URL and add the bot to your server

5. Run

jared start
Slack

Uses Socket Mode β€” no public URL required.

1. Create a Slack app

  • Go to Slack API β†’ Create New App β†’ "From scratch"

2. Configure the app

  • Socket Mode: Toggle ON β†’ Generate an App-Level Token with connections:write scope β†’ copy it (xapp-...)
  • OAuth & Permissions: Add bot scopes: chat:write, reactions:write, app_mentions:read
  • Event Subscriptions: Toggle ON β†’ Subscribe to bot events: message.im, message.channels, app_mention
  • App Home: Enable Messages Tab
  • Install App: Click Install to Workspace β†’ copy the Bot Token (xoxb-...)

3. Configure

{
  "channels": {
    "slack": {
      "enabled": true,
      "botToken": "xoxb-...",
      "appToken": "xapp-..."
    }
  }
}

4. Run

jared start
WhatsApp

Requires Node.js β‰₯18.

1. Configure

{
  "channels": {
    "whatsapp": {
      "enabled": true
    }
  }
}

2. Run and scan the QR code with WhatsApp β†’ Settings β†’ Linked Devices

jared start
Email

Give Jared its own email account. It polls IMAP for incoming mail and replies via SMTP.

1. Get credentials (Gmail example)

  • Create a dedicated Gmail account (e.g. my-jared@gmail.com)
  • Enable 2-Step Verification β†’ Create an App Password

2. Configure

{
  "channels": {
    "email": {
      "enabled": true,
      "imapHost": "imap.gmail.com",
      "imapPort": 993,
      "imapUsername": "my-jared@gmail.com",
      "imapPassword": "your-app-password",
      "smtpHost": "smtp.gmail.com",
      "smtpPort": 587,
      "smtpUsername": "my-jared@gmail.com",
      "smtpPassword": "your-app-password",
      "fromAddress": "my-jared@gmail.com"
    }
  }
}

3. Run

jared start

πŸ“¦ Installation & Setup

We recommend using Bun (primary) or npm (secondary).

  1. Clone and install dependencies:
git clone adesousa/jared.git
cd jared
bun install
bun link
  1. Initialize
jared onboard
  1. Configure (.jared/config.json)

Add or merge these parts into your config (other options have defaults).

Providers

Define your backend API endpoints and keys:

{
  "providers": {
    "ollama": {
      "url": "http://localhost:11434/v1",
      "keys": [
        {
          "name": "ollama-key",
          "value": "ollama",
          "models": ["qwen3:4b-instruct", "glm-4.6:cloud"]
        }
      ]
    },
    "openai": {
      "url": "https://api.openai.com/v1",
      "keys": [
        {
          "name": "openai-key",
          "value": "sk-...",
          "models": ["chatGPT-4o"]
        }
      ]
    },
    "gemini": {
      "keys": [
        {
          "name": "gemini-key",
          "value": "AIzaSy...",
          "models": ["gemini-2.0-flash"]
        }
      ]
    }
  }
}
Provider Purpose Get API Key
ollama LLM (local, OpenAI-compatible) β€”
openai LLM (GPT direct) platform.openai.com
gemini LLM (Gemini direct, native adapter) aistudio.google.com
mistral LLM (Mistral direct) console.mistral.ai
openrouter LLM (access to all models via single API) openrouter.ai

Any OpenAI-compatible endpoint also works (vLLM, LM Studio, etc.) β€” just set the url field.

Default Model

Set your default provider and active model:

{
  "agents": {
    "defaults": {
      "provider": "ollama",
      "model": "glm-4.6:cloud",
      "thinking": false,
      "maxIterations": 15
    }
  }
}
Field Description Default
provider The default LLM provider to use ollama
thinking Enable reasoning <think> blocks true
model The active model for the provider glm-4.6:cloud
maxIterations Max tool-use loops per message (prevents infinite loops/runaway $) 15

Channels

Enable and configure any channels you want Jared to run on:

{
  "channels": {
    "console": { "enabled": true },
    "discord": { "enabled": true, "token": "your-bot-token" }
  }
}

Security

Configure security for the exec tool (shell command execution):

{
  "security": {
    "exec": {
      "mode": "confirm",
      "allowedBins": [
        "curl",
        "gh",
        "summarize",
        "grep",
        "cat",
        "git",
        "node",
        "bun",
        "..."
      ]
    }
  }
}
Mode Behavior
confirm Allowlist + Blocklist + Ask user approval for every command (default)
allowlist Allowlist + Blocklist only (no prompt)
unrestricted Blocklist only (dangerous patterns always blocked)

Configure workspace sandboxing to restrict all exec commands to a dedicated directory:

{
  "security": {
    "restrictToWorkspace": true,
    "workspaceDir": ".jared/workspace"
  }
}

When enabled, commands cannot access files outside the workspace (blocks ../ traversal and absolute paths). See SECURITY.md for details.

See SECURITY.md for full details.

Web Search (Brave)

Optionally configure Brave Search for the web_search tool:

{
  "tools": {
    "web": {
      "search": {
        "apiKey": "your-brave-api-key"
      }
    }
  }
}

Get a free API key at brave.com/search/api.

Debug

Enable verbose debug logging:

{
  "debug": true
}

When false (default), debug-level logs are silently discarded.

MCP (Model Context Protocol)

The config format is compatible with Claude Desktop / Cursor. You can copy MCP server configs directly from any MCP server's README.

Jared supports MCP β€” connect external tool servers and use them as native agent tools.

{
  "mcp": {
    "servers": {
      "filesystem": {
        "command": "npx",
        "args": [
          "-y",
          "@modelcontextprotocol/server-filesystem",
          "/path/to/dir"
        ]
      },
      "my-remote-mcp": {
        "type": "url",
        "url": "https://example.com/mcp/sse",
        "headers": {
          "Authorization": "Bearer xxxxx"
        }
      },
      "my-streamable-mcp": {
        "type": "url",
        "transport": "streamable",
        "url": "https://example.com/mcp",
        "enabled": false
      }
    }
  }
}
Mode Config Example
Stdio command + args Local process via npx / uvx
HTTP/SSE type: "url" + url + headers (optional) Remote endpoint
Streamable HTTP type: "url" + transport: "streamable" + url Modern remote endpoint

Pro-Tip: You can add "enabled": false to any MCP server configuration to temporarily disable it and prevent its tools from injecting into Jared's context, without having to delete the config entirely.

MCP tools are automatically discovered and registered on startup. The LLM can use them alongside built-in tools β€” no extra configuration needed.

  1. Start Jared and Chat:
jared start

πŸ› οΈ Native Tools

Jared ships with these built-in tools (no configuration needed):

Tool Description
exec Execute shell commands (secured by Exec Guard)
search_memory Search past conversation history by keyword
add_memory Save a long-term memory (fact, preference, rule, summary)
remove_memory Remove an outdated memory by ID
cron Schedule reminders and recurring tasks (add/list/remove, cron expressions, timezones)
message Send proactive messages to the user on any channel
spawn Spawn a background subagent for async tasks (supports configurable roles via src/team/)
web_search Search the web via Brave Search API
web_fetch Fetch and extract readable text from any URL
heartbeat Manage the HEARTBEAT.md schedule (One Shot, Daily, Weekly, Monthly)
read_skill_manual Read the full markdown instructions from a skill so the agent knows how to use it

πŸ§‘β€πŸ’» The team/ Folder (Subagent Roles)

When using the spawn tool to trigger background tasks, Jared typically adopts its default personality. However, for specialized tasks, you can add Markdown files to the src/team/ folder (e.g., web_developer.md, data_analyst.md). If the spawn tool is called with a specific role parameter, the background subagent will assume that specialized system prompt instead.

Dynamic Awareness: Jared automatically detects files in the src/team/ directory and injects their names into his system prompt. This gives him dynamic awareness of all available team members so he can proactively assign tasks to them without overloading context.

🎯 Skills

Jared uses a Markdown-based skill system inspired by the Nanobot/OpenClaw architecture. Skills are SKILL.md files with YAML frontmatter. To keep context extremely lightweight, only the name and description of each skill are loaded into the main agent prompt. If Jared needs to use a skill, he uses the read_skill_manual tool to dynamically load the exact instructions for that turn.

Built-in Skills

Skill Description
cron Schedule reminders and recurring tasks
memory Two-layer memory system with grep-based recall
github Interact with GitHub using the gh CLI
weather Get weather info (no API key required)
summarize Summarize URLs, files, and YouTube videos
skill-creator Create new skills

Adding a New Skill

  1. Create a folder in src/skills/ (e.g., src/skills/my-skill/)
  2. Add a SKILL.md with YAML frontmatter and instructions:
---
name: my-skill
description: What this skill does and when to use it.
---

# My Skill

Instructions for the agent on how to use this skill...
  1. Restart Jared β€” the skill is automatically loaded!

πŸ’“ Heartbeat

Jared checks .jared/HEARTBEAT.md periodically (default: 30 seconds, configurable via heartbeat.intervalMs) for structured tasks. If active tasks are due, they are dispatched to the agent for processing.

## One Shot Tasks

### 3:00 PM β€” Setup Repo

- Clone the repository and install dependencies

## Daily Tasks

### 9:00 AM β€” Morning Briefing

- Summarize schedule and emails

## Weekly Tasks

### 5:00 PM Friday β€” Weekly Report

- Generate the weekly wrap-up report

## Monthly Tasks

### 1st β€” Billing Review

- Check API usage and billing

The agent can manage these tasks directly using the heartbeat tool (actions: add, remove, list). One Shot Tasks are automatically removed after they are executed. You can still use the cron tool for simpler one-off reminders.

CLI Reference

Command Description
jared onboard Initialize the agent and generate .jared/config.json
jared start Start Jared in interactive mode and connect configured channels
jared lines Check real-time codebase size (ensuring it stays under 3,000 LOC)
jared reset-memory Completely wipe the agent's persistent memory database
jared audit Run dependency security audit (checks for known vulnerabilities)

Interactive mode exits: exit, quit, or Ctrl+D.

πŸ—οΈ Architecture Details

Jared utilizes a generalized event bus natively (EventEmitter) to bridge decoupled channel connectors (Slack, Telegram, etc.) with the core agent loop. Core configurations are mapped in config.json. The engine seamlessly parses incoming instructions, integrates facts via the native SQLite memory tools, executes tools (via direct JS skills or MCP abstractions), and loops until the task is complete before responding to the source channel.

πŸ“ Project Structure

jared/
β”œβ”€β”€ .jared/
β”‚   β”œβ”€β”€ config.json     # βš™οΈ Agent configuration
β”‚   β”œβ”€β”€ memory.db       # 🧠 SQLite persistent memory
β”‚   β”œβ”€β”€ HEARTBEAT.md    # πŸ’“ Recurring tasks file
β”‚   └── workspace/      # πŸ”’ Exec sandbox (when restrictToWorkspace is on)
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ agent/          # 🧠 Core agent logic
β”‚   β”‚   β”œβ”€β”€ agent.js    #    Agent manager (spinUp orchestrator)
β”‚   β”‚   β”œβ”€β”€ loop.js     #    Agent loop (LLM ↔ tool execution)
β”‚   β”‚   β”œβ”€β”€ context.js  #    Prompt builder
β”‚   β”‚   β”œβ”€β”€ memory.js   #    Native bun:sqlite persistent memory
β”‚   β”‚   β”œβ”€β”€ skills.js   #    Dynamic SKILL.md loader
β”‚   β”‚   └── exec-guard.js #  Exec security (allowlist/blocklist/confirm)
β”‚   β”œβ”€β”€ tools/          # πŸ”§ Built-in tool implementations
β”‚   β”‚   β”œβ”€β”€ exec.js     #    Shell command execution
β”‚   β”‚   β”œβ”€β”€ cron.js     #    Cron job scheduling
β”‚   β”‚   β”œβ”€β”€ memory.js   #    Memory search/add/remove
β”‚   β”‚   β”œβ”€β”€ message.js  #    Proactive messaging
β”‚   β”‚   β”œβ”€β”€ spawn.js    #    Background subagent spawning
β”‚   β”‚   β”œβ”€β”€ web.js      #    Web search & fetch
β”‚   β”‚   └── read_skill_manual.js # Loading markdown skill context
β”‚   β”œβ”€β”€ skills/         # 🎯 Markdown-based skills (SKILL.md)
β”‚   β”‚   β”œβ”€β”€ cron/       #    Reminders & scheduling
β”‚   β”‚   β”œβ”€β”€ memory/     #    Memory management guide
β”‚   β”‚   β”œβ”€β”€ github/     #    GitHub CLI integration
β”‚   β”‚   β”œβ”€β”€ weather/    #    Weather lookups
β”‚   β”‚   β”œβ”€β”€ summarize/  #    URL/file summarization
β”‚   β”‚   └── skill-creator/ # Skill creation guide
β”‚   β”œβ”€β”€ bus/            # 🚌 Message routing (EventEmitter)
β”‚   β”œβ”€β”€ channels/       # πŸ“± Chat channel integrations
β”‚   β”œβ”€β”€ cli/            # πŸ–₯️ Commands (util.parseArgs)
β”‚   β”œβ”€β”€ config/         # βš™οΈ Configuration options
β”‚   β”œβ”€β”€ cron/           # ⏰ Scheduled tasks
β”‚   β”œβ”€β”€ heartbeat/      # πŸ’“ HEARTBEAT.md reader & dispatcher
β”‚   β”œβ”€β”€ mcp/            # πŸ”Œ Model Context Protocol integrations
β”‚   β”œβ”€β”€ providers/      # πŸ€– Universal LLM router
β”‚   β”œβ”€β”€ session/        # πŸ’¬ Conversation session tracking
β”‚   β”œβ”€β”€ identity/       # πŸ“œ SOUL and agent guidelines
β”‚   β”œβ”€β”€ team/           # πŸ§‘β€πŸ’» Specialized Subagent identities (e.g. web_developer.md)
β”‚   └── utils/          # πŸ› οΈ Helper utilities
β”œβ”€β”€ assets/             # πŸ–ΌοΈ Static assets (Jared Logo)
└── scripts/            # πŸ“œ Operations scripts (core_agent_lines.sh)

About

Your Ultra-Lightweight AI COO ! A small "OpenClaw" implementation in Javascript

Topics

Resources

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors