# Mnemosyne — Features

> The humanistic learning and cultural intelligence platform

Mnemosyne is named after the Greek Titaness of memory — mother of the nine Muses
and the source of all artistic inspiration. The platform provides an integrated
system for language acquisition, memory science, classical education, art
history, mythology, cultural heritage preservation, history, and archaeology. It
unifies scientifically grounded spaced repetition and adaptive learning
algorithms with deep coverage of the humanities: from learning Ancient Greek
vocabulary with morphological analysis support, to studying iconography in
Renaissance painting, to preserving endangered cultural practices through
digital archiving.

The domain ships as 19 pure TypeScript libraries. Each package is a
self-contained computation library: there is no database, no HTTP server, and no
network client inside `libs/mnemosyne/*`. Every capability described in this
document is implemented as deterministic functions and in-memory data structures
that a consuming application can call directly.

---

## Domain Libraries

The table below gives a one-line description of each library's role. Each is
described in depth in its own section below.

| Library           | Package                        | Description                                                                                         |
| ----------------- | ------------------------------ | --------------------------------------------------------------------------------------------------- |
| Core              | `@mnemosyne/core`              | Foundation types, memory algorithms, knowledge graph, AI tutoring infrastructure, assessment engine |
| Polyglot          | `@mnemosyne/polyglot`          | Multi-language mastery engine: vocabulary, grammar, CEFR proficiency                                |
| Phonetics         | `@mnemosyne/phonetics`         | IPA, phoneme inventories, tonal languages, prosody                                                  |
| Linguistics       | `@mnemosyne/linguistics`       | Computational and theoretical linguistics analysis                                                  |
| Temporal          | `@mnemosyne/temporal`          | History, archaeology, anthropology, multi-calendar support                                          |
| Philology         | `@mnemosyne/philology`         | Textual studies, etymology, stylometry, classical language tools                                    |
| Aesthetics        | `@mnemosyne/aesthetics`        | Art history, visual analysis, iconography                                                           |
| Rhetoric          | `@mnemosyne/rhetoric`          | Classical education: trivium (grammar, logic, rhetoric)                                             |
| Mythology         | `@mnemosyne/mythology`         | Comparative religion, mythology, folklore                                                           |
| Heritage          | `@mnemosyne/heritage`          | Cultural heritage preservation and digital archiving                                                |
| Knowledge-Graph   | `@mnemosyne/knowledge-graph`   | Semantic knowledge infrastructure                                                                   |
| Experience        | `@mnemosyne/experience`        | Learning experience engine, gamification, progress tracking                                         |
| Platform          | `@mnemosyne/platform`          | Interchange: Anki/CSV import-export, LMS standards (SCORM/xAPI/LTI), external-content URL builders  |
| Immersion         | `@mnemosyne/immersion`         | Comprehensible input methodology, sentence mining, video immersion                                  |
| Community         | `@mnemosyne/community`         | Language exchange, voice rooms, native speaker feedback                                             |
| Pronunciation     | `@mnemosyne/pronunciation`     | Pronunciation training, phoneme-grapheme mapping, dialect modeling                                  |
| Writing           | `@mnemosyne/writing`           | Writing tools and feedback for language learners                                                    |
| Classical-Tools   | `@mnemosyne/classical-tools`   | Alpheios-style reading environment for classical languages                                          |
| Gamification-Plus | `@mnemosyne/gamification-plus` | Advanced gamification: leagues, streaks, seasonal events                                            |

---

## Memory Science and Spaced Repetition (`@mnemosyne/core`)

Spaced repetition is the scientifically validated method of reviewing
information at progressively longer intervals to maximize long-term retention.
Rather than committing to a single algorithm, Mnemosyne implements multiple
memory models, each making different assumptions about how human memory works.
The learner or the application can choose the model best suited to the content
and context.

### Forgetting Curve and Retention Models

**Ebbinghaus forgetting curve** is the foundational memory model, representing
retention as exponential decay from initial learning. Mnemosyne uses the formula
`R = e^(-t/S)` where S is the "stability" of the memory and t is elapsed time,
with per-card half-life estimation based on review history.

**SM-2 algorithm** is the original SuperMemo algorithm (1987) that powers Anki
and most spaced repetition software. It uses an "ease factor" (starting at 2.5)
adjusted up or down based on answer quality (0–5 scale), with the next interval
calculated as `interval × ease_factor`. The SM-2 grade scale distinguishes a
complete blackout (0) from a perfect response (5); answers below 3 trigger
relearning.

**FSRS (Free Spaced Repetition Scheduler)** is a modern 17-parameter model that
explicitly tracks both memory "stability" (how long it takes to forget) and
"difficulty" (intrinsic item hardness) as separate dimensions. Unlike SM-2, FSRS
predicts the probability that a learner will recall an item at any future point,
enabling configurable target retention (default 90%). FSRS outperforms SM-2
especially for irregular review histories and forgotten items.

**Half-Life Regression (HLR)** is Duolingo's research model that fits a
personalized forgetting curve per learner per item using logistic regression on
review history. It tracks `hlrPredict` (retrieval probability at future time)
and `hlrRetention` (current estimated retention).

**LECTOR scheduling** is a semantic-aware scheduling algorithm that accounts for
conceptual similarity between items — avoiding scheduling similar vocabulary on
the same day to reduce interference effects.

### Optimal Review Scheduling

Beyond individual item scheduling, the system provides session-level planning
tools:

- **Next-review time calculation**: Balances predicted forgetting probability
  against total daily review load to prevent overwhelming review queues.
- **Review prioritization**: Ranks items by combined forgetting probability and
  learning value; items near the forgetting threshold rank higher than items
  nearly forgotten.
- **Daily review load forecasting**: Projects review counts N days ahead for
  planning purposes.
- **Interleaving strategy generation**: Schedules items from multiple knowledge
  domains in the same session to exploit the interleaving effect — which
  produces better long-term retention than blocked practice despite feeling
  harder.

### Cognitive Load Management

Cognitive overload is a real barrier to effective study. These features prevent
it:

- **Session cognitive load estimation**: Estimates total cognitive demand based
  on item difficulty distribution and recent study history, preventing sessions
  that are counterproductively exhausting.
- **Session length recommendations**: Caps that prevent overload while
  maximizing retention per hour.
