# Sophia Domain Feature Inventory

Generated on May 8, 2026. This document captures domain feature scope from the
Oshun repository and the phase checklist in `TODOS.md`.

## Overview

Sophia is the knowledge backbone of the Oshun ecosystem. It turns documents,
research papers, scriptures, and any textual source into a searchable,
graph-connected, citation-verified knowledge base. Whether you are a researcher
building a bibliography, a worldbuilder grounding your fiction in historical
fact, or a content creator who needs AI answers backed by real sources, Sophia
provides the infrastructure.

## Coverage Summary

- Domain slug: `sophia`
- TODO phase coverage: `6`
- Checklist-derived feature items: 85
- Repository status: Repository implementation exists under apps/libs/services.
- Oshun integration status: Referenced in Oshun apps, libraries, or docs.
- Source confidence: Implementation-backed and documentation-backed

## Source Hierarchy

1. Actual implementation footprints in `apps/`, `libs/`, `services/`, and
   `openapi/`
2. TODO-derived capability scope from the mapped phase sections
3. Existing standalone domain docs in `docs/domains/sophia/`

## Capability Pillars

| Capability Pillar                       | Primary Source                  | Status                |
| --------------------------------------- | ------------------------------- | --------------------- |
| Executive Summary                       | docs/domains/sophia/features.md | implementation-backed |
| Document Ingestion                      | docs/domains/sophia/features.md | implementation-backed |
| Intelligent Chunking                    | docs/domains/sophia/features.md | implementation-backed |
| Semantic Search                         | docs/domains/sophia/features.md | implementation-backed |
| RAG Pipeline                            | docs/domains/sophia/features.md | implementation-backed |
| Knowledge Graph                         | docs/domains/sophia/features.md | implementation-backed |
| Vector Database Support                 | docs/domains/sophia/features.md | implementation-backed |
| Embedding Generation                    | docs/domains/sophia/features.md | implementation-backed |
| Citation Management                     | docs/domains/sophia/features.md | implementation-backed |
| Research Workflows                      | docs/domains/sophia/features.md | implementation-backed |
| Retrieval Quality Evaluation            | docs/domains/sophia/features.md | implementation-backed |
| Cultural Research                       | docs/domains/sophia/features.md | implementation-backed |
| Predictive Analytics                    | docs/domains/sophia/features.md | implementation-backed |
| Workbench (Web Application)             | docs/domains/sophia/features.md | implementation-backed |
| TypeScript SDK                          | docs/domains/sophia/features.md | implementation-backed |
| Cross-Domain Integration                | docs/domains/sophia/features.md | implementation-backed |
| Platform Availability                   | docs/domains/sophia/features.md | implementation-backed |
| Feature Comparison: Search Modes        | docs/domains/sophia/features.md | implementation-backed |
| Feature Comparison: Chunking Strategies | docs/domains/sophia/features.md | implementation-backed |
| Feature Comparison: Vector Backends     | docs/domains/sophia/features.md | implementation-backed |

## Implementation-Derived Capability Surfaces

