The
libs/sophia/area: ~27 Nx libraries that make up Sophia, the Oshun Knowledge Engine — the research, ingestion, indexing, retrieval, knowledge-graph, citation/credibility/verification, and evaluation stack that turns raw sources into grounded, cited, fact-checked knowledge.
What this area is#
Sophia is Oshun's knowledge and research domain. Its libraries form a pipeline
that takes documents from the open web (or tenant uploads), parses and chunks
them, embeds and indexes them, retrieves over them semantically, links the
extracted entities into a knowledge graph, scores the sources for credibility,
verifies claims against evidence, and finally evaluates the whole pipeline's
groundedness before anything is published. The @sophia/event-publisher barrel
names the domain directly: "Sophia (Knowledge Engine) domain." Several of the
heavier libraries note in their headers that they were ported from the
Metis/Minerva research subsystems, so the area is a consolidation of prior
research tooling into one domain.
The libraries split into recognisable layers. Foundation: @sophia/schemas
(Zod domain schemas + branded IDs) and @sophia/database (the Prisma client).
Acquisition: sophia-crawling, sophia-document-parser,
@sophia/ingestion, @sophia/corpus. Representation & retrieval:
@sophia/embeddings, @sophia/indexing, @sophia/vectordb,
sophia-semantic-search, @sophia/knowledge-graph, sophia-knowledge-base.
Trust & analysis: sophia-credibility, @sophia/citation-analysis,
sophia-citation-graph, @sophia/verification, @sophia/evaluation.
Research orchestration: @sophia/agents, sophia-research-engine,
@sophia/theory. Applied/edge: @sophia/client, @oshun/sophia-client,
@sophia/event-publisher, @sophia/predictions, sophia-trend-curriculum,
@sophia/cultural-research, @sophia/concordia-knowledge.
Each project is a scope:sophia Nx library (most tagged layer:domain) built
with @nx/js:tsc and tested with Vitest, as seen in agents/project.json. The
package names are deliberately mixed: most use the @sophia/* npm scope, a
handful keep bare Nx project names (sophia-crawling, sophia-credibility,
sophia-citation-graph, sophia-document-parser, sophia-knowledge-base,
sophia-research-engine, sophia-semantic-search, sophia-trend-curriculum),
and two cross-scope deliberately (@oshun/sophia-client). The headings below
use each project's exact project.json "name".
How it fits the wider system#
The outward face of the area is @sophia/client (re-exported as
@oshun/sophia-client): a typed SDK with search, ingestion, and knowledge-graph
sub-clients plus fluent query builders, generated from an OpenAPI surface in
client/src/generated/openapi.ts. Other Oshun domains consume Sophia two ways:
through that client SDK over HTTP, and through direct in-process imports of the
analysis libraries. @sophia/concordia-knowledge is an explicit cross-domain
seam — Concordia (Phase 179.7) calls into Sophia's precedent lookup — and
semantic-search ships an iris-adapter so the Iris assistant can retrieve
over Sophia's corpus. @sophia/event-publisher is how Sophia announces state
changes (documents ingested, indexes rebuilt, entities extracted) onto the
platform event bus for downstream consumers. The honesty boundaries worth noting
up front: @sophia/database fails loud until Prisma is generated,
@sophia/embeddings throws NotConfiguredError rather than fabricate a vector
when the model can't load, and @sophia/cultural-research's AI analysis sits
behind a provider interface with mock providers for local development.
Entity catalog (29)#
The 29 tracked Nx projects in sophia, each a code-linked entity node — package, type, source path, declared targets, and its internal dependency graph (depends-on / used-by, resolved from the package manifests, §6/§8), read from the project graph. Grouped by architectural layer; walk the dependency links to travel the system. 28 of these carry an authored deep-dive (what / why / how it fits); the rest are generated scaffolds awaiting one.
clients (2)#
Oshun-scoped compatibility package for the Sophia TypeScript client SDK
A one-line namespace re-export (oshun-client/src/index.ts is
export * from '@sophia/client';). It exists to expose the Sophia client SDK
under the platform-wide @oshun/* scope so cross-domain consumers can import it
without reaching into the @sophia/* scope. No logic of its own — intentionally
a thin alias, honestly described as such.
TypeScript client SDK for Sophia services - search, ingestion, and knowledge graph APIs
The TypeScript client SDK for Sophia's HTTP services (client/src). A unified
SophiaClient aggregates SearchClient, IngestionClient, and
KnowledgeGraphClient, each with fluent builders (SearchQueryBuilder,
GraphQueryBuilder) and a shared HttpClient with retries/error handling
(SophiaClientError). The branded ID types and request/response shapes mirror a
generated OpenAPI surface (client/src/generated/openapi.ts, ~1.7K lines).
createLocalSophiaClient targets local dev. This is the canonical way other
domains call Sophia over the wire.
SophiaClient83createSophiaClient83createLocalSophiaClient83SearchClient91SearchQueryBuilder91createSearchClient91IngestionClient95createIngestionClient95KnowledgeGraphClient99GraphQueryBuilder99createKnowledgeGraphClient99HttpClient110createHttpClient110createDocumentId198 +9 morecontracts (1)#
Sophia domain schemas for research documents, citations, claims, and knowledge graphs
The Sophia domain-schema foundation (schemas/src). Zod schemas and branded ID
types for research documents, citations, claims, knowledge packs, entities, and
relations, plus a typed error surface (errors.ts) and ID helpers (ids.ts).
Each domain object gets its own file (citation.ts, claim.ts, entity.ts,
relation.ts, research-document.ts, knowledge-pack.ts), re-exported from
index.ts. This is the shared vocabulary the rest of the area validates
against.
CitationId14ClaimId14KnowledgePackId14EntityId14RelationId14ChunkId14ProjectId14UserId14SourceId14IndexId14IdSchema14DocumentIdSchema14CitationIdSchema14ClaimIdSchema14 +274 moredata (2)#
Database schema and Prisma client for Sophia research and knowledge services
The Prisma data-access library (database/src). It is a thin, honest wrapper
over a generated Prisma client: getSophiaClient is a lazily-initialized
singleton, createSophiaClient makes fresh connections, and both fail loud
— they throw "Prisma client not generated. Run
nx run @sophia/database:prisma:generate first." rather than pretend a client
exists. The generated client under database/src/generated/ is a build
artifact, so the checked-in source is the client accessors plus model/enum
re-exports.
getSophiaClient43disconnectSophiaClient43createSophiaClient43PrismaClient43Prisma43DocumentType68DocumentStatus87EntityType102RelationType122KnowledgePackStatus154IngestionJobStatus159VerificationStatus174The vector-store abstraction (vectordb/src). A common store interface with
four backends — an in-memory memory-store (~619 LOC), and real adapters for
milvus (~850 LOC), pinecone (~819 LOC), and qdrant (~842 LOC) — plus
collection schemas (e.g. KNOWLEDGE_CHUNKS_SCHEMA), similarity utilities,
batch helpers, and a health module. Supports upsert, vector search with
structured filters, and hybrid search; createMemoryStore for dev,
createMilvusStoreFromEnv for production. Genuine multi-provider adapters.
COLLECTIONS90WISDOM_EMBEDDINGS_SCHEMA90CONTENT_EMBEDDINGS_SCHEMA90USER_PREFERENCE_EMBEDDINGS_SCHEMA90CONVERSATION_EMBEDDINGS_SCHEMA90SEMANTIC_SEARCH_SCHEMA90PERSONA_EMBEDDINGS_SCHEMA90KNOWLEDGE_CHUNKS_SCHEMA90RESEARCH_DOCUMENTS_SCHEMA90CITATIONS_SCHEMA90ENTITIES_SCHEMA90ALL_SCHEMAS90getSchemaByName90isValidCollectionName90 +49 moredomain (15)#
The advanced research-agent framework (agents/src), ported from Metis/Minerva.
It composes a full research pipeline: QueryDecomposer (with scientific/simple
variants), AdvancedResearchAgent over a pluggable SearchProvider
(InMemorySearchProvider included), and a verification suite —
FactCheckingAgent, ContradictionDetector, TemporalConsistencyChecker,
StatisticalValidator, MethodologyEvaluator — all wired together by
ResearchOrchestrator. Each agent ships strict/lenient/quick factory variants
(agents/src/verification/*, ~3.4K LOC; the whole @sophia/agents lib is
~6.6K), and the public surface is the barrel in agents/src/index.ts.
SophiaResearchAgent14QueryDecomposer17createQueryDecomposer17createScientificQueryDecomposer17createSimpleQueryDecomposer17AdvancedResearchAgent17InMemorySearchProvider17createAdvancedResearchAgent17createExhaustiveResearchAgent17createQuickResearchAgent17QueryDecomposerConfig17AdvancedResearchConfig17SearchResult17SearchProvider17 +31 moreCitation analysis, source quality assessment, citation network analysis, scholarly consensus detection, and citation linting for the Sophia domain
Citation analysis ported from the Metis CitationAnalyzer
(citation-analysis/src). Four analyzers: SourceQualityAnalyzer (with
STEM/humanities variants, multi-dimensional QualityDimension scoring and
SourceTier classification), CitationNetworkAnalyzer (authority scores,
co-citation, bibliographic coupling, clustering), CitationLinter (rule-based
lint with severity levels), and ScholarlyConsensusAnalyzer (per-claim stance
aggregation, agreement matrices, contradictions, temporal trends). Real,
config-driven implementations under source-quality/, network/, linters/,
and consensus/.
CitationId17ClaimId17DocumentId17createSourceId17createCitationId17createClaimId17createDocumentId17Author17Publisher17Source17CreateSourceInput17TextPosition17Claim17ClaimType17 +48 moreSophia-backed precedent and template lookup for Concordia cases (Phase 179.7).
A small, focused cross-domain library (concordia-knowledge/src,
precedent-lookup.ts, ~142 lines) implementing §179.7: Sophia-backed precedent
lookup for Concordia cases. It defines PrecedentQuerySchema /
PrecedentMatchSchema (Zod, with a fixed useCaseClass enum and ISO-country
jurisdiction validation) and a deterministic, documented bounded-heuristic
scorePrecedent (a weighted average of jurisdiction match, family overlap, and
keyword overlap, each in [0,1]) plus rankPrecedents. The determinism is
intentional so "audit reproducibility holds across runs."
PrecedentQuerySchema8PrecedentMatchSchema8scorePrecedent8rankPrecedents8PrecedentQuery8PrecedentMatch8The educational-asset corpus (corpus/src): EducationalImageCorpus, a
DiagramTemplateLibrary, and CorpusMaintenanceManager (each ~1.1–1.3K LOC).
It manages curated educational images and diagram templates plus the maintenance
operations over that collection. Substantial real implementations behind the
types.ts surface; the barrel re-exports all three modules.
Cultural research, sensitivity analysis, localization, and accessibility for the Sophia domain
Cultural-sensitivity, localization, and accessibility for Sophia content
(cultural-research/src). The largest single file in the area
(consultant/cultural-consultant.ts, ~4.6K LOC) plus a ~3K-LOC
LocalizationManager, a ~1.7K-LOC AccessibilityManager, and a
CulturalDatabase. The AI analysis is structured around a CulturalAIProvider
interface (sensitivity checks, suggestions, representation analysis) with real
orchestration logic and Mock*Provider implementations
(MockCulturalAIProvider, etc.) plus createMock* factories for local
development — an honest provider seam, not fabricated AI output.
CulturalConsultant137MockCulturalAIProvider137MockCulturalKnowledgeProvider137MockRedFlagDetectorProvider137PatternBasedCulturalAIProvider137PatternBasedCulturalKnowledgeProvider137PatternBasedRedFlagDetector137DEFAULT_CHECK_CATEGORIES137createMockCulturalConsultant137createCulturalConsultant137LocalizationManager173InMemoryLocalizationStorage173MockMachineTranslationProvider173InMemoryTranslationMemory173 +20 moreReal, model-backed embeddings (embeddings/src). The header is explicit that
this replaced a former SHA-256 hash "embedding" stub:
TransformersTextBackend runs sentence-transformers/all-MiniLM-L6-v2
in-process via onnxruntime through @huggingface/transformers (384-d,
mean-pooled, L2-normalized so dot product == cosine), with no hash fallback
— it throws NotConfiguredError when the model can't load. Also ships an
image-embedder, multimodal-embedder, a clip-multimodal-backend, a
dense-retriever, and an embedding-cache. This is a genuine fail-loud
inference seam.
Retrieval quality evaluation, citation integrity, and groundedness scoring for the Sophia domain
The quality-gate library (evaluation/src). RetrievalEvaluator
(faithfulness/relevancy, precision/recall, ~1K LOC), CitationChecker (quote
accuracy, entailment, attribution), and GroundednessScorer (claim extraction +
evidence matching + hybrid semantic/lexical scoring against a configurable
threshold). Plus benchmark runners — sophia-release-gate-benchmark (~1.1K LOC)
and veritas-explainer-benchmark — an answer-regrounding module, and an
ingestion-quality evaluator with remediation/routing. The AI/semantic steps
sit behind AIEvaluationProvider/SemanticSimilarityProvider interfaces.
createEvaluationId118createBenchmarkId118createTestCaseId118createMetricId118EvaluationError121CitationVerificationError121GroundednessError121BenchmarkError121RetrievalEvaluator132RetrievalEvaluatorOptions132MockAIEvaluationProvider132MockSemanticSimilarityProvider132CitationChecker143CitationCheckerOptions143 +39 moreSophia domain indexing pipelines for document chunking, embedding, and vector indexing
The indexing pipeline (indexing/src): document chunking → embedding → vector
index. Chunking ships multiple strategies over a base-chunker; the
embedding/ module has providers, a cache, a service, and types, while a
parallel embeddings/ module adds audio/text/multimodal embedders, a backend
abstraction, and a cutover path; graphs/ carries an entity-resolver and
graph-visualization; and index/ has the builder, similarity, and types.
createIndexBuilder indexes a document and exposes search. Large, real
implementations (entity-resolver ~621 LOC, graph-visualization ~888 LOC).
DEFAULT_CHUNKING_CONFIG50DEFAULT_TOKEN_ESTIMATOR_CONFIG50RECURSIVE_SEPARATORS50MARKDOWN_SEPARATORS50CODE_SEPARATORS50BaseChunker50stimateTokens50FixedSizeChunker50SlidingWindowChunker50ParagraphChunker50SentenceChunker50RecursiveChunker50MarkdownChunker50CodeChunker50 +50 moreThe six-stage ingestion pipeline (ingestion/src, §9.9) with provenance,
idempotency, and tenant isolation. The standout is a rich adapters/ registry:
peer-reviewed PDF, news-article HTML, RSS/Atom feed, audio- and
video-transcript, IIIF manuscript, LMS SCORM/xAPI, tenant BYOM bundle, and a
structured-api-base, all behind a typed registry with a release-gate. Plus
chunking/ (policy + strategies), enrichment/ (classifiers + pipeline), a
lifecycle/ subsystem (cascade, retirement, scheduler, claim-diff), a
pipeline/ with events, provenance/, and tenant/isolation. Real ingestion
machinery, not placeholders.
Knowledge graph operations, concept graph management, graph traversal, and learning path optimization for the Sophia domain
A directed labeled property-graph engine (knowledge-graph/src), documented in
detail in its barrel. GraphStore (CRUD, adjacency, filtering, events);
GraphTraverser (BFS, DFS, Dijkstra shortest path, all-paths, subgraph,
neighborhood); graph algorithms (degree/betweenness/closeness/PageRank/
eigenvector centrality, LPA + Louvain community detection, node similarity);
ConceptGraph (prerequisite DAG with topological sort, cycle detection,
critical path, level assignment); a gap-analyzer; learning-path generation
(path-optimizer); a fluent query-builder; graph-aware retrieval; and an NLP
relationship-mapper. Genuine algorithm implementations, not stubs.
EntityType110RelationType110ConceptRelationship110DifficultyLevel110DEFAULT_KNOWLEDGE_GRAPH_CONFIG110createNodeId110createEdgeId110createConceptGraphId110GraphStore125createGraphStore125GraphTraverser138createGraphTraverser138DEFAULT_GRAPH_AWARE_RETRIEVAL_OPTIONS152GraphAwareRetriever152 +29 moreResearch methodology frameworks and citation integrity for the Sophia domain
Research-methodology frameworks and citation integrity (theory/src).
CitationManager (~2.6K LOC: claim detection, multi-style citation formatting —
chicago-notes and others — verification, and a graph provider) and
ResearchManager (~1.8K LOC: projects, hypotheses, methodology). It integrates
the @kalika/citations package via kalika-citation-storage.ts
(InMemoryCitationDatabase + storage provider), so Sophia's citation store is
backed by the shared Kalika citation engine.
CitationManager103InMemoryCitationStorage103DefaultCitationFormatter103DefaultClaimDetector103DefaultCitationVerifier103DefaultCitationGraphProvider103createCitationManager103KalikaBackedCitationStorage103createKalikaBackedCitationManager103sophiaSourceToKalikaCitationRecord103kalikaCitationRecordToSophiaSource103sophiaSourceTypeToKalikaCitationType103kalikaCitationTypeToSophiaSourceType103ResearchManager138 +4 moreGovernance-gated training data collectors for Sophia retrieval and research signals
Phase 85–86 flywheel producer for knowledge/research
(libs/sophia/training-data/src): SophiaTrainingDataPipeline normalizes
thirteen SophiaTrainingKind signals — search-relevance,
citation-verification, rag-quality, chunking-quality,
knowledge-graph-extraction, source-credibility, prediction-calibration,
theory-evaluation, and peers — into SophiaTrainingRecords gated by an
explicit SophiaGovernanceGrant before reaching the SophiaTrainingSink.
Standalone verification pipelines for fact-checking, contradiction detection, temporal validation, statistical analysis, and methodology evaluation
The claim-verification pipeline suite (verification/src). Independent
pipelines for fact-checking (fact-checking-pipeline, plus a fact-check-loop
~1.2K LOC), contradiction handling (contradiction-loop +
contradiction-pipeline), methodology, statistical, and temporal
verification, and an unsupported-claim-loop (~1.1K LOC). Orchestration is
real: job-envelope (SophiaGroundingJobEnvelope) and a publication-gate
that runs concrete checks (claim-density, citation-integrity,
contradiction/unsupported backlog, evaluation-thresholds, reviewer-signoff) and
hashes evidence with SHA-256 (@noble/hashes) — a genuine block/pass gate, not
a rubber stamp.
TemporalCheckerConfig13DEFAULT_TEMPORAL_CONFIG13xtractContext13descriptionSimilarity13shouldPrecede13xtractEvents13buildTimeline13detectAnachronisms13detectImpossibleSequences13detectDateConflicts13detectFutureReferences13detectTemporalGaps13detectCausalityViolations13checkConsistency13 +22 moreThe web-acquisition layer (crawling/src). Five real subsystems: RateLimiter
(token-bucket with domain tiers, configurable backoff strategies, polite vs
aggressive presets), the crawl frontier (URL normalization, tracking-param
stripping, a hand-rolled Bloom filter with optimal-size calculation, priority
sorting), file detection (magic-byte signatures, format/category
classification), compliance checking (~1.4K LOC: robots.txt directives,
license/ToS, data-usage policy), and URL-pattern classification (including
curriculum-seed source types). Domain-specific crawling logic, not a thin fetch
wrapper.
createCrawlTargetId35createCrawlResultId35createDownloadId35createPatternId35DomainTier35BackoffStrategy35RateLimitState35CrawlStatus35URLPriority35PageType35FileCategory35DownloadStatus35FileFormat35ComplianceStatus35 +104 moreSOPHIA_STUDY_ADAPTER_CONTRACT_VERSION1sophiaStudyCapabilities1createSophiaStudyAdapter2CitationKeyResult2SophiaStudyAdapter2TranscriptAnchoringResult2unclassified (9)#
Event publisher for the Sophia (Knowledge Engine) domain
Type-safe domain-event publishing for Sophia (event-publisher/src). A
SophiaEventPublisher (singleton accessor + factory + reset for tests) emits
the full Sophia event taxonomy as typed payloads: document
ingested/updated/deleted, index updated/rebuilt, search performed, entity
extracted, relation discovered, citation created. The payload types in
types.ts are the contract other domains subscribe to on the bus.
SophiaEventPublisher8getSophiaEventPublisher8createSophiaEventPublisher8resetSophiaEventPublisher8Predictive analytics library with time series forecasting, scheduling optimization, and content performance prediction
Predictive analytics for streaming platforms (predictions/src). Three modules:
revenue forecasting (forecast/revenue.ts, ~644 LOC — time-series with
configurable confidence level, minimum data points, seasonality detection, peak
periods, risk factors, recommendations), a schedule optimizer (~725 LOC), and
a content-performance predictor (~1K LOC). Statistical forecasting methods
over TimeSeries/ForecastResult types in types.ts. Note this is the most
adjacent-to-streaming library in the area rather than core research tooling.
RevenueForecaster76getRevenueForecaster76resetRevenueForecaster76ScheduleOptimizer86getScheduleOptimizer86resetScheduleOptimizer86ContentPredictor96getContentPredictor96resetContentPredictor96forecastRevenue117optimizeSchedule124predictContentPerformance131resetAllPredictors140A larger, standalone citation-network library (citation-graph/src, ~6K LOC of
implementation across five modules). CitationGraphBuilder constructs the graph
(DOI parsing, author/title normalization, dedup, field/year filtering);
NetworkAnalyzer computes degree/in/out, betweenness, closeness, PageRank
(damping/convergence configurable), clustering coefficient, density, diameter,
reciprocity, and connected components; CoCitationAnalyzer builds co-citation
and coupling matrices and clusters by similarity; TemporalAnalyzer computes
citation half-life, velocity, growth, bursts, dormant/emerging papers; and
AnomalyDetector flags citation rings, spikes, self-citation excess, orphans,
and reciprocal-citation patterns. The exported helpers are real graph
algorithms, not wrappers.
createAnomalyId38createCitationEdgeId38createCitationNodeId38createClusterId38createSnapshotId38AcademicField47AnomalySeverity47AnomalyType47CitationRelation47CitationTrend47SourceType47CitationGraphBuilder57DEFAULT_GRAPH_BUILDER_CONFIG57DOI_PATTERN57 +114 moreSource-trust analysis (credibility/src). Five analyzers: source-credibility
(authority levels, accuracy results, citation metrics, peer-review
verification), quality-assessment (~1.2K LOC, multi-dimension quality scoring
with issue severity/category), claim-extraction (typed claims from text),
bias-detection (bias type/impact indicators), and contradiction-resolution
(contradiction typing with resolution strategies and consensus levels). The
types.ts surface defines the branded IDs and config types; implementations are
real scoring logic.
SourceId2ClaimId2AssessmentId2createSourceId2createClaimId2createAssessmentId2AuthorityLevel2ResearchSource2SourceType2CredibilityScore2AccuracyResult2CitationMetrics2PeerReviewVerification2KnowledgeDomain2 +196 moreDocument parsing and normalization (document-parser/src). Seven modules:
format-detection (extension + content heuristics, SupportedFormat),
text-extraction (with language detection), structure-analysis (headers,
sections), metadata-extraction (~885 LOC), citation-extraction (~881 LOC:
typed citations, bibliography parsing in multiple styles, validation/issues),
content-chunking, and a top-level document-processor that ties them into a
DocumentProcessingResult. Real parsing logic with branded IDs from types.ts.
createDocumentId32createChunkId32createCitationId32createHeaderId32SupportedFormat32CitationType32BibliographyStyle32ChangeType32Language32getFormatExtensionMap45getExtensionFormatMap45detectFormatFromExtension45isFormatSupported45getExtensionsForFormat45 +104 moreThe educational knowledge base (knowledge-base/src). Five large modules:
entity-extraction (~1.8K LOC), relationship-extraction (~1.1K LOC),
standards-mapping (~1.4K LOC: curriculum standard alignment, coverage
analysis), coherence-analysis (~1K LOC: prerequisite/progression analysis,
coherence scoring/issues), and a knowledge-store (~952 LOC) with query results
and statistics. Branded KBEntityId/KBRelationshipId/StandardId types
anchor the domain in types.ts.
createCoherenceReportId38createKBEntityId38createKBRelationshipId38createStandardId38createStoreEntryId38BloomLevel47CoherenceClassification47CoherenceIssueType47ConfidenceLevel47EducationalEntityType47EducationalRelationType47ExtractionMethod47GradeLevel47IssueSeverity47 +123 moreThe end-to-end research orchestration engine (research-engine/src, ~7.5K LOC).
Five large modules: query-planning (~1.6K LOC: decomposition, strategies),
knowledge-extraction (~1.7K LOC: facts, entities, relationships),
fact-verification (~1.3K LOC: verification results, consistency,
contradictions), source-scoring (~1K LOC), and research-orchestration (~1.2K
LOC) tying them into ResearchSession/ResearchResult. Overlaps conceptually
with @sophia/agents but is the lower-level engine; both are real.
createQueryId29createFactId29createEntityId29createSessionId29createVerificationId29QueryStrategy29SearchSource29FactRelation29EntityType29KnowledgeDomain29VerificationStatus29DomainTier29ResearchDepth29ResearchPhase29 +112 moreThe educational semantic-search stack (semantic-search/src), the largest
multi-module library here. BM25 sparse retrieval (configurable k1/b, field
weights, stop-words, highlights), hierarchical and hybrid retrieval (with
reciprocal-rank fusion), multi-factor result-ranking, a two-layer
search-cache, search-config, a ~1.4K-LOC search-orchestration,
structured and tool-mediated retrieval, retrieval-labels
(provenance/source- scope enforcement), source-set-invalidation, and an
iris-adapter for the Iris assistant. The educational-search module alone is
~2K LOC. Real IR implementations.
createCacheEntryId44createSearchResultId44createSearchSessionId44CacheEvictionPolicy47CollectionType47FilterOperator47RankingFactor47SearchPhase47SearchType47SimilarityMetric47COLLECTION_TYPE_NAMES58DEFAULT_RANKING_WEIGHTS58DEFAULT_SEARCH_CONFIG58DEFAULT_SEARCH_FILTERS58 +254 moreCurriculum-vs-trend analysis (trend-curriculum/src). TrendMapper (~1.6K LOC,
mapping learning objectives to trend signals, surfacing unmapped trends and
orphaned objectives), a CurriculumProfiler (field/Bloom distributions,
coverage gaps, skew analysis), a RelevanceScorer (weighted relevance
breakdown), an objective-trend analyzer, and a CurriculumRecommender (~1.7K
LOC producing recommendation reports). Typed events and branded IDs in
types.ts; real scoring and mapping logic.
createObjectiveId40createCurriculumId40createTrendSignalId40createRecommendationId40createMappingId40BloomLevel49AcademicField49TrendDirection49EducationLevel49RecommendationAction49RecommendationPriority49RelevanceCategory49SignalSource49DecayFunction49 +112 more