alfred · the opt-in LLM layer
Reports that read
the graph for you.
Alfred isn't a chatbot bolted onto a sidebar. It's a prompt runner that templates over
graph queries — every report is just markdown + a SQL/PGQ context block. BYOK, local
models welcome, opt-in, nothing leaves your machine by default.
# Architecture Overview
## Context (graph)
```sql
SELECT n.name, n.file, n.fan_in
FROM symbols n WHERE n.fan_in >
10 ORDER BY n.fan_in
DESC LIMIT
12;
```
## Ask
You're a senior engineer giving a new teammate a 5-minute system tour. Use the
high-fan-in nodes above as the spine. End with a map: 4
layers, top to bottom.
# Day-One Guide
## Context (graph)
```sql
SELECT n.name, n.file
FROM entry_points() n
ORDER BY n.fan_in DESC;
```
## Ask
You're writing a day-one orientation for a senior dev joining the team. Start with the
entry points above. End with a checklist: 5 PRs they could
realistically ship in week 1.
# PR Risk Report
## Context (graph)
```sql
SELECT n.name, n.file, n.fan_in, has_tests(n.id)
AS tested
FROM blast_radius('${PR_BRANCH}')
ORDER BY n.fan_in DESC
LIMIT 20;
```
## Ask
You're a senior reviewer. Given the symbols above, write a 5-bullet risk report. Flag
any untested hot-paths. End with a verdict:
"ship", "caution", or
"hold".
# Dead Code Lens
## Context (graph)
```sql
SELECT n.name, n.file FROM symbols
n WHERE n.fan_in = 0
AND n.visibility = 'public'
AND n.last_touched > 180;
```
## Ask
Rank these by deletion safety. For each one, give a one-line argument for
delete-vs-keep. Group into
"safe", "check first", and
"keep — load-bearing".
# Impact Narrative
## Context (graph)
```sql
SELECT n.name, n.file, n.depth
FROM reachable_from('${SYMBOL}')
ORDER BY n.depth, n.fan_in DESC;
```
## Ask
Explain what changes when this symbol changes. Use the reachable nodes above. Tell the
story in 3 hops: direct, nearby,
surprising.
# Your Prompt
## Context (graph)
```sql
-- any DuckPGQ / SQL query
-- the result is passed as $CONTEXT
```
## Ask
Drop a markdown file in
.dextree/prompts/ with a SQL block and an "Ask" section.
Alfred picks it up automatically. BYOK, local models welcome.