- **Circadian rhythm-aware scheduling**: Uses `getCircadianPhase` and
  `circadianEfficiency` to recommend study at times of day when cognitive
  performance is highest for the learner's chronotype.
- **Sleep-aware scheduling**: `sleepAwareSchedule` avoids scheduling difficult
  items when the learner is likely fatigued; `hoursUntilSleep` determines
  whether a session is in the optimal pre-sleep consolidation window.

### SRS Card System

A single `SRSCard` carries both SM-2 state and FSRS state so the two algorithms
can operate on the same card object without duplication:

- **Dual-algorithm card model**: One card holds SM-2 fields (`easeFactor`,
  `interval`, `repetitions`) and FSRS fields (`difficulty`, `stability`,
  `state`, `reps`, `lapses`). The functions `sm2Review` and `fsrsReview` both
  accept and return an updated `SRSCard`.
- **FSRS state machine**: `fsrsReview` drives the New → Learning → Review →
  Relearning transition graph on the card's `state` field.
- **Deck reference**: Each card carries a branded `DeckId`. Hierarchical subdeck
  nesting exists in `@mnemosyne/platform`'s `AnkiDeck` interchange type, not in
  the core `SRSCard` model.
- **Review forecast projections**: `calculateReviewLoad` projects daily review
  counts N days ahead (`ReviewForecast`).

---

## Assessment Framework (`@mnemosyne/core`)

### Item Response Theory (IRT)

Item Response Theory models the probability of a correct answer as a function of
both item difficulty and learner ability. This provides more precise measurement
than raw score percentages because it separates what the test measures from how
hard the items happen to be. Three increasingly realistic models are
implemented:

- **1PL Rasch model** (`irt1PL`): The simplest IRT model, parameterizing items
  by difficulty only. Used when item discrimination is assumed uniform —
  appropriate for carefully constructed item banks.

- **2PL model** (`irt2PL`): Adds discrimination to the 1PL model — a
  high-discrimination item sharply distinguishes between learners near the
  threshold; a low-discrimination item does not. More realistic for
  heterogeneous item banks.

- **3PL model** (`irt3PL`): Adds a pseudo-guessing parameter — the probability
  of a correct answer even for a learner with negligible ability. This is
  important for multiple-choice items and is the most realistic model for
  typical test conditions.

- **Item information functions**: `itemInformation` measures how precisely a
  single item estimates ability at a given theta level; `testInformation`
  aggregates precision over a full test. Both are essential for test design
  optimization.

- **Ability estimation**: `estimateAbility` via Maximum Likelihood Estimation
  (MLE) and Expected A Posteriori (EAP) Bayesian estimation.
  `standardErrorFromInformation` translates the test information function into
  confidence intervals on ability estimates.

### Computerized Adaptive Testing (CAT)

Adaptive testing selects each successive item based on what has been learned
from all previous answers — narrowing the estimate of the learner's true ability
as efficiently as possible rather than administering a fixed set.

- **Maximum information item selection**: Always selects the item that would
  reduce uncertainty about the learner's ability most, given the current
  estimate.
- **A-stratified and progressive-restricted selection**: Alternative selection
  strategies that balance information gain with item exposure control.
- **Configurable stopping rules**: Standard error threshold (terminate when
  precision is sufficient), minimum/maximum item count (hard session length
  limits), and minimum information (avoid items contributing negligible
  measurement value).
- **Content balancing**: Ensures the adaptive test covers required content
  domains in specified proportions.
- **`selectNextItem`, `shouldTerminate`, `runAdaptiveTest`**: A complete CAT
  loop from initial item selection through termination.

### Rubric Assessment

Rubric-based assessment handles open-response submissions where a simple
right/wrong grade is insufficient:

- **Rubric criterion and level definition**: Multi-criterion rubrics with
  explicit performance descriptors per level.
- **`evaluateWithRubric`**: Scores open-response submissions against defined
  criteria.
- **`generateFeedback`**: Produces criterion-level feedback explaining each
  score.
- **Portfolio assessment**: Evidence submission, reviewer assignment, and
  portfolio evaluation workflow.
- **Peer review system**: Peer assignment, submission, and calibration scoring
  to ensure inter-rater reliability.
- **Self-assessment calibration**: Tracks accuracy of learners' self-predictions
  and improves metacognitive accuracy over time.
- **Certification management**: Requirement definition and credential issuance
  when all requirements are met.
- **Proctoring integrity scoring**: `computeIntegrityScore` for assessment
  integrity monitoring.

---

## Knowledge Graph Infrastructure (`@mnemosyne/core`, `@mnemosyne/knowledge-graph`)

The knowledge graph connects concepts across the humanities domains, enabling
prerequisite-aware learning paths and cross-domain discovery. Rather than
treating each fact in isolation, the graph makes explicit that knowing Latin
grammar is a prerequisite for reading Caesar, or that understanding Byzantine
iconography connects to studying Orthodox theology.

- **`KnowledgeGraph` class**: A directed graph for knowledge items and their
  relationships, with typed nodes and edges.
- **Relationship types**: Prerequisite (must know A before B), related (A and B
  are connected), contradicts (A and B are in tension), part-of (A is a
  component of B), exemplifies (A is an example of B).
- **`calculateSimilarity`**: Semantic similarity between knowledge items using
  embedding distance.
- **SPARQL-inspired query interface**: `TriplePattern` and `GraphQuery` for
  expressive semantic queries over the graph.
- **Learning path inference**: `getPrerequisites`, `getDependents`, and
  `topologicalSort` compute study sequences from prerequisite-graph traversal.
  `identifyKnowledgeGaps` finds missing prerequisites between a learner's
  current state and a target competency.
- **Cross-domain concept linking**: `discoverCrossDomainLinks` creates
  `semantic_similar` edges between similar nodes in different domains —
  connecting concepts across humanities domains automatically.
- **Graph-based recommendation engine**: `recommendNextItems` surfaces items
  whose prerequisites are met, ranked by dependent count and mastery gap.
  `findSimilarNodes` surfaces related concepts by property similarity.
- **Temporal knowledge graph support**: `getTimeline`, `getNodesInTimeRange`,
  and `buildTemporalChain` traverse and build `temporal` edges, ordering nodes
  chronologically by a `year`/`date` property.

