Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions skills/memory-protocol/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Memory Protocol Skill

Gives any AI agent a persistent, structured memory using a single Markdown file (`agent-memory.md`). Defines when to read memory, how to write new entries, rules for keeping it clean, and a `/dream` consolidation procedure for when the file grows too large.

## Purpose

Long-running agents lose context between sessions. This skill solves that by:

- Reading memory before answering domain-specific questions
- Writing structured entries after significant tasks
- Replacing stale entries instead of appending duplicates
- Consolidating the file when it exceeds 200 lines via `/dream`

## When to Use This Skill

Activate when the agent:

- Receives a thematic question ("how does X work in this project?")
- Completes a significant task (new feature, debug session, config change)
- Is asked to remember something
- Encounters `/dream` command

**Activation keywords**: "remember", "what do you know about", "update memory", "/dream", any domain-specific question the agent might already know the answer to

## Memory File Location

Default path (adapt to your vault/project structure):
```
/data/obsidian-vault/ProjectName/agent-memory.md
```

## Entry Format

```markdown
### YYYY-MM-DD - Title
- Scope: user | project | session | team
- Content: ...
- Source: observation
- Expires: permanent
```

## The /dream Command

When `agent-memory.md` exceeds **200 lines**:

1. Read the full file
2. Group entries by topic, remove outdated duplicates
3. Save a snapshot of the old version to `Memory/dream-YYYY-MM-DD.md`
4. Write a condensed `agent-memory.md` (target: 50–70 lines)

This prevents context window bloat without losing historical data.

## Rules

- **Replace, don't append**: If a newer fact supersedes an old entry on the same topic, edit the file
- **Never store**: API keys, tokens, passwords, PII
- **Be concrete**: Entries should be actionable in a future session, not vague notes
63 changes: 63 additions & 0 deletions skills/memory-protocol/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
name: memory-protocol
description: |
Use this skill before thematic answers and after significant tasks.
Defines how to read, write, and consolidate persistent agent memory
stored in a structured Markdown file.
triggers:
- remember
- what do you know about
- update memory
- /dream
---

# Memory Protocol

## Read Before Answering

Before any thematic answer β€” check if the topic is already known:

```bash
cat /data/obsidian-vault/ProjectName/agent-memory.md
```

For deep search across the full vault:

```bash
grep -ril "TOPIC" /data/obsidian-vault/ --include="*.md"
```

---

## Write After Significant Tasks

After any significant task β€” update `agent-memory.md` with new facts.

**Entry format:**

```markdown
### YYYY-MM-DD - Title
- Scope: user | project | session | team
- Content: ...
- Source: observation
- Expires: permanent
```

---

## Rules

- **Replace stale entries** on the same topic β€” don't accumulate duplicates
- **Never save**: API keys, tokens, passwords, PII
- Entries must be concrete and actionable in a future session

---

## /dream β€” Consolidation

Run when `agent-memory.md` exceeds **200 lines**:

1. Read the full `agent-memory.md`
2. Group entries by topic, remove outdated and duplicate facts
3. Save snapshot of the old version β†’ `Memory/dream-YYYY-MM-DD.md`
4. Write condensed `agent-memory.md` (target: 50–70 lines)
67 changes: 67 additions & 0 deletions skills/obsidian-vault/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Obsidian Vault Skill

A two-layer knowledge architecture for Obsidian vaults used with AI agents. Enforces strict separation between raw input data and synthesized Wiki notes, preventing agents from accidentally writing to the semantic layer.

## Purpose

AI agents working with Obsidian tend to mix raw data and synthesized knowledge. This skill establishes:

- **Raw Layer** (`Reports/`, `Π’Ρ€Π΅Π½Π΄Ρ‹/`, `Sessions/`, `Knowledge/`, `Inbox/`) β€” source material with `type: raw_material`
- **Wiki Layer** (`Wiki/`) β€” atomic synthesis notes with `type: summary`, written only by a dedicated Wiki Compiler step

## When to Use This Skill

Activate when the agent needs to:

