Learn knowledge from local directories and store it in agent memory for future reference.
Activate this skill when user says:
| Format | Extensions | Support |
|---|---|---|
| -------- | ------------ | --------- |
| Markdown | .md, .markdown | Full |
| Python | .py | Full |
| JavaScript/TypeScript | .js, .ts, .jsx, .tsx | Full |
| Java | .java | Full |
| Go | .go | Full |
| Rust | .rs | Full |
| C/C++ | .c, .cpp, .h, .hpp | Full |
| Shell | .sh, .bash, .zsh | Full |
| YAML/JSON/TOML | .yaml, .yml, .json, .toml | Full |
| SQL | .sql | Full |
| Other text | .txt, .csv | Full |
Not supported in v0.0.1: PDF, Word, Excel, PowerPoint, Keynote, audio, video files.
| Layer | Storage | Content | Purpose |
|---|---|---|---|
| ------- | --------- | --------- | --------- |
| L1 Core Memory | Agent Memory | Key conclusions, core concepts, decisions | Auto-surface in daily conversations |
| L2 Knowledge Index | Agent Memory | File paths, summaries, keyword mappings | Know where knowledge lives |
| L3 Source Files | Local filesystem | Complete original content | Deep-dive when needed via read_file |
How It Works:
All runtime data is stored in ~/.keep-learning/:
| File | Purpose |
|---|---|
| ------ | --------- |
| last-commit | Git commit hash of last learning session |
| config.json | User configuration (knowledge base path, etc.) |
First, search memory (category: project_environment_configuration) for an existing knowledge base path.
~/knowledge/work-assistant. Start learning from there?"Once confirmed, store the path in memory using update_memory with category project_environment_configuration.
Check if knowledge base is a git repository and pull latest changes before learning.
Scan for supported files. Exclude: .git, node_modules, .obsidian, __pycache__, .venv
For git repositories, detect ALL types of changes:
~/.keep-learning/last-commit using git diff HEAD --name-only git status --porcelainCombine both results to get the full list of changed files. This ensures learning happens even when:
After learning completes, update ~/.keep-learning/last-commit with current HEAD hash.
For non-git directories: scan all supported files (no incremental detection).
For each file: read content, identify theme/concepts/conclusions, extract key knowledge.
Create L1 memory entries using update_memory with appropriate category:
Title format: [Domain] Concise Topic Description
Create knowledge index with file path, theme, keywords mappings.
Output: Timestamp, Statistics, L1 Memories list, L2 Index summary, Notes.
Before creating: search_memory first. If exists, update; if not, create.
| Situation | Action |
|---|---|
| ----------- | -------- |
| First time user | Ask for knowledge base path |
| Git repo detected | Run git pull before scanning |
| Large file | Read in chunks, summarize each section |
| Duplicate knowledge | Update existing memory |
| Unsupported file | Skip and note in report |
共 1 个版本