---

## AI Tutoring Infrastructure (`@mnemosyne/core`)

The AI tutoring layer is designed to work with or without a live LLM. With an
injected `LLMProvider` it can use generative power; without one it falls back to
template-based and algorithmic implementations. This means the domain libraries
remain useful even in environments where calling an LLM is not available.

### Socratic Dialogue System

The Socratic method guides learners toward discovery rather than simply
providing answers. This is implemented across several cooperating functions:

- **Socratic question generation**: `generateSocraticQuestion` creates targeted
  questions designed to guide learners to discover the answer themselves.
  `createSocraticDialogue` and `advanceSocraticDialogue` manage multi-turn
  Socratic exchanges.

- **Four-level hint sequences**: `generateHint` and `createHintSequence` produce
  graduated hints across the `HINT_LEVELS` scale — `nudge`, `clue`,
  `explanation`, `solution` — from the most oblique nudge to the near-direct
  solution. `getNextHint` advances the sequence and `selectInitialHintLevel`
  chooses the starting level from learner mastery and problem difficulty.

- **Multi-perspective explanations**: `generateMultiPerspectiveExplanation`
  produces seven explanation perspectives for the same concept — `analogy`,
  `formal`, `visual`, `historical`, `practical`, `first_principles`, and
  `comparative` — then `selectBestPerspective` chooses the format most effective
  for a particular learner's cognitive style.

### Misconception Detection

Common mistakes in humanities learning often follow predictable patterns (e.g.,
confusing Latin cases, misattributing artworks, or applying anachronistic
historical frameworks). The misconception detection system catches these
proactively:

- **`COMMON_MISCONCEPTIONS`**: A curated library of domain-specific
  misconception patterns covering grammatical, etymological, and historical
  error types.
- **`detectMisconceptions`**: Flags probable misconceptions in learner responses
  by pattern-matching against the misconception library.
- **`createMisconceptionPattern`**: Extends the library with new domain-specific
  patterns as they are identified.

### AI Content Generation

Rather than relying entirely on hand-authored content, the AI layer can generate
study materials from arbitrary text input:

- **Question generation**: `generateQuestionsFromText` automatically produces
  multiple choice, short answer, true/false, and matching questions from any
  text.
- **Distractor generation**: `generateDistractors` creates
  plausible-but-incorrect answer choices for MCQs — the quality of distractors
  determines whether a question actually tests understanding.
- **Cloze deletion**: `generateClozeDeletions` creates fill-in-the-blank
  exercises; `estimateClozeDifficulty` predicts difficulty based on word
  frequency and syntactic position.
- **Semantic flashcard generation**: `generateSemanticCards` and
  `generateCardsFromText` produce well-formed study cards from text input.
- **Personalized examples**: `generatePersonalizedExamples` generates examples
  of target grammar or vocabulary in contexts matching the learner's declared
  interests.

### Learning Analytics

Early detection of learning problems enables intervention before engagement
collapses:

- **Dropout risk prediction**: `predictDropoutRisk` detects early warning
  signals of disengagement before the learner stops entirely.
- **Mastery timeline prediction**: `predictMasteryTimeline` forecasts when the
  learner will reach target proficiency given current study pace.
- **Optimal review count prediction**: `predictOptimalReviewCount` estimates the
  minimum number of reviews needed to reach durable mastery.
- **Engagement trend analysis**: `analyzeEngagementTrend` distinguishes between
  temporary dips and persistent disengagement patterns.

---

## Multi-Language Mastery Engine (`@mnemosyne/polyglot`)

`@mnemosyne/polyglot` is the primary home for modern-language learning features.
It covers vocabulary, grammar, reading, and proficiency measurement, with
particular attention to typologically diverse languages.

### Language Metadata

Before any instruction, the system needs to understand the structure of the
target language:

- **Comprehensive language database**: ISO 639 language codes, language families
  and subfamilies, writing system metadata (Unicode ranges, directionality,
  morphological type, word order).
- **Part of speech definitions per language**: Language-specific POS taxonomies
  reflecting each language's actual grammatical categories.
- **Frequency word lists**: Corpus-derived word frequency lists per language —
  essential for teaching high-utility vocabulary first.
- **Cognate databases**: Cross-language related words to leverage transfer
  knowledge from languages a learner already knows.
- **False friend databases**: False cognates that mislead learners (e.g.,
  Spanish "embarazada" = pregnant, not embarrassed).

### Vocabulary Acquisition

Vocabulary learning in Mnemosyne is not isolated drilling — it is organized
around meaningful context and family relationships:

- **Vocabulary item model**: Word forms, definitions, and register (formal,
  informal, slang, technical, literary).
- **Thematic module organization**: Vocabulary grouped into contextual sets
  (travel, food, emotions, business, etc.) for situational learning.
- **Word family derivation tracking**: Root → all derived forms (e.g., educate →
  education, educational, educator, miseducate), enabling family-based
  vocabulary expansion.
- **Mnemonic keyword generation**: The keyword method — creating a memorable
  visual or phonetic bridge between a foreign word and its meaning.
- **Vocabulary coverage analysis**: Percentage of a target corpus covered by
  known words. The 95% threshold is the practical level for comfortable reading;
  this metric allows setting realistic milestones.
- **Thematic activity design**: Contextual vocabulary practice within thematic
  scenarios rather than isolated drilling.

### Grammar Instruction

Grammar is represented both as reference material and as generative exercises:

- **Grammar rule definitions with examples**: Structured rule representations
  with positive and negative examples.
- **Morphological paradigm tables**: Conjugation and declension tables per
  language for reference and drilling.
- **Syntactic pattern definitions**: Slot-filling representations of sentence
  structures.
- **Grammar exercise generation**: Fill-in, transformation, and translation
  exercises generated from rule specifications.
- **Contrastive analysis**: Identifies L1→L2 transfer errors based on structural
  differences between the learner's native language and the target — predicting
  which mistakes are most likely before they occur.
- **Error pattern libraries**: Documented common mistake types per L1–L2 pair.

### Reading Comprehension

- **Text difficulty analysis**: Readability metrics, vocabulary profile, and
  Lexile equivalent.