- Search for information in the vault
- Save a note or report to the vault
- Process files from an Inbox folder
- Understand the vault architecture before writing any files

**Activation keywords**: "save to obsidian", "find in notes", "search the vault", "add to vault", "organize notes"

## Architecture

```
vault/
β”œβ”€β”€ Wiki/ ← SEMANTIC LAYER β€” synthesis notes only. Read-only for most agents.
β”œβ”€β”€ Reports/ ← Raw Layer: reports, articles, research
β”œβ”€β”€ Π’Ρ€Π΅Π½Π΄Ρ‹/ ← Raw Layer: trend analysis, YouTube transcripts
β”œβ”€β”€ Sessions/ ← Raw Layer: session notes, AI chat logs
β”œβ”€β”€ Knowledge/ ← Raw Layer: instructions, guides, setup docs
β”œβ”€β”€ Inbox/ ← Raw Layer: incoming unprocessed files
β”œβ”€β”€ Memory/ ← Agent memory snapshots
β”œβ”€β”€ _INDEX.md ← Master index, update after every file change
└── _TEMPLATE.md ← Frontmatter template + Master Tag Dictionary
```

## Three-Stage Pipeline

For cron or manual vault maintenance:

| Stage | File | Scope |
|-------|------|-------|
| 1. Librarian | `agents/obsidian-librarian.md` | All folders except `Wiki/` β€” frontmatter, tags, routing |
| 2. Wiki Compiler | `agents/compiler-agent.md` | `Wiki/` β€” synthesize raw data into Sapling notes |
| 3. Semantic Linker | `src/semantic_linker.ts` | `Wiki/` only β€” horizontal semantic links |

## Frontmatter Format (Raw Layer)

```yaml
---
title: "Human readable title"
date: YYYY-MM-DD
category: cosmetology | psychology | business | development
tags: [tag1, tag2, tag_with_underscore]
type: raw_material
semantic_weights:
---
```

## Key Rules

- Wiki Layer is **read-only** for all agents except Wiki Compiler
- Only `type: raw_material` is written to Raw Layer
- Horizontal links exist **only** within Wiki Layer
- Raw files are isolated β€” no cross-links between Raw files
- Every file gets frontmatter; update `_INDEX.md` after any change
109 changes: 109 additions & 0 deletions skills/obsidian-vault/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
---
name: obsidian-vault
description: |
Use this skill before any read or write operation on an Obsidian vault.
Defines the two-layer architecture (Raw vs Wiki), frontmatter rules,
search strategy, and the three-stage pipeline for vault maintenance.
triggers:
- save to obsidian
- find in notes
- search the vault
- add to vault
- organize notes
- update index
---

# Obsidian Vault Architecture

## Two Layers β€” Strict Separation

### Raw Layer (your write zone)

Folders: `Inbox/`, `Reports/`, `Π’Ρ€Π΅Π½Π΄Ρ‹/`, `Sessions/`, `Knowledge/`

- All files must have `type: raw_material` in frontmatter
- No horizontal cross-links between Raw files
- Source of truth for input data

### Wiki Layer (read-only for most agents)

Folder: `Wiki/`

- Contains atomic synthesis notes (`type: summary`)
- The semantic knowledge base β€” always search here first
- Written **only** by the Wiki Compiler agent (`/compile_wiki`)
- **NEVER write to `Wiki/` directly** β€” if asked, redirect to Wiki Compiler

---

## Search Strategy

Always search Wiki first, then Raw if needed:

```bash
# Priority 1 β€” semantic layer
grep -ril "TOPIC" /data/obsidian-vault/ProjectName/Wiki --include="*.md"

# Priority 2 β€” raw sources (only if Wiki insufficient)
grep -ril "TOPIC" /data/obsidian-vault/ProjectName/Reports --include="*.md"
```

---

## Frontmatter (Raw Layer)

Every Raw file must have:

```yaml
---
title: "Human readable title"
date: YYYY-MM-DD
category: cosmetology | psychology | business | development
tags: [tag1, tag2, tag_with_underscore]
type: raw_material
semantic_weights:
---
```

