Skip to main content

AI-powered background services for Obsidian vault maintenance

Project description

Alfred

Alfred is a set of AI-powered background services that keep your Obsidian vault organized, connected, and intelligent — without you doing the busywork.

You drop a raw file into your inbox. Alfred turns it into a structured record, links it to the right projects and people, scans for broken references, extracts decisions and assumptions you made along the way, and maps how everything in your vault relates to everything else. It runs quietly in the background.

What does that look like?

You paste a meeting transcript into inbox/. A few seconds later, Alfred has:

  • Created a conversation record with participants, status, and activity log
  • Created or updated person records for everyone mentioned
  • Filed tasks with assignees and linked them to the right project
  • Linked everything together with wikilinks so it shows up in the right views automatically

Later, the janitor notices a project page has a broken link and fixes it. The distiller reads your recent session notes and extracts a decision record ("We chose Postgres over DynamoDB") with rationale and evidence links. The surveyor notices that three unrelated notes are all about the same theme and tags them as a cluster.

You don't trigger any of this. It just happens.

Quick Start

Prerequisites: Python 3.11+ and an AI agent backend. The default is Claude Code (claude on PATH). Alternatives: Zo Computer (HTTP API) or OpenClaw.

pip install alfred-vault
alfred quickstart

The quickstart wizard walks you through choosing a vault path, agent backend, and optional surveyor setup. It scaffolds the vault directory structure, writes config.yaml, and offers to start daemons immediately.

alfred up       # start background daemons
alfred status   # check what's running
alfred down     # stop everything

The Four Tools

Curator watches your inbox/ folder. When a new file appears (email, voice memo transcript, raw notes), curator reads it, invokes the AI agent with full vault context, and the agent creates structured records — conversations, people, tasks, whatever the content calls for.

Janitor periodically scans every file in your vault for structural problems: broken wikilinks, missing or invalid frontmatter fields, orphaned files with no connections, stub records with no real content. It reports what it finds, and in fix mode, hands the issues to the AI agent to repair.

Distiller reads your operational records — conversations, session logs, project notes — and identifies latent knowledge worth extracting. It creates epistemic records: assumptions (tracked beliefs with confidence levels), decisions (with context, options, and rationale), constraints, contradictions, and syntheses. These form an evidence graph that evolves as your vault grows.

Surveyor works differently from the other three. It embeds your vault content into vectors (via Ollama locally or an OpenAI-compatible API), clusters records by semantic similarity using HDBSCAN + Leiden community detection, asks an LLM to label the clusters, and writes relationship tags and wikilinks back into your files.

Install

# Base install (curator + janitor + distiller)
pip install alfred-vault

# Full install (adds surveyor — requires Ollama for embeddings + OpenRouter for labeling)
pip install "alfred-vault[all]"

# From source
git clone https://github.com/ssdavidai/alfred.git
cd alfred
pip install -e .          # base
pip install -e ".[all]"   # full

CLI

# Daemon management
alfred up                              # start all daemons (background)
alfred up --foreground                 # stay attached (dev/debug)
alfred up --only curator,janitor       # start specific tools
alfred down                            # stop daemons
alfred status                          # per-tool status overview

# Run tools individually
alfred curator                         # curator daemon (foreground)
alfred janitor scan                    # structural scan, print report
alfred janitor fix                     # scan + AI agent fix
alfred janitor watch                   # periodic sweep daemon
alfred distiller scan                  # find extraction candidates
alfred distiller run                   # scan + extract knowledge records
alfred distiller watch                 # periodic extraction daemon
alfred surveyor                        # full embed/cluster/label/write pipeline

# Direct vault operations
alfred vault create <type> <name>      # create a record
alfred vault read <path>               # read a record
alfred vault edit <path>               # edit a record
alfred vault list [type]               # list records

# Run external commands with vault context
alfred exec -- <command>               # injects ALFRED_VAULT_PATH etc.
alfred exec --scope curator -- <cmd>   # also sets ALFRED_VAULT_SCOPE