| Category    | Path                               | Inferred Capability Surface |
| ----------- | ---------------------------------- | --------------------------- |
| Application | `apps/sophia/ingestion/`           | Ingestion                   |
| Application | `apps/sophia/knowledge-graph/`     | Knowledge Graph             |
| Application | `apps/sophia/search-api/`          | Search Api                  |
| Application | `apps/sophia/workbench/`           | Workbench                   |
| Library     | `libs/sophia/agents/`              | Agents                      |
| Library     | `libs/sophia/citation-analysis/`   | Citation Analysis           |
| Library     | `libs/sophia/citation-graph/`      | Citation Graph              |
| Library     | `libs/sophia/client/`              | Client                      |
| Library     | `libs/sophia/concordia-knowledge/` | Concordia Knowledge         |
| Library     | `libs/sophia/CONVERGENCE_PLAN.md`  | CONVERGENCE PLAN.md         |
| Library     | `libs/sophia/corpus/`              | Corpus                      |
| Library     | `libs/sophia/crawling/`            | Crawling                    |
| Library     | `libs/sophia/credibility/`         | Credibility                 |
| Library     | `libs/sophia/cultural-research/`   | Cultural Research           |
| Library     | `libs/sophia/database/`            | Database                    |
| Library     | `libs/sophia/document-parser/`     | Document Parser             |
| Library     | `libs/sophia/embeddings/`          | Embeddings                  |
| Library     | `libs/sophia/evaluation/`          | Evaluation                  |
| Library     | `libs/sophia/event-publisher/`     | Event Publisher             |
| Library     | `libs/sophia/indexing/`            | Indexing                    |
| Library     | `libs/sophia/knowledge-base/`      | Knowledge Base              |
| Library     | `libs/sophia/knowledge-graph/`     | Knowledge Graph             |
| Library     | `libs/sophia/oshun-client/`        | Oshun Client                |
| Library     | `libs/sophia/predictions/`         | Predictions                 |
| Library     | `libs/sophia/README.md`            | README.md                   |
| Library     | `libs/sophia/research-engine/`     | Research Engine             |
| Library     | `libs/sophia/schemas/`             | Schemas                     |
| Library     | `libs/sophia/semantic-search/`     | Semantic Search             |
| Library     | `libs/sophia/theory/`              | Theory                      |
| Library     | `libs/sophia/trend-curriculum/`    | Trend Curriculum            |
| Library     | `libs/sophia/vectordb/`            | Vectordb                    |
| Library     | `libs/sophia/verification/`        | Verification                |

## Canonical Standalone Feature Coverage

| Heading Level | Feature Family                          |
| ------------- | --------------------------------------- |
| H2            | Executive Summary                       |
| H2            | Document Ingestion                      |
| H3            | Supported Document Types                |
| H3            | Ingestion Pipeline                      |
| H3            | Ingestion Job Management                |
| H3            | Ingestion via SDK                       |
| H2            | Intelligent Chunking                    |
| H3            | Eight Chunking Strategies               |
| H3            | Chunking Configuration                  |
| H3            | Semantic Chunking                       |
| H2            | Semantic Search                         |
| H3            | Hybrid Search                           |
| H3            | Cross-Encoder Reranking                 |
| H3            | Search Builder                          |
| H3            | Multi-Collection Search                 |
| H3            | Context Retrieval                       |
| H2            | RAG Pipeline                            |
| H3            | Ask a Question                          |
| H3            | RAG Configuration                       |
| H3            | Quick Search vs. RAG                    |
| H2            | Knowledge Graph                         |
| H3            | Entity Types                            |
| H3            | Relationship Types                      |
| H3            | Graph Operations                        |
| H3            | Graph Query Builder                     |
| H3            | Entity Resolution                       |
| H3            | Graph Visualization and Export          |
| H2            | Vector Database Support                 |
| H3            | Four Interchangeable Backends           |
| H3            | Unified Interface                       |
| H3            | Collection Schemas                      |
| H3            | Hybrid Search with RRF                  |
| H2            | Embedding Generation                    |
| H3            | Three Embedding Providers               |
| H3            | Embedding Service                       |
| H3            | Vector Math Utilities                   |
| H2            | Citation Management                     |
| H3            | Five Citation Styles                    |
| H3            | Claim Detection                         |
| H3            | Citation Verification                   |
| H3            | Source Management                       |
| H3            | Citation Graph                          |
| H3            | Bibliography Generation                 |
| H2            | Research Workflows                      |
| H3            | Research Projects                       |
| H3            | Hypothesis Management                   |
| H3            | Research Notes                          |
| H3            | Methodology Types                       |
| H2            | Retrieval Quality Evaluation            |
| H3            | Retrieval Metrics                       |
| H3            | Citation Integrity Checking             |
| H3            | Groundedness Scoring                    |
| H3            | Benchmark System                        |
| H2            | Cultural Research                       |
| H3            | Cultural Sensitivity Analysis           |
| H3            | Cultural Database                       |
| H3            | Localization Management                 |
| H3            | Accessibility                           |
| H2            | Predictive Analytics                    |
| H3            | Revenue Forecasting                     |
| H3            | Schedule Optimization                   |
| H3            | Content Performance Prediction          |
| H2            | Workbench (Web Application)             |
| H3            | Dashboard                               |
| H3            | Documents Page                          |
| H3            | Search Page                             |
| H3            | Curation Page                           |
| H3            | Review Page                             |
| H3            | Annotations Page                        |
| H2            | TypeScript SDK                          |
| H3            | Unified Client                          |
| H3            | Search Client                           |
| H3            | Ingestion Client                        |
| H3            | Knowledge Graph Client                  |
| H3            | Error Handling                          |
| H2            | Cross-Domain Integration                |
| H3            | Events Published                        |
| H3            | Integration with Hathor                 |
| H2            | Platform Availability                   |
| H2            | Feature Comparison: Search Modes        |
| H2            | Feature Comparison: Chunking Strategies |
| H2            | Feature Comparison: Vector Backends     |

