Skip to content

Future: AI Module and Phase 2 Design

Relevant Source Files

This page outlines the planned evolution of PALEE (Personal Active Learning & Evaluation Engine) beyond its core deterministic features. It details the AI tutoring architecture, the transition to guided learning flows, and the resolution of architectural gaps identified during Phase 1.

AI Module Architecture

The AI module is designed as an intelligent layer above the Engine Core. It utilizes Large Language Models (LLMs) to facilitate Feynman-style testing and interactive tutoring while maintaining strict separation between AI-generated proposals and the deterministic vault state planning/ai_module_design.md#3-9

Interaction Flow

The system employs a tool-calling loop where the LLM can request context but cannot directly mutate the vault. All changes proposed by the AI must pass through a validation and user-confirmation gate planning/ai_module_design.md#64-80

AI Interaction Diagram

Sources:planning/ai_module_design.md#11-41planning/ai_module_design.md#88-118


AI Configuration and Session Continuity

Provider Configuration

AI capabilities require a configured provider. Credentials and endpoints are stored in platform-specific configuration directories planning/ai_module_design.md#45-55:

  • Unix/macOS: ~/.config/palee/ai_provider.json
  • Windows: %LOCALAPPDATA%\palee\ai_provider.json

The configuration includes base_url, api_key, and modelplanning/ai_module_design.md#48-50

Session Memory (hot.md)

To maintain continuity without exceeding LLM context limits, PALEE uses hot.md as a working memory buffer.

Sources:planning/ai_module_design.md#45-82src/storage/memory.ts#4-10


Feynman-Style Testing (palee test)

The palee test <topic> command (Phase 2) implements the Feynman technique:

  1. Context Loading: The engine reads the target topic note as the primary study material planning/PHASE_2_GAPS.md#139-140
  2. Interactive Dialogue: The AI asks conceptual questions; the user explains in their own words planning/PHASE_2_GAPS.md#140-141
  3. Multi-Dimensional Grading: The AI produces an assessment_proposal object containing scores for conceptual, practical, debug, and feynman pillars planning/ai_module_design.md#88-102
  4. Persistence: Scores are written to the topic's frontmatter (assessment), updating topic_mastery. Spaced-repetition recall scheduling (due_at) remains independently driven by user review records planning/palee_cli_spec.md#190-196

Sources:planning/PHASE_2_GAPS.md#112-146planning/ai_module_design.md#88-116


Guided Roadmap Generation

While Phase 1 supports deterministic YAML/Markdown roadmap imports, Phase 2 introduces a guided interview mode via palee roadmapplanning/roadmap_design.md#15-19

The Interview Flow

If no --from source is provided, the CLI initiates a 6-question interview covering planning/roadmap_design.md#23-30:

  • Learning goals and current level.
  • Availability (hours/week) and target dates.
  • Preferred practice styles and technology constraints.

Proposal Validation

The AI-generated roadmap must adhere to the roadmap_proposal schema, including roadmap_id, a unique topic_id list, and estimated effort planning/roadmap_design.md#38-66 The engine validates this for cycles and dangling dependencies before the user is asked to confirm the import planning/roadmap_design.md#68-80

Roadmap Data Flow

Sources:planning/roadmap_design.md#3-80src/engine/dependency.ts#25-35


Phase 2 Gaps and Refinements

Based on PHASE_2_GAPS.md, the remaining CLI and AI enhancements are scheduled as follows:

FeatureStatusDescriptionTarget Component
Markdown RoadmapsCompletedSupport roadmap definitions inside .md files using frontmatter or YAML fences src/storage/roadmap-parser.tsroadmap.ts
Batch AdoptCompletedpalee adopt --all (plus --include, --exclude, --tag) to scan and adopt untracked notes src/cli/adopt.tsadopt.ts
Auto-ID GenerationPlannedGenerate T- prefixed IDs from filenames (e.g., Docker.md -> T-docker) planning/PHASE_2_GAPS.md#91-102src/types.ts
Topic ResolutionPlannedAdvanced matching: exact ID → title → slug → token distance planning/invariants.md#42src/engine/index.ts
Transactional FixesPlannedImplementation of validate --fix to resolve broken dependencies or missing fields — modeled via fixable rule metadata, deferred per ADR-0008validate.ts

Sources:planning/PHASE_2_GAPS.md#1-110docs/adr/0008-validation-framework-decisions.md

Released under the MIT License.