**Tag rules:**
- Use underscores, no spaces: `skin_care` not `skin care`
- No pure numbers: `year2026` not `2026`
- 3–7 tags per file
- Check `_TEMPLATE.md` Master Tag Dictionary before creating new tags
- Add new tags to `_TEMPLATE.md` when you create them

---

## Three-Stage Pipeline

| Stage | Responsible | Scope |
|-------|------------|-------|
| 1. Librarian | `agents/obsidian-librarian.md` | Inbox/ + Raw folders: frontmatter, tags, routing |
| 2. Wiki Compiler | `agents/compiler-agent.md` | Wiki/: synthesize β†’ Sapling notes |
| 3. Semantic Linker | `src/semantic_linker.ts` | Wiki/ only: horizontal semantic links |

**Rule**: each stage works only in its own zone.

---

## File Routing (from Inbox)

- Session notes, chat logs β†’ `Sessions/`
- YouTube research, media transcripts β†’ `Π’Ρ€Π΅Π½Π΄Ρ‹/`
- Reports, analysis, articles β†’ `Reports/`
- Instructions, guides, setup docs β†’ `Knowledge/`

After routing, update `_INDEX.md`:
```
- [[FileName]] β€” brief description (date, main tags)
```

---

## Absolute Prohibitions

- ❌ Never create files in `Wiki/` β€” that's Wiki Compiler's job
- ❌ Never use `type: summary` β€” only `raw_material`
- ❌ Never add cross-links between Raw files
- ❌ Never modify tags of already-tagged files
- ❌ Never delete files β€” move to `Archive/` instead
60 changes: 60 additions & 0 deletions skills/search-retrieval/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Search & Data Retrieval Skill

Intelligent decision tree for selecting the right search or data retrieval tool. Prevents common mistakes like using Firecrawl for general search (wastes quota) or Google Grounding to find YouTube links (it can't return them).

## Purpose

This skill teaches the agent a **4-tool decision tree** for any external data task:

- **Google Grounding** β€” fast facts, news synthesis, date/price checks
- **SearXNG** β€” structured search with URLs and snippets (YouTube, news, science, images)
- **Gemini fetch** β€” read a known URL (articles, docs, blogs)
- **Firecrawl** β€” scrape JS/SPA sites or extract structured tables (use sparingly)

## When to Use This Skill

Activate when the agent needs to:

- Answer a factual question about current events
- Find YouTube videos on a topic
- Search for articles or papers with source links
- Read the content of a specific URL
- Scrape a dynamic site or extract table data

**Activation keywords**: "search", "find", "look up", "open the link", "read the article", "what's on [URL]", "latest news about", "YouTube videos on"

## Key Rules

### Tool Selection Matrix

| Task | Tool |
|------|------|
| Facts, news, definitions | Google Grounding |
| YouTube links & trends | SearXNG (category: videos) |
| Topic search with URLs | SearXNG (category: general) |
| Scientific papers | SearXNG (category: science) |
| Read a specific URL | Gemini fetch |
| JS/SPA site or tables | Firecrawl |

### Critical HTTP Rule

Always use Python `requests` with `json=` parameter for HTTP calls β€” never `curl` for requests with text bodies. This prevents Cyrillic and Unicode encoding issues.

### Firecrawl Conservation

Firecrawl has a 500-request limit. Use it **only** when Gemini fetch returns empty results or the target is a JavaScript-rendered page.

## Trend Monitoring Combo

For multi-step trend research:
1. SearXNG `videos` + `youtube` engine β†’ get URL list
2. Gemini fetch β†’ read descriptions/transcripts
3. Firecrawl β†’ only if fetch fails
4. Google Grounding β†’ fact-check and add context

## Anti-Hallucination Rules

- **Direct links only** β€” never provide encoded redirect URLs
- **YouTube format** β€” always `watch?v=XXXXXXXXXXX` (11-char ID)
- **No fabrication** β€” if no direct link found, say "Link not found"
- **Data freshness** β€” for 2024–2026 trends, rely on live search results, not internal knowledge
Loading