## Detailed TODO Phase Coverage

### Phase 6: Sophia (Research & Knowledge) Migration

- Checklist items captured: 85
- Source: `TODOS.md`

#### 6.1 Sophia Library: Document Schemas ✅

- [x] **6.1.1** Create libs/sophia/schemas/ project
- [x] **6.1.2** Add project.json with scope:sophia, layer:contracts tags
- [x] **6.1.3** Define ResearchDocument schema
- [x] **6.1.4** Define Citation schema
- [x] **6.1.5** Define Claim schema
- [x] **6.1.6** Define KnowledgePack schema
- [x] **6.1.7** Define Entity schema (for knowledge graph)
- [x] **6.1.8** Define Relation schema

#### 6.2 Sophia Library: Indexing Pipelines ✅

- [x] **6.2.1** Create libs/sophia/indexing/ project
- [x] **6.2.2** Add project.json with scope:sophia, layer:domain tags
- [x] **6.2.3** Migrate lilith/services/ingestion chunking logic
- [x] **6.2.4** Create chunking strategies (semantic, fixed, sliding window)
- [x] **6.2.5** Create embedding interface
- [x] **6.2.6** Add embedding provider adapters (OpenAI, Cohere, local)
- [x] **6.2.7** Create index builder utilities

#### 6.3 Sophia Library: Vector DB ✅

- [x] **6.3.1** Create libs/sophia/vectordb/ project
- [x] **6.3.2** Add project.json with scope:sophia, layer:data tags
- [x] **6.3.3** Migrate lilith/packages/vectordb (Milvus client)
- [x] **6.3.4** Migrate lilith/services/vectordb
- [x] **6.3.5** Create vector search interface
- [x] **6.3.6** Add hybrid search (vector + keyword)
- [x] **6.3.7** Create index management utilities

#### 6.4 Sophia Library: Cultural Research ✅

- [x] **6.4.1** Create libs/sophia/cultural-research/ project
- [x] **6.4.2** Add project.json with scope:sophia, layer:domain tags
- [x] **6.4.3** Migrate yemaya/packages/cultural-research
- [x] **6.4.4** Create AI cultural consultant interface
- [x] **6.4.5** Create translation pipeline
- [x] **6.4.6** Add inclusive design utilities

#### 6.5 Sophia Library: Theory (Research Frameworks) ✅

- [x] **6.5.1** Create libs/sophia/theory/ project
- [x] **6.5.2** Add project.json with scope:sophia, layer:domain tags
- [x] **6.5.3** Migrate yemaya/packages/theory research components
- [x] **6.5.4** Create research methodology frameworks
- [x] **6.5.5** Add citation integrity validation

#### 6.6 Sophia Library: Evaluation

- [x] **6.6.1** Create libs/sophia/evaluation/ project
- [x] **6.6.2** Add project.json with scope:sophia, layer:domain tags
- [x] **6.6.3** Create retrieval quality evaluation harness
- [x] **6.6.4** Create citation integrity checker
- [x] **6.6.5** Create groundedness scorer
- [x] **6.6.6** Add benchmark datasets

#### 6.7 Sophia App: Ingestion Service

- [x] **6.7.1** Create apps/sophia/ingestion/ project
- [x] **6.7.2** Add project.json with scope:sophia, type:app tags
- [x] **6.7.3** Migrate lilith/services/ingestion
- [x] **6.7.4** Create connector framework:
  - [x] PDF connector
  - [x] Web scraper connector
  - [x] API connectors (arXiv, PubMed, etc.)
