feat(knowledge): change knowledge base to index-driven self-organizing structure

This commit is contained in:
zhayujie
2026-04-10 16:06:04 +08:00
parent 6a737fb734
commit 5748ded52c
2 changed files with 40 additions and 38 deletions

View File

@@ -15,18 +15,18 @@ Maintain a persistent, structured knowledge base in the `knowledge/` directory.
### 1. Ingest — User shares an article, document, or resource
1. Read and understand the source material
2. Extract key facts, entities, concepts, and insights
3. Create or update relevant pages:
- `knowledge/sources/<slug>.md` — source summary
- `knowledge/entities/<name>.md` — people, companies, projects mentioned
- `knowledge/concepts/<topic>.md` — new concepts or topics discussed
4. Update `knowledge/index.md` — add one-line entry per new/updated page
5. Append to `knowledge/log.md`
2. Extract key facts, insights, and structured knowledge
3. Determine the appropriate subdirectory:
- Read `knowledge/index.md` to see existing categories
- If a matching category exists, follow that structure
- If not, create a new subdirectory with a clear name
4. Create the knowledge page: `knowledge/<category>/<slug>.md`
5. Update `knowledge/index.md` and append to `knowledge/log.md`
### 2. Synthesize — Conversation produces valuable structured knowledge
1. Create `knowledge/analysis/<slug>.md` with the structured analysis
2. Update related entity/concept pages with cross-references
1. Create a knowledge page under the appropriate category
2. Update related pages with cross-references
3. Update `knowledge/index.md` and `knowledge/log.md`
### 3. Query — User asks about accumulated knowledge
@@ -40,38 +40,37 @@ Maintain a persistent, structured knowledge base in the `knowledge/` directory.
```markdown
# Page Title
Content here. Reference other pages with markdown links:
[Related Entity](../entities/related-entity.md)
Content here. Cross-reference related pages with markdown links:
[Related Page](../category/related-page.md)
## Key Points
- ...
## Sources
## Related
- [Source Title](../sources/source-slug.md)
- [Page A](../category/page-a.md) — how it relates
- [Page B](../category/page-b.md) — how it relates
```
Cross-references build a knowledge graph. When creating or updating a page, always link to related pages, and update those pages to link back.
## Index Format (`knowledge/index.md`)
Flat list, one line per page: `[Title](path) — one-line summary`. No tables, no emoji, no template headers.
Flat list, one line per page: `[Title](path) — one-line summary`. Group by category (matching subdirectories). No tables, no emoji.
```markdown
# Knowledge Index
## Concepts
- [Topic Name](concepts/topic-name.md) — one-line description
## Category A
- [Page Title](category-a/page-slug.md) — one-line summary
## Sources
- [Article Title](sources/article-slug.md) — one-line summary
## Entities
- [Entity Name](entities/entity-name.md) — one-line description
## Analysis
- [Analysis Title](analysis/analysis-slug.md) — one-line summary
## Category B
- [Page Title](category-b/page-slug.md) — one-line summary
```
Category names and structure are flexible — follow whatever organization already exists in the index, or create new categories based on the content.
## Log Format (`knowledge/log.md`)
Append-only, newest at bottom:
@@ -86,5 +85,6 @@ Append-only, newest at bottom:
- **File naming**: lowercase kebab-case (e.g. `machine-learning.md`)
- **One topic per page**: link between pages rather than duplicating
- **Update, don't duplicate**: if a page exists, update it
- **Cross-reference**: every page should link to related pages; keep the knowledge graph connected
- **Index is mandatory**: always update `knowledge/index.md` after any change
- **Be concise**: capture essence, not copy entire sources