- **Comprehension skill taxonomy**: Main idea, inference, vocabulary-in-context,
  author's purpose, text structure — each assessed separately.
- **Comprehension question generation**: Type-specific question generation per
  comprehension skill.

### CEFR Proficiency Mapping

CEFR (Common European Framework of Reference) is the international standard for
language proficiency levels, ranging from A1 (beginner) through C2 (mastery).
Mnemosyne implements the full framework plus two additional standards used in
professional and academic contexts:

- **Full CEFR level descriptors** (A1–C2) per skill (reading, writing, speaking,
  listening) — what the learner can do at each level.
- **ILR scale support** (0–5+) with descriptors — the US government scale used
  for military and intelligence language assessment.
- **ACTFL proficiency guidelines**: The American Council on the Teaching of
  Foreign Languages scale (Novice–Intermediate–Advanced–Superior–Distinguished).
- **Proficiency assessment per skill domain**: Computes estimated CEFR level
  from performance evidence.

---

## Phonetics and Pronunciation (`@mnemosyne/phonetics`)

Phonetics provides the scientific foundation for understanding and practicing
the sound systems of any language. The IPA database covers all major phoneme
features; the higher-level modules apply those features to specific learning
tasks.

- **IPA (International Phonetic Alphabet) database**: Phoneme definitions with
  place of articulation, manner of articulation, voicing, and audio examples.
- **Phoneme inventory specification per language**: Which sounds each language
  uses, and which contrasts are phonemically distinctive (i.e., change meaning).
- **Minimal pairs generation**: Word pairs differing by exactly one phoneme
  (e.g., "ship"/"sheep", "pan"/"ban") for phonemic contrast practice.
- **Tonal language support**: Tone system definitions for Mandarin (4 tones +
  neutral), Cantonese (6 tones), Vietnamese (6 tones), Thai (5 tones), and other
  tonal languages — including tone sandhi rules.
- **Prosody modeling**: Stress, rhythm, and intonation pattern definitions for
  connected speech.
- **Extended phonetics**: Allophonic variation (how phonemes vary in context
  without changing meaning), phonological rules (assimilation, deletion,
  insertion), and coarticulation effects.

---

## Pronunciation Training (`@mnemosyne/pronunciation`)

Where `@mnemosyne/phonetics` provides the sound-system reference data,
`@mnemosyne/pronunciation` provides learner-facing training tools:

- **Pronunciation exercise generation**: Targeted drills for specific phonemic
  contrasts identified as problematic for a learner's L1 background.
- **Phoneme-to-grapheme and grapheme-to-phoneme mappings**: Bidirectional
  encoding-decoding rules per language, handling exceptions systematically.
- **Pronunciation comparison and error detection**: Acoustic comparison of
  learner production against target models.
- **Dialect and accent variation modeling**: Distinguishes legitimate accent
  variation from pronunciation errors — for example, not penalizing a learner
  for producing a British rather than American vowel.

---

## Writing Systems and Scripts (`@mnemosyne/writing`)

Writing systems vary enormously across languages — from alphabets learned in
minutes to logographic systems requiring thousands of characters. This package
provides script-specific pedagogy rather than a one-size-fits-all approach:

- **Writing system pedagogy**: Stroke order sequences for logographic scripts
  (Chinese, Japanese); letter formation sequences for alphabets and abjads;
  syllabary introduction sequences for syllabic scripts.
- **Script-specific practice exercise generation**: Handwriting practice, typing
  practice, and recognition exercises appropriate for each script type.
- **Handwriting recognition integration points**: Interface for connecting
  OCR/handwriting recognition models for real-time feedback on handwritten
  practice.

---

## Classical Language Tools (`@mnemosyne/classical-tools`)

Classical language learning has a distinct challenge: texts are fixed (the
corpus of Latin literature will not grow), yet learners must build enormous
vocabulary and grammatical knowledge before reading fluently. This package
replicates and extends the Alpheios and DCC (Dickinson College Commentaries)
environments for seven classical languages.

### Alpheios-Style Reading Environment

Alpheios is the gold standard for assisted reading of classical languages —
clicking a word produces immediate grammatical analysis. Mnemosyne replicates
and extends this model:

- **Morphological pop-up analysis on click**: Part of speech, case, number,
  gender, tense, mood, voice, stem, and lemma for any clicked word. Supports
  Latin, Ancient Greek, Sanskrit, Classical Arabic, Biblical Hebrew, Old Church
  Slavonic, and Classical Syriac.
- **CEFR equivalent proficiency levels for classical languages**: Maps classical
  language proficiency to modern equivalent levels for curriculum planning.
- **Reader mode**: Inline glosses and parsing assistance configurable from none
  (challenge mode) to full parsing (beginner support).

### DCC-Style Annotated Text Platform

The DCC model presents annotated classical texts with vocabulary and grammar
helps integrated directly into the reading experience. A learner reading Caesar
or Homer can hover over any word for frequency data and grammatical context:

- **Annotated reader text presentation**: Core vocabulary highlighted using
  frequency data.
- **Vocabulary frequency annotation**: The most frequent 1,000 words highlighted
  — enabling learners to prioritize high-yield vocabulary.
- **Grammar help pop-ups**: Contextual grammar explanations appearing at points
  of syntactic difficulty.
