Skip to content

Commit 1beb0f6

Browse files
authored
Merge pull request #46 from lufftw/feat/multi-agent-configurable-markmap-pipeline
2 parents ac14f86 + d4000e7 commit 1beb0f6

File tree

109 files changed

+23120
-523
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+23120
-523
lines changed

.gitignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,26 @@ docs/mindmaps/*.md
6161
!docs/mindmaps/README.md
6262
!docs/mindmaps/neetcode_ontology_ai_*.md
6363

64+
# =============================================================================
65+
# AI Markmap Agent (tools/ai-markmap-agent/)
66+
# =============================================================================
67+
68+
# AI Markmap Agent - Output files
69+
tools/ai-markmap-agent/outputs/intermediate/*.md
70+
tools/ai-markmap-agent/outputs/intermediate/*.html
71+
tools/ai-markmap-agent/outputs/final/*.md
72+
tools/ai-markmap-agent/outputs/final/*.html
73+
tools/ai-markmap-agent/outputs/debug/
74+
75+
# AI Markmap Agent - Data & persistence
76+
tools/ai-markmap-agent/data/chromadb/
77+
tools/ai-markmap-agent/data/*.json
78+
tools/ai-markmap-agent/data/*.yaml
79+
80+
# AI Markmap Agent - Logs
81+
tools/ai-markmap-agent/logs/*.log
82+
83+
# AI Markmap Agent - Environment (if not using root .env)
84+
tools/ai-markmap-agent/.env
85+
tools/ai-markmap-agent/.env.local
86+

README.md

Lines changed: 23 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ Most people practice algorithms in isolation. We built an **interconnected knowl
9393

9494
| Mind Map | Description | Link |
9595
|:---------|:------------|:----:|
96+
| 🤖 **AI Ontology Analysis (Evolved)** | Generated via a multi-agent pipeline | [🔗 EN](https://lufftw.github.io/neetcode/pages/mindmaps/neetcode_ontology_agent_evolved_en.html) · [🔗 中文](https://lufftw.github.io/neetcode/pages/mindmaps/neetcode_ontology_agent_evolved_zh-TW.html) |
9697
| 🤖 **AI Ontology Analysis** | AI-powered deep pattern synthesis | [🔗 EN](https://lufftw.github.io/neetcode/pages/mindmaps/neetcode_ontology_ai_en.html) · [🔗 中文](https://lufftw.github.io/neetcode/pages/mindmaps/neetcode_ontology_ai_zh-TW.html) |
9798
| 📐 **Pattern Hierarchy** | API kernels → patterns → solutions | [🔗](https://lufftw.github.io/neetcode/pages/mindmaps/pattern_hierarchy.html) |
9899
| 👨‍👩‍👧‍👦 **Family Derivation** | Base templates → derived variants | [🔗](https://lufftw.github.io/neetcode/pages/mindmaps/family_derivation.html) |
@@ -275,6 +276,8 @@ Our **AI Ontology Analyzer** processes the entire knowledge graph — API Kernel
275276

276277
| Language | Description | Links |
277278
|:---------|:------------|:------|
279+
| **English (Evolved)** | Generated via a multi-agent pipeline | [Static](docs/mindmaps/neetcode_ontology_agent_evolved_en.md) · [Interactive ✨](https://lufftw.github.io/neetcode/pages/mindmaps/neetcode_ontology_agent_evolved_en.html) |
280+
| **繁體中文 (Evolved)** | 由多代理(multi-agent)流程產生 | [Static](docs/mindmaps/neetcode_ontology_agent_evolved_zh-TW.md) · [Interactive ✨](https://lufftw.github.io/neetcode/pages/mindmaps/neetcode_ontology_agent_evolved_zh-TW.html) |
278281
| **English** | AI-synthesized pattern relationships | [Static](docs/mindmaps/neetcode_ontology_ai_en.md) · [Interactive ✨](https://lufftw.github.io/neetcode/pages/mindmaps/neetcode_ontology_ai_en.html) |
279282
| **繁體中文** | AI 智能分析模式關聯 | [Static](docs/mindmaps/neetcode_ontology_ai_zh-TW.md) · [Interactive ✨](https://lufftw.github.io/neetcode/pages/mindmaps/neetcode_ontology_ai_zh-TW.html) |
280283

@@ -306,139 +309,33 @@ Our **AI Ontology Analyzer** processes the entire knowledge graph — API Kernel
306309

307310
## 🤖 AI Mind Map Generation
308311

309-
> **"The synthesis of a Software Architect's system thinking, an Algorithm Professor's pedagogical wisdom, a Principal Engineer's battle-tested experience, and a Competitive Programming Champion's pattern recognition — all unified through AI."**
310-
311-
### The Vision
312-
313-
Traditional algorithm learning resources present knowledge in isolation. Our **AI Ontology Analyzer** takes a fundamentally different approach:
314-
315-
| Traditional Approach | Our AI Approach |
316-
|:---------------------|:----------------|
317-
| Static problem lists | Dynamic knowledge graph synthesis |
318-
| Manual categorization | AI-discovered pattern relationships |
319-
| Single perspective | Multi-perspective expert synthesis |
320-
| Memorize solutions | Understand interconnections |
321-
322-
### How It Works
323-
324-
```
325-
┌─────────────────────────────────────────────────────────────────┐
326-
│ KNOWLEDGE GRAPH INPUT │
327-
├─────────────────────────────────────────────────────────────────┤
328-
│ ontology/ │ meta/problems/ │ docs/patterns/ │
329-
│ ├── api_kernels │ ├── 0001_*.toml │ ├── sliding_window │
330-
│ ├── patterns │ ├── 0003_*.toml │ └── ... │
331-
│ ├── algorithms │ └── ... │ │
332-
│ └── ... │ │ │
333-
└─────────────────────┴─────────────────────┴─────────────────────┘
334-
335-
336-
┌─────────────────────────────────────────────────────────────────┐
337-
│ AI SYNTHESIS ENGINE │
338-
├─────────────────────────────────────────────────────────────────┤
339-
│ 🏗️ Software Architect → System-level pattern organization │
340-
│ 📚 Algorithm Professor → Pedagogical structure & progression │
341-
│ ⚙️ Principal Engineer → Practical applicability & trade-offs│
342-
│ 🏆 Competitive Champion → Pattern recognition shortcuts │
343-
│ 🎨 API Designer → Clean knowledge interfaces │
344-
└─────────────────────────────────────────────────────────────────┘
345-
346-
347-
┌─────────────────────────────────────────────────────────────────┐
348-
│ INTELLIGENT OUTPUT │
349-
├─────────────────────────────────────────────────────────────────┤
350-
│ ✅ Smart Links: GitHub solution (if exists) → LeetCode fallback│
351-
│ ✅ Multi-language: EN / 繁體中文 / 简体中文 │
352-
│ ✅ Markmap format: Interactive, collapsible, beautiful │
353-
│ ✅ Custom goals: Interview prep / Systematic learning / Review │
354-
└─────────────────────────────────────────────────────────────────┘
355-
```
356-
357-
### Quick Start
358-
359-
```bash
360-
# Interactive mode (recommended)
361-
python tools/generate_mindmaps_ai.py
362-
363-
# Specific goals
364-
python tools/generate_mindmaps_ai.py --goal interview # Interview preparation
365-
python tools/generate_mindmaps_ai.py --goal systematic # Learning roadmap
366-
python tools/generate_mindmaps_ai.py --goal pattern_mastery # Deep pattern analysis
367-
368-
# Focus on specific topic
369-
python tools/generate_mindmaps_ai.py --topic sliding_window
370-
python tools/generate_mindmaps_ai.py --topic dynamic_programming
371-
372-
# Multiple languages
373-
# Configure in tools/mindmap_ai_config.toml:
374-
# language = ["en", "zh-TW"]
375-
```
376-
377-
### 🔄 Automatic Generation (Local CI/CD)
378-
379-
**Auto-generate AI mind maps on commit** using pre-commit hooks:
380-
381-
```bash
382-
# Install pre-commit hooks
383-
pip install pre-commit
384-
pre-commit install
385-
```
386-
387-
When you commit changes to `ontology/`, `meta/problems/`, or `tools/generate_mindmaps.py`, the hook automatically runs AI mind map generation.
388-
389-
**Skip when needed:**
390-
```bash
391-
# Skip with commit message
392-
git commit -m "Update ontology [skip-ai]"
393-
394-
# Skip with environment variable
395-
SKIP_AI_MINDMAPS=true git commit -m "Update ontology"
396-
```
397-
398-
> 📖 See [tools/README.md](tools/README.md#-local-cicd-automation) for complete setup and usage guide.
399-
400-
### Configuration
401-
402-
Edit `tools/mindmap_ai_config.toml` to customize:
403-
404-
| Section | What You Can Configure |
405-
|:--------|:-----------------------|
406-
| `[model]` | LLM model, temperature, max tokens |
407-
| `[output]` | Directory, filename, HTML generation |
408-
| `[ontology]` | Which knowledge graph data to include |
409-
| `[problems]` | Problem filters (difficulty, topics, roadmaps) |
410-
| `[generation]` | Goal, style, custom instructions |
411-
| `[links]` | GitHub repo URL, branch, link format |
412-
| `[advanced]` | Output language(s), complexity inclusion |
413-
414-
### The Intelligence Behind It
312+
> **"Let AI synthesize what takes humans years to internalize."**
415313
416-
The AI doesn't just reorganize data — it **synthesizes understanding** from multiple expert perspectives:
314+
### Two Generation Modes
417315

418-
| Perspective | Contribution to Mind Map |
419-
|:------------|:-------------------------|
420-
| 🏗️ **Software Architect** | Identifies abstraction layers, sees patterns as reusable components |
421-
| 📚 **Algorithm Professor** | Structures learning progression, explains "why" not just "how" |
422-
| ⚙️ **Principal Engineer** | Highlights production trade-offs, real-world applicability |
423-
| 🏆 **Competitive Champion** | Surfaces pattern-matching shortcuts, time-pressure optimizations |
424-
| 🎨 **API Designer** | Creates clean knowledge interfaces, consistent naming |
425-
| 👥 **Open Source Advocate** | Makes knowledge discoverable, contribution-friendly |
316+
| Mode | Description | Quick Start |
317+
|:-----|:------------|:------------|
318+
| **🤖 Evolved Agent** | Multi-expert refinement with consensus voting | `cd tools/ai-markmap-agent && python main.py` |
319+
| **🤖 Basic AI** | Single-pass synthesis from knowledge graph | `python tools/generate_mindmaps_ai.py` |
426320

427-
### Output Examples
321+
### Key Features
428322

429-
**With Solution (links to GitHub):**
430-
```markdown
431-
- [LeetCode 3 - Longest Substring Without Repeating](https://github.com/lufftw/neetcode/blob/main/solutions/0003_longest_substring_without_repeating_characters.py)
432-
```
323+
- 🧬 **Multi-Expert Synthesis** — Architect + Professor + Engineer perspectives
324+
- 🎯 **Smart Linking** — GitHub solution (if exists) → LeetCode fallback
325+
- 🌐 **Multi-language** — EN / 繁體中文
326+
- ♻️ **Regeneratable** — Version history with auto-increment
433327

434-
**Without Solution (links to LeetCode):**
435-
```markdown
436-
- [LeetCode 121 - Best Time to Buy and Sell Stock](https://leetcode.com/problems/best-time-to-buy-and-sell-stock/)
437-
```
328+
### Output Files
438329

439-
### No API Key? No Problem
330+
| Type | Output Path |
331+
|:-----|:------------|
332+
| **Evolved** | `docs/mindmaps/neetcode_ontology_agent_evolved_{lang}.md` |
333+
| **Basic** | `docs/mindmaps/neetcode_ontology_ai_{lang}.md` |
334+
| **HTML** | `docs/pages/mindmaps/*.html` |
440335

441-
The generator saves the complete prompt to `tools/prompts/generated/mindmap_prompt.md`. Copy and paste it into ChatGPT, Claude, or any LLM web interface.
336+
> 📖 **Evolved Agent**: See [`tools/ai-markmap-agent/README.md`](tools/ai-markmap-agent/README.md) for architecture, expert roles, and configuration.
337+
>
338+
> 📖 **Basic AI**: See [`tools/README.md`](tools/README.md) for configuration options.
442339
443340
---
444341

0 commit comments

Comments
 (0)