All commands accept --config path/to/config.yaml (default: config.yaml in cwd).

Configuration

alfred quickstart generates both files interactively. To configure manually instead:

cp config.yaml.example config.yaml
cp .env.example .env
# Edit both files

config.yaml has sections for vault, agent, logging, and each tool. Environment variables are substituted via ${VAR} syntax. See config.yaml.example for all options.

Agent Backends

Curator, janitor, and distiller delegate the actual reading and writing to an AI agent. You choose which one:

Backend How it runs Setup
Claude Code (default) claude -p subprocess Install Claude Code, ensure claude is on PATH
Zo Computer HTTP API Set ZO_API_KEY in .env
OpenClaw openclaw subprocess Install OpenClaw, ensure openclaw is on PATH

Set agent.backend in config.yaml to claude, zo, or openclaw.

Vault Structure

The vault uses structured Markdown files with YAML frontmatter. Records link to each other with [[wikilinks]] — open any project page and you'll see live tables of its tasks, conversations, sessions, and people, all populated automatically.

20 record types:

Category Types
Operational project, task, session, conversation, input, note, process, run, event, thread
Entity person, org, location, account, asset
Epistemic assumption, decision, constraint, contradiction, synthesis

alfred quickstart scaffolds the full directory structure with templates, base view definitions, and starter views (Home, CRM, Task Manager).

Data & State

Runtime state lives in data/. The vault itself is the source of truth — state files are bookkeeping and can be deleted to force a full re-process.

File Purpose
data/*_state.json Per-tool processing state (what's been seen, sweep history, etc.)
data/vault_audit.log Append-only JSONL log of every vault mutation
data/alfred.pid PID file for the background daemon
data/*.log Per-tool log files

Architecture

src/alfred/
  cli.py               # CLI dispatcher
  daemon.py             # background process management
  orchestrator.py       # multiprocess daemon manager with auto-restart
  quickstart.py         # interactive setup wizard
  _data.py              # bundled resource locator (importlib.resources)

  curator/              # inbox processor
  janitor/              # vault quality scanner + fixer
  distiller/            # knowledge extractor
  surveyor/             # semantic embedder + clusterer

  vault/                # vault operations layer (CRUD, mutation log, scoping)
  agent/                # pluggable AI backends (claude, zo, openclaw)

  _bundled/             # data files shipped in the wheel
    skills/             # agent skill prompts (one per tool)
    scaffold/           # vault directory structure, templates, base views

Each tool follows the same module pattern: config.py (typed dataclass), daemon.py (async entry point), state.py (JSON persistence), backends/ (agent interface), cli.py (subcommands).

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

alfred_vault-0.1.4.tar.gz (119.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

alfred_vault-0.1.4-py3-none-any.whl (204.6 kB view details)

Uploaded Python 3

File details

Details for the file alfred_vault-0.1.4.tar.gz.

File metadata

  • Download URL: alfred_vault-0.1.4.tar.gz
  • Upload date:
  • Size: 119.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for alfred_vault-0.1.4.tar.gz
Algorithm Hash digest
SHA256 2ccd55fd2ab98ecdb19059f64627af3120d02ab509abbefd63532fcad8878453
MD5 e938750f40a69d467e4a0b394a95c30f
BLAKE2b-256 0019e10020c07b39f6b276c18a70a5a976dce9972fc9a5aabe80c8309cbb786d

See more details on using hashes here.

File details

Details for the file alfred_vault-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: alfred_vault-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 204.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for alfred_vault-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7c73a43242ce2dc75dcc5e1aa8cd9d945d5fa00b1fdb51b61a897d500eb42b23
MD5 2c2badd868d91d16a6bebff1b6fafc1c
BLAKE2b-256 86a72f82a59562abef704c635583f0697bc10a75d7f69ce43e7546d8ab6b93e6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page