- **Progress tracking through canonical texts**: Marking progress through a
  canonical reading curriculum (Caesar's Gallic War, Vergil's Aeneid, Homer's
  Iliad/Odyssey, Plato's Apology, etc.).

---

## Linguistics Analysis (`@mnemosyne/linguistics`)

Linguistics provides the theoretical framework for understanding why languages
work the way they do. This is useful both for advanced language learners and for
instructors designing contrastive analyses:

- **Phonological analysis**: Phoneme inventory comparison, phonological rule
  application, allophonic variation mapping.
- **Morphological analysis**: Morpheme segmentation, paradigm identification,
  morphological typology classification (isolating, agglutinating, fusional,
  polysynthetic).
- **Syntactic analysis**: Constituent structure, dependency parsing, argument
  structure identification.
- **Language typology reference**: Morphological type, word order typology
  (SOV/SVO/VSO, etc.), case inventory, and tone system.
- **Contrastive linguistics**: L1–L2 structural contrast analysis generating
  predicted error patterns.

---

## Classical Education: The Trivium (`@mnemosyne/rhetoric`)

The trivium — grammar, logic, and rhetoric — is the foundation of classical
liberal arts education. It organizes language arts from basic correctness
(grammar) through argumentation (logic) to persuasion (rhetoric). This package
implements all three, plus the related arts of disputation and public speaking.

### Grammar (Language Arts)

Grammar here means the formal study of English grammar in the classical
tradition, not language-learning grammar:

- **Parts of speech taxonomy**: Noun, verb, adjective, adverb, pronoun,
  preposition, conjunction, interjection — with definitions and exercises.
- **Sentence parsing and diagramming**: Reed-Kellogg sentence diagrams,
  constituent analysis, and dependency representation.
- **Classical trivium pedagogy**: English grammar instruction aligned to Dorothy
  Sayers's "Lost Tools of Learning" and Charlotte Mason approaches.
- **Composition instruction**: Paragraph structure (topic sentence, supporting
  details, concluding sentence), essay structure (classical five-paragraph to
  complex argument), and Aristotelian argument structure.

### Logic and Critical Thinking

- **Classical formal logic**: Aristotelian syllogistics — categorical
  propositions (A/E/I/O), syllogistic figures and moods, validity testing by
  Venn diagram and counterexample.
- **Modern formal logic**: Propositional and predicate logic, truth tables,
  natural deduction.
- **Fallacy taxonomy**: The full taxonomy of informal fallacies (ad hominem,
  straw man, appeal to authority, false dichotomy, slippery slope, etc.) with
  recognition exercises and real-world examples.
- **Argument mapping**: Visual representation of argument structure,
  premise-conclusion relationships, and counter-argument positions.

### Rhetoric and Persuasion

- **Aristotle's rhetorical appeals**: Ethos (character and credibility), pathos
  (emotional appeal), logos (logical argument) — with exercises analyzing how
  each is deployed in model speeches and texts.
- **Classical rhetorical canons**: Inventio (finding arguments), dispositio
  (arrangement), elocutio (style), memoria (memory), actio (delivery) — the five
  traditional divisions of the art of rhetoric.
- **Persuasive writing instruction**: From claim identification through evidence
  selection, rebuttal, and conclusion.

### Dialectic and Disputation

- **Socratic method dialogue exercises**: Structured Socratic questioning
  sequences for any topic.
- **Medieval disputatio format simulation**: The formal academic disputation
  structure (objection, sed contra, respondeo, replies) from Scholastic
  philosophy.
- **Thesis defense and counter-argument generation**: Preparing arguments and
  anticipating the strongest objections.

### Figures of Speech and Tropes

The classical tradition identified and named hundreds of rhetorical figures.
This package provides both a reference catalog and practice exercises:

- **Comprehensive taxonomy**: All major rhetorical figures — metaphor, simile,
  anaphora (repetition at the beginning of clauses), epistrophe (repetition at
  the end), chiasmus, zeugma, litotes, hyperbole, irony, metonymy, synecdoche,
  personification, and dozens more.
- **Identification and analysis exercises**: Finding figures in passages from
  literature, political speeches, and advertising.
- **Generation of examples per figure**: Generating original examples of any
  rhetorical figure for creative writing instruction.

### Oratory and Public Speaking

- **Speech structure analysis**: Identifying exordium, narratio, confirmatio,
  refutatio, and peroratio in model speeches.
- **Delivery coaching**: Pacing, emphasis, clarity, and vocal variety
  instruction.
- **Memorization techniques for oral performance**: Method of loci (the "memory
  palace"), the peg system, and chunking for memorizing speeches.

---

## Art History and Visual Analysis (`@mnemosyne/aesthetics`)

Art history is both a factual discipline (this painting was made in Florence
in 1482) and an interpretive one (this painting means X within its iconographic
tradition). The aesthetics package supports both:

- **Art historical database**: Artwork records with medium, period, movement,
  creator, location, dimensions, and iconographic content.
- **Visual analysis AI**: Iconographic analysis (identifying symbols, figures,
  and narrative content), compositional analysis (balance, rhythm, focal point),
  and stylometric comparison (attribution analysis).
- **Iconographic analysis**: Symbol identification; attribute reading
  (identifying saints by their symbols — St. Peter's keys, St. Catherine's
  wheel, St. Jerome's lion); typology classification (identifying Old Testament
  scenes as types prefiguring New Testament antitypes).
- **Period and movement studies**: Comprehensive art historical timeline from
  Prehistoric cave painting through Postmodern and Digital art, with style
  characteristics, key figures, and representative works for each period.
- **Global art traditions**: African, Asian, Pre-Columbian, Islamic, Oceanic,
  and Indigenous art studied alongside the Western canon — as independent
  traditions of equal depth, not peripheral exceptions.
- **Architecture history**: Architectural orders (Doric, Ionic, Corinthian,
  Tuscan, Composite); building typologies (basilica, cathedral, mosque, temple,
  palace); structural systems (post-and-lintel, arch, vault, dome, steel frame).
- **Technical art history**: Materials analysis (identifying pigments, supports,
  binding media); conservation science; provenance research methodology.
- **Art theory and criticism**: Formalist, contextual, feminist, postcolonial,
  Marxist, psychoanalytic, and semiotic critical frameworks — each with
  representative texts and application exercises.

Art media covered include oil on canvas/panel, tempera, fresco, watercolor,
gouache, pastel, drawing, engraving, etching, lithography, photography, bronze
and stone sculpture, wood carving, ceramic, textile, installation, video,
digital, and performance art.

---

## Mythology and Comparative Religion (`@mnemosyne/mythology`)

Comparative mythology provides tools for studying religious narratives across
cultures, identifying recurring motifs, and understanding myths within their
religious and sociological contexts:

- **Mythological database**: Deity, hero, creature, and narrative records across
  all major world pantheons, with genealogies, epithets, domains, iconographic
  attributes, and major narrative roles.
- **Pantheons covered**: Greek, Roman, Norse, Celtic, Egyptian, Mesopotamian,
  Hindu, Buddhist, Chinese, Japanese, Mesoamerican (Aztec, Maya), Andean, Native
  American (multiple traditions), Yoruba, Yoruba diaspora (Candomblé, Santería),
  Polynesian, Slavic, Baltic, Finno-Ugric, and others.
- **Comparative mythology analysis**: Cross-cultural motif identification using
  the Aarne-Thompson-Uther (ATU) folktale type index; structural comparison
  using Vladimir Propp's narrative morphology and Claude Lévi-Strauss's
  structural analysis.
- **Folklore and tale types**: ATU index integration; international folktale
  classification; legend, myth, and folktale genre distinction.
- **Sacred text studies**: Mythological exegesis and narrative theology —
  interpreting myths within their religious and cultural contexts.
- **Religious studies framework**: Phenomenology of religion (Rudolf Otto,
  Mircea Eliade); comparative religious thought; ritual theory (Victor Turner,
  Catherine Bell); sociological approaches (Émile Durkheim, Max Weber).

---

## Cultural Heritage Preservation (`@mnemosyne/heritage`)

Digital cultural heritage preservation is both a technical problem (how do you
capture and archive a three-dimensional artifact?) and a legal and ethical one
(who owns the digital record of a looted object?). This package addresses all
dimensions:

- **3D digitization pipeline**: Photogrammetry (SfM/MVS), structured light
  scanning, LiDAR, CT scanning, RTI (Reflectance Transformation Imaging),
  multispectral imaging, and ToF (time-of-flight) methods — each appropriate for
  different artifact types.
- **Virtual reconstruction**: Evidence-based reconstruction of damaged or
  destroyed artifacts and sites, with explicit documentation of the evidence
  base and confidence levels for each reconstructed element.
- **Digital archive infrastructure**: Long-term preservation standards following
  the OAIS (Open Archival Information System) reference model; metadata schemas
  using Dublin Core and CIDOC CRM — the international standard for cultural
  heritage information modeling.
- **Virtual museum builder**: Interactive digital exhibitions with spatial
  navigation, annotation layers, multimedia content, and accessibility features.
- **Conservation documentation**: Condition reports (describing current artifact
  state), treatment records (documenting conservation interventions), and
  environmental monitoring (tracking temperature, humidity, light exposure).
- **Provenance and repatriation tracking**: Ownership chain documentation from
  creation through all transfers of custody; legal status tracking; repatriation
  claim management in compliance with UNESCO conventions.
- **Intangible heritage documentation**: Oral traditions, performing arts,
  craftsmanship, ritual practices, and festive events, following the UNESCO 2003
  Convention on Intangible Cultural Heritage framework.

---

## History, Archaeology, and Anthropology (`@mnemosyne/temporal`)

The temporal package treats historical knowledge as a structured dataset: events
have causes and consequences, people exist in social networks, sites have
stratigraphic layers, and dates need calendar-system context.

- **Historical database infrastructure**: Event, person, place, and period
  records with multi-calendar support — Gregorian, Julian, Coptic, Islamic
  (Hijri), Hebrew, Chinese, Mayan (Long Count), Roman (AUC), and Egyptian
  calendars, all with bidirectional conversion.
- **Prosopographical tools**: Person records, biographical data, and
  relationship networks across historical populations. Prosopography is the
  discipline of studying populations through systematic compilation of
  individual records, essential for understanding social networks in ancient
  societies.
- **Geographic historical analysis**: Territorial mapping over time (the same
  city under multiple political entities); migration route analysis (Silk Road,
  Bantu migrations, Indo-European dispersal); trade network reconstruction.
- **Archaeological intelligence**: Excavation site records with stratigraphic
  context (the sequential layers of occupation that provide relative dating);
  artifact classification following standard typological schemas; site GIS
  integration.
- **AI archaeological discovery**: Pattern recognition in aerial survey data and
  LiDAR scans; remote sensing analysis for identifying subsurface features.
- **Anthropological frameworks**: Cultural evolution models; kinship system
  analysis (unilineal, bilateral, cognatic descent); social organization
  analysis (band, tribe, chiefdom, state progression); ethnographic fieldwork
  methodology.
- **Bioarchaeology and human origins**: Skeletal analysis (age-at-death, sex,
  pathology estimation); paleopathology (disease in archaeological populations);
  ancient DNA interpretation; stable isotope analysis (revealing diet and
  migration patterns from bone chemistry).
- **Economic history analysis**: Price history databases; commodity network
  reconstruction; monetary system evolution; long-term economic trend analysis.
- **Military and political history**: Battle analysis (terrain, tactics,
  casualties, outcome factors); state formation models; political succession
  tracking.

---

## Immersive Language Learning (`@mnemosyne/immersion`)

Immersion methodology is based on Stephen Krashen's Input Hypothesis — that
language is acquired (not explicitly learned) through comprehensible input at
the i+1 level (slightly beyond current ability) — and its modern extensions
through the Refold and AJATT/MIA communities.

### Comprehensible Input Engine

The core challenge of immersion is finding material at exactly the right
difficulty level:

- **i+1 difficulty scoring**: Automatic scoring of any text or video segment for
  comprehensibility at the learner's current level. Material fully understood
  (i+0) is not challenging; material with too many unknowns (i+2+) produces
  anxiety rather than acquisition; i+1 is the optimal acquisition zone.
- **MorphMan-style morpheme frequency analysis**: Ranks text items by the
  morphemes they contain, so the most frequent and therefore most
  acquisition-valuable items are presented first.
- **Known word tracking**: Persistent tracking of all words encountered and
  their status across every content source.
- **Refold-style stage progression system**: Structured progression through
  stages from total beginner (stage 1, structured study) through upper beginner
  immersion (stage 2) to intermediate and advanced immersion stages — each with
  appropriate content recommendations and study activities.
- **Acquisition vs. learning mode distinction**: `analyseAcquisitionBalance`
  distinguishes formal study (learning) from naturalistic exposure (acquisition)
  and tracks both separately.

### Sentence Mining System

Sentence mining is the practice of extracting sentences from native content to
create personalized SRS study cards — combining the benefits of immersion with
the efficiency of spaced repetition:

- **Subtitle parsing and sentence extraction**: `parseSRT` parses SRT subtitle
  files; `extractMiningSentences` extracts subtitle-aligned candidate sentences
  as study material.
- **1T (one-target) sentence identification**: `filterOneTargetSentences` finds
  sentences where exactly one word is unknown — the optimal difficulty for
  vocabulary acquisition from context.
- **Sentence quality and deduplication**: `scoreSentenceQuality`,
  `computeJaccardSentenceSimilarity`, and `detectNearDuplicates` rank mined
  sentences and remove near-duplicates.
- **Bilingual subtitle alignment**: `alignBilingualSubtitles` pairs L1 and L2
  subtitle tracks for parallel comprehension.
- **Card templates**: `CARD_TEMPLATES` defines sentence, vocabulary, audio-only,
  picture-sentence, and cloze card layouts for mined material.
- **Media capture** (not implemented): Screenshot/audio clip capture, GIF
  generation, and Whisper-based transcription of audio without subtitles are not
  present in the current library.

### Video Immersion Platform

- **Graded video library**: `VIDEO_DIFFICULTY_TIERS`, `VideoContent`,
  `CreatorProfile`, and `classifyVideoDifficulty` organize content by difficulty
  with creator/accent metadata.
- **Interactive subtitles**: `buildInteractiveSubtitle` produces clickable,
  word-level subtitles (`SubtitleWord` / `InteractiveSubtitle`); watch history
  is recorded via `VideoWatchHistoryRecord`.
- **Streaming-platform enhancement** (not implemented): A Netflix/YouTube
  browser extension is not part of this library.

### Reading Immersion Tools

- **LingQ-style word tracking**: `TrackedWord`, `createTrackedWord`, and
  `advanceWordStatus` track per-word status that persists across reading
  sessions; `ReadingSessionRecord` / `computeReadingStats` accumulate progress.
- **Word familiarity levels (1–5 scale)**: `WordStatus`
  (`1|2|3|4|5|'known'|'ignored'`) and `WORD_FAMILIARITY_LEVELS` track a word
  from first encounter through incidental recognition to active production.
- **Graded readers**: `GRADED_READER_CATALOG` (`GradedReader`) provides a
  difficulty-tiered reader catalog.
- **Parallel text reader**: `buildParallelText` (`ParallelTextSegment`) places
  original and translation side by side.
- **Popup dictionary**: `buildPopupEntry` (`PopupDictionaryEntry`) supplies
  in-reader word lookups. A full epub/PDF document reader is not implemented.

### Listening Immersion Tools

- **Podcast integration**: `PodcastFeed` / `PodcastEpisode`,
  `SAMPLE_COMPREHENSIBLE_PODCASTS`, `recommendPodcasts`, and a listening journal
  (`ListeningJournalEntry`) support transcript-backed listening practice.
- **Listening assessment and exercises**: `assessListeningLevel`,
  `generateGapFillExercise`, and `generateComprehensionQuiz` produce graded
  listening activities; `RadioStation` / `SAMPLE_RADIO_STATIONS` add live audio.
- **Condensed audio**: `AudioCondensationConfig` / `DEFAULT_CONDENSATION_CONFIG`
  configure silence-removal for listening efficiency.
- **Shadowing** (not implemented): Automatic shadowing-exercise generation is
  not present in the current library.

---

## Advanced Gamification (`@mnemosyne/gamification-plus`)

This package layers a Duolingo-style competitive and social system on top of the
core gamification in `@mnemosyne/experience`. The two packages are independent:
`gamification-plus` adds no code dependency on `experience`.

- **League system**: Six-tier competitive leagues — Bronze, Silver, Gold,
  Platinum, Diamond, Obsidian — with weekly promotion (top N in league move up)
  and demotion (bottom N move down) zones, creating ongoing competitive
  motivation.
- **Streak system**: Daily streak tracking with streak freeze (protecting the
  streak if a day is missed, purchased with tokens) and streak repair (restoring
  a broken streak within a short window).
- **Weekly goals**: Configurable XP targets with safe-zone thresholds that
  protect against demotion, removing the anxiety of falling behind mid-week.
- **Seasonal events**: Time-limited events with bonus XP multipliers, exclusive
  cosmetic rewards, and narrative framing tied to seasons or cultural moments.
- **Double-XP weekends**: Scheduled bonus periods to drive re-engagement.
- **Collaborative community goals**: Group challenges requiring collective
  contribution from all members of a study group or community, building social
  learning bonds.
- **Token economy**: League reward tokens spendable on streak freezes, cosmetic
  customization, XP boosts, and other rewards.

---

## Learning Experience and Adaptive Engine (`@mnemosyne/experience`)

### Knowledge Tracing Models

Where `@mnemosyne/core` provides static retention models (Ebbinghaus, SM-2,
FSRS), `@mnemosyne/experience` provides dynamic skill-state models that update
as the learner practices:

- **Bayesian Knowledge Tracing (BKT)**: A 4-parameter model per skill
  (`BKTParams`, `DEFAULT_BKT_PARAMS`), tracking the probability that a learner
  has mastered each skill and updating after each response via `updateBKT`. The
  four parameters are: p(initial mastery), p(learning from practice), p(slip —
  wrong despite mastery), and p(guess — right despite non-mastery).
- **Deep Knowledge Tracing (DKT)**: An LSTM-style model (`DKTState`,
  `updateDKTState`) that decays a hidden skill-state representation across
  responses.
- **Adaptive selection**: Multi-armed bandit (`ucb1SelectArm`) and a
  reinforcement-learning policy (`selectRLAction`) drive content selection.
  `classifyZPD` and `optimiseLearningTrajectory` keep learners in the Zone of
  Proximal Development.

### Progress and Social Features

- **Gamification system**: XP and levels (`awardXP`, `LEVEL_DEFINITIONS`),
  achievements (`ACHIEVEMENT_CATALOG`, `checkAchievements`), daily challenges,
  leaderboards, a virtual-currency shop, and avatar customization.
- **Social learning**: Study groups (`createStudyGroup`, `joinStudyGroup`), team
  challenges (`updateTeamChallengeProgress`), tutor/tutee matching
  (`matchTutorTutee`), and shareable progress cards.
- **Skill trees and quests**: `HUMANITIES_SKILL_TREE` and `SAMPLE_QUESTS`
  structure long-form progression; `issueCertificate` issues completion
  certificates.
- **Accessibility and inclusion**: WCAG criteria auditing
  (`auditWCAGCompliance`, `WCAG_AAA_CRITERIA`), ARIA configuration,
  keyboard-shortcut maps, color-vision-adapted palettes (`COLOR_PALETTES`),
  typography presets (dyslexia-friendly and others), focus mode, break
  reminders, and contrast-ratio checking.

---

## Platform Integration (`@mnemosyne/platform`)

`@mnemosyne/platform` solves the interoperability problem: learners carry their
study data across tools (Anki, university LMS systems, Zotero, museum APIs), and
this package provides the parsing and URL-building layer that makes those
transfers possible without network I/O inside the domain itself.

- **Anki import/export**: `parseAnkiDeck` / `exportAnkiDeck` parse and generate
  Anki decks — notes, note models, and subdeck hierarchy — from a simplified
  Anki deck JSON export (an `.apkg` deconstruction, not the binary archive).
- **CSV vocabulary import**: `parseCSVVocabulary` ingests vocabulary lists.
- **LMS / e-learning standards**: SCORM manifest parsing (`parseSCORMManifest`),
  xAPI statement creation (`createXAPIStatement`, `XAPI_VERBS`), and LTI launch
  validation (`validateLTILaunch`).
- **Reference and portability**: Zotero export parsing (`parseZoteroExport`),
  portable progress data (`buildPortableProgressData`), and GDPR data-package
  assembly (`buildGDPRPackage`).
- **External content connectors**: URL builders and payload parsers for
  Wikipedia/Wikidata, Europeana, Internet Archive, dictionary providers,
  translation providers, museum APIs, and SRU library catalogs.
- **API descriptors**: `APIEndpointDefinition` and `PUBLIC_API_ENDPOINTS`
  describe a REST surface a hosting application could expose — declarative
  metadata, not a running server.

The package does not implement binary `.apkg` parsing, EPUB/PDF ingestion,
TTS/STT, multi-platform runtimes, or a versioned content-management workflow.

---

## Community Features (`@mnemosyne/community`)

### Language Exchange

Language exchange connects learners who each speak the other's target language,
enabling bilateral practice that neither can get from solo study:

- **Partner matching algorithm**: `computeMatchScore` and `findLanguagePartners`
  match learners factoring in interests, timezone, proficiency level, and goals
  (`ExchangeProfile`, `LanguageProfile`, `MatchScore`).
- **Exchange sessions**: `scheduleExchangeSession` and `checkTimeSplitBalance`
  schedule and balance bilateral practice sessions; `PartnerRelationship` tracks
  ongoing partnerships.
- **Text chat with inline correction tools**: `applyInlineCorrection` and
  `renderCorrectionMarkup` render corrections as tracked changes;
  `saveVocabularyFromCorrection` turns corrections into vocabulary items;
  `suggestConversationTopics` (`TOPIC_SUGGESTIONS`) seeds conversations.
- **Voice rooms** (drop-in conversation practice): `createVoiceRoom`,
  `joinVoiceRoom`, and `toggleHandRaise` run topic-based audio rooms with live
  transcript segments and participation stats.
- **Social moments feed**: `createMoment`, `addMomentCorrection`, and
  `filterMomentsForLearner` provide short target-language posts that others can
  correct inline; `computeMomentAnalytics` and `detectSpam` support moderation.
- **Shared whiteboard**: `createWhiteboard` / `addWhiteboardElement` provide a
  collaborative whiteboard scoped to an exchange session.
- **Transliteration**: A `transliterate` dispatcher with per-script
  implementations (kana, kanji, Hangul, Cyrillic, Arabic, Devanagari, Thai,
  Georgian) helps partners read each other's scripts.
- **Rating and reporting**: `createPartnerRating` / `computeAverageRating` and
  `createUserReport` support partner feedback and safety.

A dedicated native-speaker feedback marketplace, community deck sharing,
discussion forums, and expert-contributor recognition are not implemented in the
`@mnemosyne/community` package. Collaborative text annotation with upvoting and
editing is implemented, but in `@mnemosyne/classical-tools`.

---

## Philological Tools (`@mnemosyne/philology`)

Philology is the study of language in written historical sources. Where
`@mnemosyne/linguistics` covers synchronic (present-state) analysis,
`@mnemosyne/philology` covers diachronic (historical change) analysis and
textual criticism:

- **Etymology tracing**: Word origin and cognate network visualization — tracing
  the history of a word from its reconstructed proto-language root through all
  its descendant forms.
- **Semantic change analysis**: Diachronic documentation of semantic shifts —
  how word meanings have widened, narrowed, ameliorated, or pejorized across
  time.
- **Stylometric analysis**: Authorship attribution tools using function word
  frequencies, sentence complexity metrics, and vocabulary profile statistics.
- **Corpus frequency analysis**: Word frequency distributions across texts;
  comparative frequency between corpora (e.g., a word common in Classical Latin
  but rare in Medieval Latin).
- **Collocational analysis**: Documents typical word combinations and usage
  patterns — essential for natural-sounding production.

---

## Scope and Domain Boundary

This feature document is scoped to `libs/mnemosyne/*` (Phase 39). It covers all
19 packages: core, polyglot, phonetics, linguistics, classical-tools, philology,
mythology, aesthetics, rhetoric, heritage, temporal, knowledge-graph, immersion,
experience, gamification-plus, community, pronunciation, writing, and platform.
Items marked "(not implemented)" are described because they appear in the Phase
39 vision but have no corresponding code in the current library.

Nisaba owns ancient-text scholarly analysis and manuscript/corpus research.
Mnemosyne owns cultural learning, language acquisition, pronunciation,
humanities education, and cultural heritage experiences. The distinction is that
Mnemosyne is pedagogical — its goal is a learner acquiring knowledge — while
Nisaba is research-oriented, concerned with the scholarly study of texts as
primary sources.

## Autonomous Research Contribution (Phase 178)

Mnemosyne is a co-owner of the autonomous research / agentic-scientist substrate
(Phase 178, centered in Nous). Mnemosyne's side is humanistic and
cultural-knowledge grounding plus long-horizon memory: the agentic scientist
draws on Mnemosyne's knowledge graph and spaced-memory surfaces for research
that spans languages and traditions, and contributes back to the shared
experiment/knowledge ledger. Nous owns the agent loop; Mnemosyne owns the
cultural-knowledge model.
