diff --git a/opus_manuscript_1773445426.md b/opus_manuscript_1773445426.md new file mode 100644 index 0000000..f12c435 --- /dev/null +++ b/opus_manuscript_1773445426.md @@ -0,0 +1,55 @@ +# Opus Generated Manuscript + +Total Words: 1018 + +# Chapter 1 + +### Chapter 1: The Genesis of a New Story + +Alex Carter sat in the dim glow of multiple monitors, their screens filled with cascading lines of code and digital manuscripts. The quiet hum of the computer fans was the only sound accompanying the crackling energy of Alex's excitement—a stark contrast to the world outside, where traditional publishing houses clung to their age-old methods like barnacles to a ship's hull. Alex, however, was on the brink of something revolutionary: an AI-powered book generation system that could redefine storytelling itself. + +In this digital domain, Alex was a conductor, orchestrating the symphony of algorithms and data sets that promised to transform ideas into prose. Yet, the path was riddled with technical hurdles that demanded more than just skill—they required vision. The AI, affectionately named "Narrator," was both Alex's creation and companion, a repository of literary knowledge and creative potential. But despite its capabilities, there were moments when its outputs felt hollow, as if stripped of the very soul that breathes life into a story. + +Elena Ramirez, Alex's closest confidante and the ethical compass of their venture, often voiced her concerns. "There's a fine line, Alex, between innovation and integrity," she would say, her eyes reflecting a mix of admiration and caution. "We have the power to create, but we must be mindful not to let it become a factory of soulless literature." + +Marcus Lee, the tech-savvy pragmatist of the trio, pushed back against such sentiments. "We can't let fear hold us back. Think of the possibilities—stories that were never told, voices that were never heard. With Narrator, we can democratize storytelling." + +Caught between these opposing forces, Alex knew the stakes were high. To succeed meant revolutionizing the publishing world, offering new avenues for creativity and expression. Yet, failure loomed as a specter of homogenized narratives devoid of the human touch. As Alex typed the final lines of the day's code, a realization dawned: the journey ahead was not just a technical endeavor but a moral one, demanding careful navigation through uncharted literary waters. + +--- + +# Chapter 2 + +**Chapter 2: The Glimmer of Code** + +Alex sat at his cluttered desk, fingers poised above the keyboard, as the glow from the monitor painted his face in shades of blue. The room hummed with the quiet whirr of processors—a symphony of potential. He was in the midst of developing a prototype for an AI-powered book generation system, a project that had consumed his every waking hour. A line of code could mean the difference between a story that resonated with human emotion or one that fell flat, devoid of soul. + +Elena Ramirez, his mentor and an industry veteran, had been skeptical of his endeavor from the start. She believed in the power of the human touch in storytelling. "Alex, remember," she had said during one of their many debates, "a story isn't just data processed by an algorithm. It's a reflection of our deepest fears, hopes, and dreams." + +Despite her reservations, Elena provided invaluable insights, guiding Alex through the maze of ethical considerations. Together, they wrestled with questions that felt as complex as the algorithms themselves: How far should AI influence creative processes? What rights should a machine have to authorship? These were not just technical hurdles but moral quandaries that could reshape the landscape of literature. + +Marcus Lee, a tech-savvy entrepreneur with an eye for innovation, saw the potential in Alex’s work. "This could revolutionize publishing," Marcus had remarked during a brainstorming session. "Imagine the accessibility! Endless stories at your fingertips, tailored for every reader." + +Yet, even Marcus acknowledged the risk of a flood of soulless literature. The fear was not unwarranted. An AI, without the nuanced understanding of human experience, could generate content that was technically perfect but emotionally void. + +As Alex delved deeper into his code, he was acutely aware of the balance he needed to strike. The goal was not to replace human creativity but to enhance it, to build a bridge between human imagination and machine precision. With every keystroke, Alex was not just crafting a program; he was shaping the future of storytelling itself. + +--- + +# Chapter 3 + +# Chapter 3 + +Alex Carter sat at his desk, the glow of multiple monitors casting a bluish hue over the room. The task at hand was daunting: fine-tuning an AI model capable of generating immersive narratives with the depth and nuance of a human writer. It was a journey fueled by his love for storytelling and the potential to democratize the art of writing. Yet, as he delved deeper into the project, the ethical implications loomed larger than ever. + +His colleague, Elena Ramirez, a seasoned editor and fellow AI enthusiast, had raised concerns about the potential for AI to produce literature lacking in soul and originality. "Alex," she had warned, "there's a fine line between innovation and erosion of creativity. We must ensure this tool enhances, not replaces, the human touch." + +Determined to address these concerns, Alex spent countless hours programming ethical constraints into the system, hoping to strike a balance between creativity and technology. The process was fraught with technical hurdles—errors in the algorithm, unpredictable outputs, and the ever-present risk of bias creeping into the AI's learning patterns. + +Meanwhile, Marcus Lee, a visionary investor and Alex's mentor, saw limitless potential in the technology. "Alex," he often said, "imagine a world where anyone can tell their story, regardless of skill or background. This is the future of publishing." + +Caught between these opposing viewpoints, Alex faced a dilemma. On one hand, the allure of revolutionizing the publishing industry was undeniable; on the other, the fear of unleashing a torrent of soulless literature was a shadow that clung to his every decision. + +As the weeks turned into months, Alex's dedication only grew. He realized that the key to success lay in collaboration—melding human creativity with AI precision. With Elena's insights and Marcus's support, he aimed to craft a system that celebrated human imagination while harnessing the power of technology. + +In this delicate dance between ethics and innovation, Alex was determined to not only master the technology but also redefine what it meant to be a storyteller in the digital age. \ No newline at end of file diff --git a/opus_orchestrator/nonfiction/__init__.py b/opus_orchestrator/nonfiction/__init__.py index c016278..d8bb5a0 100644 --- a/opus_orchestrator/nonfiction/__init__.py +++ b/opus_orchestrator/nonfiction/__init__.py @@ -7,6 +7,7 @@ Key components: - critique_criteria: Purpose-specific evaluation criteria - expanded_frameworks: 35+ expert-level frameworks - research_integration: Connect research agent to pipeline +- textbook_frameworks: Educational/academic frameworks """ from opus_orchestrator.nonfiction.classifier import ( @@ -48,6 +49,11 @@ from opus_orchestrator.nonfiction.research_integration import ( ResearchResult, get_research_config_for_purpose, ) +from opus_orchestrator.nonfiction.textbook_frameworks import ( + TEXTBOOK_FRAMEWORKS, + get_textbook_frameworks, + suggest_textbook_framework, +) __all__ = [ # Classifier @@ -83,4 +89,8 @@ __all__ = [ "ResearchRequest", "ResearchResult", "get_research_config_for_purpose", + # Textbook Frameworks + "TEXTBOOK_FRAMEWORKS", + "get_textbook_frameworks", + "suggest_textbook_framework", ] diff --git a/opus_orchestrator/nonfiction/textbook_frameworks.py b/opus_orchestrator/nonfiction/textbook_frameworks.py new file mode 100644 index 0000000..028a212 --- /dev/null +++ b/opus_orchestrator/nonfiction/textbook_frameworks.py @@ -0,0 +1,546 @@ +"""Textbook & Academic Frameworks for Nonfiction. + +Educational frameworks for textbooks, courses, curricula, and academic content. +These are the foundational "Field Anchors" for structured learning. +""" + +from opus_orchestrator.nonfiction_taxonomy import ( + ReaderPurpose, + StructuralPattern, + NonfictionCategory, +) + + +# ============================================================================= +# TEXTBOOK & ACADEMIC FRAMEWORKS +# ============================================================================= + +TEXTBOOK_FRAMEWORKS = { + + # ========================================================================== + # COMPREHENSIVE TEXTBOOK + # ========================================================================== + + "comprehensive_textbook": { + "name": "Comprehensive Textbook", + "description": "The classic academic textbook. Complete coverage of a subject with learning objectives, exercises, and assessment. The gold standard for educational content.", + "purpose": ReaderPurpose.LEARN_HANDS_ON, + "structure": StructuralPattern.SEQUENTIAL, + "category": NonfictionCategory.EDUCATION, + "stages": [ + "Preface - How to use this book", + "Chapter 1: Introduction and Foundations", + "Chapter 2: Core Concepts", + "Chapter 3: Theory and Principles", + "Chapter 4: Methods and Techniques", + "Chapter 5: Applications", + "Chapter 6: Advanced Topics", + "Chapter 7: Case Studies", + "Chapter 8: Synthesis and Integration", + "Chapter 9: Current Research and Future Directions", + "Chapter 10: Review and Assessment", + "Appendix A: Reference Materials", + "Appendix B: Solutions to Exercises", + "Glossary", + "Bibliography", + "Index", + ], + "prompt_template": """Write a comprehensive textbook chapter for: {topic} + +Include: +- Learning objectives at the start +- Clear explanations with examples +- Diagrams described in text +- Key terms highlighted +- Exercises at the end +- Summary of key points""", + "tone_guidance": "Academic, precise, clear. Authoritative but accessible. Like a MIT OpenCourseWare textbook.", + "typical_length": "50,000-200,000 words", + "audience": "University students, professionals seeking certification", + "key_elements": [ + "Learning objectives (Bloom's taxonomy)", + "Key terms and definitions", + "Theoretical foundations", + "Practical applications", + "Exercises and problems", + "Case studies", + "Chapter summaries", + "Discussion questions", + ], + }, + + # ========================================================================== + # CHAPTER-BY-CHAPTER TEXTBOOK + # ========================================================================== + + "textbook_chapter": { + "name": "Textbook Chapter", + "description": "A single chapter from a comprehensive textbook. Modular, self-contained, but references other chapters.", + "purpose": ReaderPurpose.LEARN_HANDS_ON, + "structure": StructuralPattern.SEQUENTIAL, + "category": NonfictionCategory.EDUCATION, + "stages": [ + "Opening: Why this matters", + "Learning Objectives", + "Core Concept 1: The Fundamentals", + "Core Concept 2: Building on the Basics", + "Core Concept 3: Advanced Applications", + "Real-World Application", + "Case Study", + "Common Misconceptions", + "Exercises (Easy)", + "Exercises (Intermediate)", + "Exercises (Advanced)", + "Summary", + "Key Terms", + "Further Reading", + ], + "prompt_template": """Write a complete textbook chapter: + +Title: {chapter_title} + +Include: +1. Motivating introduction - why this matters +2. Learning objectives (3-5 specific outcomes) +3. Clear explanations with examples +4. Visual descriptions (for figures/diagrams) +5. Key terminology +6. Application to real problems +7. Case study +8. Common mistakes to avoid +9. Exercises at 3 levels +10. Summary +11. Glossary of new terms +12. Recommended further reading""", + "tone_guidance": "Clear, methodical, encouraging. Patient with difficult concepts.", + "typical_length": "5,000-15,000 words", + "audience": "Students in a course using this textbook", + }, + + # ========================================================================== + # ONLINE COURSE / MOOC + # ========================================================================== + + "online_course": { + "name": "Online Course / MOOC", + "description": "Massive Open Online Course structure. Modular, video-friendly, with quizzes and assignments. Optimized for self-paced learning.", + "purpose": ReaderPurpose.LEARN_HANDS_ON, + "structure": StructuralPattern.SEQUENTIAL, + "category": NonfictionCategory.EDUCATION, + "stages": [ + "Course Overview - Welcome and What You'll Learn", + "Module 1: Foundations", + " - Lesson 1.1: Video + Text", + " - Lesson 1.2: Video + Text", + " - Quiz 1", + "Module 2: Core Skills", + " - Lesson 2.1: Video + Text", + " - Lesson 2.2: Video + Text", + " - Quiz 2", + "Module 3: Intermediate Concepts", + " - Lesson 3.1: Video + Text", + " - Assignment 1", + "Module 4: Advanced Applications", + " - Lesson 4.1: Video + Text", + " - Lesson 4.2: Video + Text", + " - Final Project", + "Course Review and Assessment", + "Certificate Requirements", + "Next Steps and Further Learning", + ], + "prompt_template": """Design an online course module: + +Module: {module_name} +Topic: {topic} + +For each lesson, provide: +- Learning outcome +- Video script (5-10 min) +- Supplementary text +- Quiz questions (3-5) +- Discussion prompt""", + "tone_guidance": "Energetic, engaging, conversational. Like the best Coursera or edX instructors.", + "typical_length": "Variable - can be assembled from lessons", + "audience": "Online learners of all ages", + }, + + # ========================================================================== + # CURRICULUM / SYLLABUS + # ========================================================================== + + "curriculum": { + "name": "Curriculum / Syllabus", + "description": "Complete course curriculum with learning outcomes, assessment criteria, and sequence. Used by educators to plan instruction.", + "purpose": ReaderPurpose.REFERENCE, + "structure": StructuralPattern.MODULAR, + "category": NonfictionCategory.EDUCATION, + "stages": [ + "Course Description and Overview", + "Learning Outcomes (aligned to standards)", + "Course Schedule / Calendar", + "Weekly Topics and Readings", + "Assessment Overview", + "Grading Policy", + "Required Materials and Resources", + "Attendance and Participation Policy", + "Academic Integrity Policy", + "Course Policies", + "Student Support Services", + "Schedule Detail:", + " - Week 1: Topic, Readings, Assignments", + " - Week 2: ...", + " - ...", + "Final Assessment Description", + ], + "prompt_template": """Create a complete curriculum/syllabus: + +Course: {course_name} +Level: {level} +Duration: {weeks} weeks + +Include: +1. Course description +2. Learning outcomes (measurable) +3. Weekly schedule with topics and readings +4. Assignment descriptions +5. Grading breakdown +6. Policies +7. Resources""", + "tone_guidance": "Professional, clear, comprehensive. Official document style.", + "typical_length": "2,000-5,000 words", + "audience": "Educators, students, administrators", + }, + + # ========================================================================== + # STUDY GUIDE + # ========================================================================== + + "study_guide": { + "name": "Study Guide", + "description": "Student-focused guide for exam preparation. Summarizes key concepts, provides practice problems, includes test-taking strategies.", + "purpose": ReaderPurpose.LEARN_HANDS_ON, + "structure": StructuralPattern.SEQUENTIAL, + "category": NonfictionCategory.EDUCATION, + "stages": [ + "How to Use This Study Guide", + "Quick Review: Key Concepts (summary)", + "Topic 1: Review + Practice Questions", + "Topic 2: Review + Practice Questions", + "Topic 3: Review + Practice Questions", + "Topic 4: Review + Practice Questions", + "Practice Test 1 (full length)", + "Practice Test 2 (full length)", + "Answer Key with Explanations", + "Test-Taking Strategies", + "Common Mistakes to Avoid", + "Last-Minute Review Sheet", + ], + "prompt_template": """Create a comprehensive study guide for: {exam_name} + +Include: +- Key concepts to know (concise summaries) +- Practice questions per topic +- Full practice tests +- Detailed answer explanations +- Test-taking strategies""", + "tone_guidance": "Supportive, clear, encouraging. Like a tutor helping you prepare.", + "typical_length": "10,000-50,000 words", + "audience": "Students preparing for exams", + }, + + # ========================================================================== + # ACADEMIC PAPER / RESEARCH ARTICLE + # ========================================================================== + + "academic_paper": { + "name": "Academic Research Paper", + "description": "Standard academic research article format. IMRAD: Introduction, Methods, Results, And Discussion.", + "purpose": ReaderPurpose.UNDERSTAND, + "structure": StructuralPattern.ARGUMENT, + "category": NonfictionCategory.ACADEMIC, + "stages": [ + "Title - Descriptive and specific", + "Abstract - Complete summary (150-300 words)", + "Introduction - Background and problem statement", + "Literature Review - Prior research", + "Research Questions / Hypotheses", + "Methodology", + "Results", + "Discussion", + "Limitations", + "Future Work", + "Conclusion", + "References", + "Appendices", + ], + "prompt_template": """Write an academic research paper on: {topic} + +Structure: IMRAD (Introduction, Methods, Results, And Discussion) +- Abstract: Summary of entire paper +- Introduction: Problem, significance, research questions +- Methods: How you conducted the research +- Results: What you found +- Discussion: What it means, limitations""", + "tone_guidance": "Formal, precise, objective. Third person. Hedged appropriately.", + "typical_length": "5,000-15,000 words", + "audience": "Academic researchers, peer reviewers", + }, + + # ========================================================================== + # LITERATURE REVIEW + # ========================================================================== + + "literature_review": { + "name": "Systematic Literature Review", + "description": "Comprehensive synthesis of existing research on a topic. Used in academia to identify gaps and establish foundations.", + "purpose": ReaderPurpose.UNDERSTAND, + "structure": StructuralPattern.COMPARATIVE, + "category": NonfictionCategory.ACADEMIC, + "stages": [ + "Introduction - Scope and purpose", + "Search Methodology - How papers were found", + "Inclusion/Exclusion Criteria", + "The Landscape - Overview of research", + "Theme 1: Foundational Studies", + "Theme 2: Key Developments", + "Theme 3: Current State", + "Methodological Approaches", + "Gaps in the Literature", + "Theoretical Framework", + "Implications for Future Research", + "Conclusion", + "References", + ], + "prompt_template": """Write a systematic literature review on: {topic} + +Structure: +1. How you searched (databases, keywords, dates) +2. What you found (overview) +3. Themes in the literature +4. Methodological approaches used +5. Gaps in the research +6. Implications for future work""", + "tone_guidance": "Formal, systematic, thorough. Transparent about methodology.", + "typical_length": "10,000-30,000 words", + "audience": "Academic researchers, graduate students", + }, + + # ========================================================================== + # THESIS / DISSERTATION + # ========================================================================== + + "thesis": { + "name": "Thesis / Dissertation", + "description": "Long-form academic document presenting original research. The definitive form for graduate degrees.", + "purpose": ReaderPurpose.UNDERSTAND, + "structure": StructuralPattern.ARGUMENT, + "category": NonfictionCategory.ACADEMIC, + "stages": [ + "Title Page", + "Abstract", + "Acknowledgments", + "Table of Contents", + "List of Figures/Tables", + "Chapter 1: Introduction", + "Chapter 2: Literature Review", + "Chapter 3: Methodology", + "Chapter 4: Results", + "Chapter 5: Discussion", + "Chapter 6: Conclusion", + "References", + "Appendices", + ], + "prompt_template": """Create a thesis framework for: {research_topic} + +Include all standard thesis chapters with guidance on what each should contain.""", + "tone_guidance": "Formal, rigorous, original contribution. Definitive scholarly voice.", + "typical_length": "20,000-100,000 words", + "audience": "Thesis committee, academic community", + }, + + # ========================================================================== + # WORKBOOK / PRACTICE BOOK + # ========================================================================== + + "workbook": { + "name": "Workbook / Practice Book", + "description": "Interactive learning with fill-in-the-blank exercises, practice problems, and activities. Active learning focus.", + "purpose": ReaderPurpose.LEARN_HANDS_ON, + "structure": StructuralPattern.SEQUENTIAL, + "category": NonfictionCategory.EDUCATION, + "stages": [ + "How to Use This Workbook", + "Unit 1: Foundations", + " - Exercise 1.1: Practice", + " - Exercise 1.2: Application", + " - Exercise 1.3: Challenge", + "Unit 2: Core Skills", + " - Exercise 2.1: Practice", + " - Exercise 2.2: Application", + " - Exercise 2.3: Challenge", + "Unit 3: Advanced Applications", + " - Exercise 3.1: Practice", + " - Exercise 3.2: Integration", + " - Exercise 3.3: Mastery", + "Answer Key", + "Quick Reference Guide", + ], + "prompt_template": """Create an interactive workbook for: {topic} + +Include: +- Fill-in-the-blank exercises +- Practice problems at increasing difficulty +- Real-world application activities +- Reflection prompts +- Self-assessment checklists""", + "tone_guidance": "Active, engaging, interactive. Prompts the learner to participate.", + "typical_length": "20,000-50,000 words", + "audience": "Students, self-learners, corporate training", + }, + + # ========================================================================== + # QUICK REFERENCE GUIDE / CHEAT SHEET + # ========================================================================== + + "quick_reference": { + "name": "Quick Reference Guide", + "description": "Condensed reference for practitioners. Key concepts, formulas, procedures in portable format. The 'cheat sheet' for professionals.", + "purpose": ReaderPurpose.REFERENCE, + "structure": StructuralPattern.MODULAR, + "category": NonfictionCategory.EDUCATION, + "stages": [ + "Introduction - What this covers", + "Section 1: Key Concepts (quick)", + "Section 2: Formulas / Rules", + "Section 3: Procedures / Steps", + "Section 4: Common Patterns", + "Section 5: Troubleshooting", + "Section 6: Tips and Tricks", + "Quick Examples", + "Cross-References", + "Where to Learn More", + ], + "prompt_template": """Create a quick reference guide for: {topic} + +Format: Condensed, scannable, practical +- Key points only +- No lengthy explanations +- Formulas, rules, procedures +- Common issues and solutions +- Tips from experts""", + "tone_guidance": "Concise, practical, scannable. Maximum information, minimum words.", + "typical_length": "2,000-5,000 words", + "audience": "Practitioners who need quick reminders", + }, + + # ========================================================================== + # KNOWLEDGE BASE / WIKI + # ========================================================================== + + "knowledge_base": { + "name": "Knowledge Base / Wiki", + "description": "Organized collection of articles for lookup. Hierarchical, searchable, cross-linked. For organizations and products.", + "purpose": ReaderPurpose.REFERENCE, + "structure": StructuralPattern.MODULAR, + "category": NonfictionCategory.TECHNOLOGY, + "stages": [ + "Getting Started Guide", + "Category 1: Core Concepts", + " - Article 1.1", + " - Article 1.2", + "Category 2: How-To Guides", + " - Article 2.1", + " - Article 2.2", + "Category 3: Troubleshooting", + " - Article 3.1", + "Category 4: Reference", + " - Article 4.1", + "FAQ", + "Glossary", + "Index", + ], + "prompt_template": """Build a knowledge base article for: {topic} + +Include: +- What it is (brief) +- How to use it +- Common use cases +- Troubleshooting +- Related topics""", + "tone_guidance": "Clear, structured, searchable. Optimized for finding answers.", + "typical_length": "500-2,000 words per article", + "audience": "Users looking for specific answers", + }, + +} + + +# Add to main frameworks +def get_textbook_frameworks() -> dict: + """Get all textbook and academic frameworks.""" + return TEXTBOOK_FRAMEWORKS + + +def suggest_textbook_framework( + use_case: str, + audience: str, + length: str, +) -> str: + """Suggest the best framework for your use case. + + Args: + use_case: How you'll use it (course, self-study, reference, etc.) + audience: Who it's for (students, professionals, etc.) + length: Target length (short, medium, long) + + Returns: + Framework ID + """ + use_case = use_case.lower() + audience = audience.lower() + length = length.lower() + + # Course/MOOC + if "course" in use_case or "mooc" in use_case: + return "online_course" + + # Exam prep + if "exam" in use_case or "test" in use_case or "prep" in use_case: + return "study_guide" + + # Academic paper + if "paper" in use_case or "research" in use_case or "academic" in use_case: + return "academic_paper" + + # Thesis + if "thesis" in use_case or "dissertation" in use_case: + return "thesis" + + # Curriculum + if "curriculum" in use_case or "syllabus" in use_case: + return "curriculum" + + # Comprehensive textbook + if "textbook" in use_case: + if length == "short" or length == "medium": + return "textbook_chapter" + return "comprehensive_textbook" + + # Workbook/practice + if "workbook" in use_case or "practice" in use_case or "exercise" in use_case: + return "workbook" + + # Quick reference + if "quick" in use_case or "reference" in use_case or "cheat" in use_case: + return "quick_reference" + + # Knowledge base + if "wiki" in use_case or "knowledge" in use_case or "docs" in use_case: + return "knowledge_base" + + # Literature review + if "literature" in use_case or "review" in use_case: + return "literature_review" + + # Default to textbook chapter + return "textbook_chapter"