- [x] **6.7.5** Add OCR pipeline
- [x] **6.7.6** Create chunking worker
- [x] **6.7.7** Create enrichment pipeline (entity extraction, summarization)

#### 6.8 Sophia App: Search/RAG API

- [x] **6.8.1** Create apps/sophia/search-api/ project
- [x] **6.8.2** Add project.json with scope:sophia, type:app tags
- [x] **6.8.3** Migrate lilith/services/rag
- [x] **6.8.4** Create retrieval endpoints
- [x] **6.8.5** Create citation endpoints
- [x] **6.8.6** Create knowledge pack endpoints
- [x] **6.8.7** Add reranking pipeline
- [x] **6.8.8** Implement semantic search
- [x] **6.8.9** Add hybrid search (BM25 + vector)

#### 6.9 Sophia App: Knowledge Graph API

- [x] **6.9.1** Create apps/sophia/knowledge-graph/ project
- [x] **6.9.2** Add project.json with scope:sophia, type:app tags
- [x] **6.9.3** Migrate lilith/services/knowledge
- [x] **6.9.4** Migrate lilith/services/curator-admin
- [x] **6.9.5** Create entity CRUD endpoints
- [x] **6.9.6** Create relation endpoints
- [x] **6.9.7** Create graph query endpoints (subgraph, paths)
- [x] **6.9.8** Add entity resolution

#### 6.10 Sophia App: Research Workbench

- [x] **6.10.1** Create apps/sophia/workbench/ project
- [x] **6.10.2** Add project.json with scope:sophia, type:app tags
- [x] **6.10.3** Create curation UI
- [x] **6.10.4** Create review workflow UI
- [x] **6.10.5** Add annotation tools

#### 6.11 Sophia Client SDK

- [x] **6.11.1** Create libs/sophia/client/ project
- [x] **6.11.2** Add project.json with scope:sophia, layer:clients tags
- [x] **6.11.3** Generate TypeScript client from OpenAPI
- [x] **6.11.4** Create @oshun/sophia-client package
- [x] **6.11.5** Add search helpers
- [x] **6.11.6** Add citation retrieval helpers
- [x] **6.11.7** Add document ingestion helpers

#### 6.12 Sophia Database Schema

- [x] **6.12.1** Create libs/sophia/database/ project
- [x] **6.12.2** Add project.json with scope:sophia, layer:data tags
- [x] **6.12.3** Define Prisma schema for Sophia:
  - [x] Document model
  - [x] DocumentChunk model
  - [x] Citation model
  - [x] Entity model
  - [x] Relation model
  - [x] KnowledgePack model
  - [x] IngestionJob model
- [x] **6.12.4** Create migrations
- [x] **6.12.5** Add seed data

#### 6.13 Knowledge Stack Convergence (from Lilith)

- [x] **6.13.1** Audit lilith/services/spiritual-embeddings for migration
  - OpenAI/HuggingFace embedding providers
  - Hash-based fallback for development
  - Batch embedding generation
- [x] **6.13.2** Audit lilith/services/knowledge-access for migration
  - ContentBundle, AccessPolicy, AccessPass models
  - Token-gated access control
  - IPFS storage integration
- [x] **6.13.3** Plan convergence of lilith knowledge services to Sophia
  - Created CONVERGENCE_PLAN.md in libs/sophia/
  - Data model mappings defined
  - Entity type and relation type mappings
- [x] **6.13.4** Create migration scripts for existing knowledge data
  - migrate-lilith-knowledge.ts in database/prisma/
  - Migrates traditions, concepts, figures, practices, texts, places
  - Creates cross-tradition relationships
- [x] **6.13.5** Update Lilith services to consume Sophia APIs
  - Created @lilith/sophia-adapter library
  - KnowledgeAccessAdapter for ContentBundle/AccessPolicy/AccessPass mapping
  - KnowledgeGraphAdapter for Entity/Relation mapping
  - EmbeddingAdapter for embedding API mapping

---
