105 lines
3.9 KiB
Markdown
105 lines
3.9 KiB
Markdown
# LangCode Agent Wiki — Schema
|
|
|
|
## Purpose
|
|
Persistent knowledge base for the LangCode Agent project. Maintained entirely by an LLM agent running on Ollama (Gemma 2 9B). This wiki sits between raw source documents and your questions — knowledge is compiled once here, then kept current.
|
|
|
|
## Directory Structure
|
|
\`\`\`
|
|
llmwiki/
|
|
├── AGENTS.md ← this file (schema)
|
|
├── raw/ ← immutable source documents
|
|
│ ├── articles/ ← web articles, blog posts
|
|
│ ├── papers/ ← research papers, technical docs
|
|
│ ├── repos/ ← code repository notes
|
|
│ └── assets/ ← images, downloads, attachments
|
|
└── wiki/ ← LLM-generated, interlinked pages
|
|
├── index.md ← master catalog (updated every ingest)
|
|
├── log.md ← append-only changelog
|
|
├── overview.md ← wiki purpose & architecture
|
|
├── concepts/ ← one file per key concept
|
|
├── entities/ ← one file per person, org, tool
|
|
├── sources/ ← one file per source document
|
|
└── comparisons/ ← comparative analysis pages
|
|
\`\`\`
|
|
|
|
## Conventions
|
|
|
|
### Filenames
|
|
- lowercase, hyphens instead of spaces (e.g. \`self-attention.md\`)
|
|
- no special characters, no camelCase
|
|
- prefix with date for time-sensitive entries: \`2026-05-10-some-event.md\`
|
|
|
|
### Page Structure
|
|
Every wiki page must follow this template:
|
|
\`\`\`markdown
|
|
# Title
|
|
|
|
> One-sentence summary of this page.
|
|
|
|
## Tags
|
|
\`concept\` \`entity\` \`source-name\` \`date\`
|
|
|
|
## Body
|
|
[Content here — use ## and ### for sections]
|
|
|
|
## Related
|
|
- [[page-name]] — brief description of connection
|
|
- [[another-page]] — brief description
|
|
|
|
## Sources
|
|
- [Source Title](raw/sources/filename) — relevant passage or page range
|
|
\`\`\`
|
|
|
|
## Ingest Procedure
|
|
When a new source is added to \`raw/\`:
|
|
1. Read the source end-to-end
|
|
2. Identify key concepts, entities, claims, and data points
|
|
3. For each: create or update the relevant wiki page in \`wiki/\`
|
|
4. Add/update cross-references using \`[[wikilinks]]\`
|
|
5. Update \`wiki/index.md\` with new/modified pages
|
|
6. Append entry to \`wiki/log.md\` with format:
|
|
\`\`\`
|
|
## YYYY-MM-DD HH:MM — [source filename]
|
|
- Created: [new pages]
|
|
- Updated: [modified pages]
|
|
- Key takeaways: [bullet summary]
|
|
\`\`\`
|
|
7. Run the lint checklist (below)
|
|
|
|
## Query Procedure
|
|
When asked a question:
|
|
1. Read \`wiki/index.md\` first to identify relevant pages
|
|
2. Load only those pages (not the entire wiki at scale)
|
|
3. Synthesize answer from compiled wiki knowledge
|
|
4. Cite specific wiki pages: \`[[page-name]]\`
|
|
5. If the answer is valuable and reusable, file it as a new wiki page
|
|
|
|
## Lint Checklist
|
|
Run weekly or after every 5-10 ingests:
|
|
- [ ] Every page in \`wiki/\` appears in \`index.md\`
|
|
- [ ] Every \`[[wikilink]]\` resolves to an existing file
|
|
- [ ] No two pages cover the same concept (merge duplicates)
|
|
- [ ] Conflicting claims between pages are flagged, not silently overwritten
|
|
- [ ] No orphan pages (pages with zero inbound links)
|
|
- [ ] All pages follow the template structure above
|
|
- [ ] Tags are consistent across related pages
|
|
- [ ] Log entries are present and properly formatted
|
|
- [ ] Sources in \`raw/\` that have been updated are reflected in wiki
|
|
|
|
## Conflict Resolution
|
|
When sources disagree:
|
|
1. Note both claims explicitly on the relevant page
|
|
2. Cite both sources
|
|
3. Add a "Status" field: \`verified\` / \`disputed\` / \`unverified\`
|
|
4. Do NOT silently overwrite — preserve the history of claims
|
|
|
|
## Naming Conventions
|
|
- Page titles: Title Case (e.g. "Self-Attention Mechanism")
|
|
- Filenames: lowercase-hyphens (e.g. \`self-attention-mechanism.md\`)
|
|
- Tags: lowercase, hyphens (e.g. \`#attention-mechanism\`)
|
|
|
|
## Growth Targets
|
|
- After 10-20 sources: start querying the wiki for answers
|
|
- After 50+ sources: consider adding qmd for enhanced search
|
|
- After 100+ sources: review and potentially restructure wiki subdirectories
|