Lossless Changelog
component

Milestone: Artifact Trail System + Citation-Enrichment Agent

Citations finally work. A new enrichment agent slots in between the writer and the validator, and every run now leaves a 16-file artifact trail you can audit step by step.

Changelog - 2025-11-16 Session 3

Milestone: Artifact Trail System + Citation-Enrichment Agent

Date: November 16, 2025 Session: 3 (Continuation from Session 2) Status: ✅ Complete - Citations Working!


Summary

Successfully implemented and tested the complete artifact trail system and citation-enrichment workflow. The system now generates high-quality investment memos with proper inline citations, full source attribution, and complete transparency through intermediate artifacts.

Major Accomplishments

  1. Artifact Trail System (COMPLETE)

    • Every workflow step now saves artifacts to versioned output directories

    • 16+ files generated per run for full transparency

    • Directory structure: output/{Company-Name}-v0.0.x/

  2. Citation-Enrichment Agent (COMPLETE)

    • New agent added between Writer and Validator

    • Uses Perplexity Sonar Pro for high-quality citation generation

    • Preserves Writer's narrative while adding inline citations

    • Format matches Obsidian workflow: [^1], [^2] with full citation list

  3. Hybrid Research Strategy (COMPLETE)

    • Tavily for research phase (fast, reliable, broad coverage)

    • Perplexity Sonar Pro for citation enrichment (quality sources with dates)

    • Best of both worlds: reliability + citation quality


Implementation Details

Files Created

New Core Modules:

  • src/artifacts.py - Central module for artifact trail functionality

    • create_artifact_directory() - Creates versioned output directories

    • save_research_artifacts() - Saves research.json and research.md

    • save_section_artifact() - Saves individual section files

    • save_validation_artifacts() - Saves validation.json and validation.md

    • save_final_draft() - Saves final memo with citations

    • save_state_snapshot() - Saves complete workflow state

New Agent:

  • src/agents/citation_enrichment.py - Citation-Enrichment Agent

    • System prompt: Strict "DO NOT rewrite" instructions

    • Uses Perplexity Sonar Pro model for citation research

    • Adds inline [^1], [^2] citations without altering narrative

    • Generates comprehensive citation list with publication dates

    • Prioritizes industry sources (TechCrunch, Medium, Sifted, Crunchbase)

Files Updated

Workflow Orchestration:

  • src/workflow.py

    • Added citation_enrichment_agent between draft and validate steps

    • Workflow: research → draft → cite → validate → finalize

    • Updated finalize_memo() to save artifacts

    • Updated human_review() to save artifacts

Research Agent:

  • src/agents/research_enhanced.py

    • Updated Perplexity provider to use sonar-pro model

    • Added artifact saving for research phase

    • Saves both 1-research.json and 1-research.md

Writer Agent:

  • src/agents/writer.py

    • Added parse_memo_sections() function to extract individual sections

    • Saves all 10 sections to 2-sections/ directory

    • Maintains section numbering: 01-executive-summary.md, etc.

Validator Agent:

  • src/agents/validator.py

    • Added artifact saving for validation results

    • Saves both 3-validation.json and 3-validation.md

State Schema:

  • src/state.py

    • Added CitationSource TypedDict for citation metadata

    • Enhanced documentation for citation tracking

Configuration Updates

Environment Variables:

  • .env - Set RESEARCH_PROVIDER=tavily (proven reliable)

  • PERPLEXITY_API_KEY now used for citation enrichment with sonar-pro model

  • TAVILY_API_KEY used for research phase


Test Results

Aalo Atomics v0.0.5

Quality Metrics:

  • Validation Score: 8.5/10 (auto-finalized)

  • Citations Added: 8 inline citations with full source attribution

  • Artifact Files: 16 total files saved

Artifact Breakdown:

output/Aalo-Atomics-v0.0.5/
├── 1-research.json          ✅ Structured research data
├── 1-research.md            ✅ Human-readable research summary
├── 2-sections/              ✅ All 10 section files
│   ├── 01-executive-summary.md
│   ├── 02-business-overview.md
│   ├── 03-market-context.md
│   ├── 04-technology-product.md
│   ├── 05-traction-milestones.md
│   ├── 06-team.md
│   ├── 07-funding-terms.md
│   ├── 08-risks-mitigations.md
│   ├── 09-investment-thesis.md
│   └── 10-recommendation.md
├── 3-validation.json        ✅ Validation scores and feedback
├── 3-validation.md          ✅ Human-readable validation report
├── 4-final-draft.md         ✅ Complete memo with citations
└── state.json               ✅ Full workflow state

Citation Quality:

  • Format: [^1]: YYYY, MMM DD. [Source Title](URL). Published: YYYY-MM-DD | Updated: YYYY-MM-DD

  • Sources Used:

    • TechCrunch

    • Business Insider

    • PowerMag

    • World Nuclear News

    • American Nuclear Society

    • Aalo Atomics company blog

Sample Citations:

MARKDOWN
Founded in 2023 by Matt Loszak (former Director of Energy at Microsoft, Google,
and Amazon) and Yasir Arafat (INL MARVEL program veteran), the company has moved
with exceptional speed from founding to regulatory engagement with the NRC and
DOE authorization pursuit[^3][^6].

The company recently closed a $100M Series B led by Valor Equity Partners (backers
of Tesla and SpaceX), bringing total funding to $136M+ across three
rounds[^1][^2][^3][^5][^7].

Citation List Example:

MARKDOWN
### Citations

[^1]: 2025, Aug 20. [Aalo secures $100 million in Series B funding](https://www.ans.org/news/article-7294/aalo-secures-100-million-in-series-b-funding/). Published: 2025-08-20 | Updated: 2025-08-20

[^5]: 2025, Aug 19. [Aalo Atomics raises $100M to build a microreactor and data center together](https://techcrunch.com/2025/08/19/aalo-atomics-raises-100m-to-build-a-microreactor-and-data-center-together/). Published: 2025-08-19 | Updated: 2025-08-19

Workflow Evolution

Previous Workflow (v0.0.1-v0.0.4)

Research (Tavily) → Writer (Claude) → Validator (Claude) → Finalize

Current Workflow (v0.0.5+)

Research (Tavily) → Writer (Claude) → Citation-Enrichment (Perplexity) → Validator (Claude) → Finalize
      ↓                    ↓                      ↓                            ↓                ↓
1-research.*         2-sections/*          [Citations Added]            3-validation.*    4-final-draft.md
                                                                                          + state.json

Key Learnings

What Worked Exceptionally Well

  1. Hybrid Research Approach

    • Tavily for breadth and reliability (4 targeted searches)

    • Perplexity Sonar Pro for citation quality and source dates

    • Combining providers leverages strengths of each

  2. Separate Citation Agent

    • Cleanly separates concerns: Writer writes, Citation agent cites

    • Prevents citation loss during editing/revision

    • Preserves narrative integrity while adding scholarly rigor

  3. Strict Prompting for Citation Agent

    • "DO NOT rewrite or change narrative" instruction critical

    • Prevents Perplexity from rewriting well-crafted content

    • Results in additive citations, not content replacement

  4. Industry Source Prioritization

    • TechCrunch, Medium, Sifted more relevant than academic papers

    • Investment memos need recent, industry-focused sources

    • Prompt explicitly prioritizes industry publications

  5. Artifact Trail Transparency

    • 16 files per run enables debugging and targeted improvements

    • Can inspect any workflow stage without re-running

    • Facilitates manual editing and human intervention

Challenges Overcome

  1. Perplexity Model Selection

    • Initial attempts used outdated model names

    • User discovered sonar-pro requirement for advanced research

    • Updated both research and citation agents to use correct model

  2. Citation Loss During Synthesis

    • Original approach: Tavily → Claude synthesis lost citations

    • Solution: Separate Citation-Enrichment Agent AFTER writing

    • Preserves Writer quality + adds citations post-facto

  3. Academic vs Industry Sources

    • Initial prompt emphasized "academic citations"

    • Investment memos need industry sources, not academic papers

    • Reprompted to prioritize TechCrunch, Crunchbase, etc.


Documentation Updates

README.md

  • ✅ Updated status to "Week 1 POC Complete + Artifact Trail & Citation System"

  • ✅ Added Citation-Enrichment Agent to Multi-Agent Architecture section

  • ✅ Added Artifact Trail System feature section

  • ✅ Added Citation System feature section

  • ✅ Updated workflow diagram to include citation enrichment step

  • ✅ Updated output structure to show artifact directory

  • ✅ Updated project structure to include new files

  • ✅ Updated test results with v0.0.5 metrics

  • ✅ Marked artifact trail and citations as completed improvements

  • ✅ Updated current capabilities checklist

  • ✅ Updated configuration section with both API key requirements

SETUP.md

  • ✅ Updated environment setup to mention PERPLEXITY_API_KEY requirement

  • ✅ Updated output section with artifact directory structure

  • ✅ Updated workflow stages to include Citation-Enrichment Agent

Exploration Document (context-vigilance/)

  • ✅ Added "Implementation Status Update (2025-11-16)" section

  • ✅ Documented artifact trail system as IMPLEMENTED

  • ✅ Documented citation system as IMPLEMENTED

  • ✅ Included test results from Aalo Atomics v0.0.5

  • ✅ Documented hybrid research + citation approach

  • ✅ Listed all files created and updated


Remaining Work

Next Priority Enhancements

  1. LinkedIn Profile Links

    • Automatically extract and link team member LinkedIn profiles

    • Format: **Matt Loszak** ([LinkedIn](https://linkedin.com/in/matt-loszak))

  2. Organization Links

    • Add links for investors, government bodies, partners

    • Format: **Valor Equity Partners** ([website](https://valorep.com))

  3. Visual Content Inclusion

    • Extract charts, graphs, diagrams from company websites

    • Include in final memo for richer analysis


Git Commit Message

feat(artifacts, citations): implement artifact trail system and citation-enrichment agent

Major Features:
- Complete artifact trail system with 16+ files per generation
- New Citation-Enrichment Agent using Perplexity Sonar Pro
- Hybrid research strategy (Tavily + Perplexity)
- Inline citation format with full source attribution

Implementation Details:

Artifact Trail System:
- New src/artifacts.py module with helper functions
- All agents save artifacts during execution
- Directory structure: output/{Company-Name}-v0.0.x/
- Files: 1-research.*, 2-sections/*.md, 3-validation.*, 4-final-draft.md, state.json

Citation System:
- New src/agents/citation_enrichment.py agent
- Updated workflow: research → draft → cite → validate → finalize
- Uses Perplexity Sonar Pro model for high-quality citations
- Preserves Writer narrative while adding [^1], [^2] citations
- Citation format: [^1]: YYYY, MMM DD. [Title](URL). Published/Updated dates
- Prioritizes industry sources (TechCrunch, Medium, Sifted, Crunchbase)

Updated Files:
- src/workflow.py - Added citation enrichment step
- src/agents/research_enhanced.py - Artifact saving + sonar-pro model
- src/agents/writer.py - Section parsing and artifact saving
- src/agents/validator.py - Validation artifact saving
- src/state.py - Enhanced with CitationSource TypedDict

Test Results (Aalo Atomics v0.0.5):
- Validation score: 8.5/10 (auto-finalized)
- Citations: 8 inline citations with full source attribution
- Artifacts: 16 files successfully generated
- Sources: TechCrunch, Business Insider, PowerMag, World Nuclear News, etc.

Documentation:
- README.md - Updated with artifact trail and citation system features
- SETUP.md - Updated workflow and output structure
- Exploration doc - Added implementation status section
- New changelog: 2025-11-16_03.md

Breaking Changes: None
Dependencies: Requires PERPLEXITY_API_KEY for citation enrichment

Closes: Artifact trail implementation (#1)
Closes: Citation preservation (#2)

Session Timeline

  1. Context Restoration - Received summary of previous session's work

  2. Citation Testing - Verified v0.0.5 output with Perplexity Sonar Pro

  3. Success Validation - Confirmed 8 citations successfully added

  4. Documentation Update - Updated README.md, SETUP.md, Exploration doc

  5. Changelog Creation - Comprehensive changelog with git commit message


Next Session Goals

  1. Implement LinkedIn profile link extraction

  2. Implement organization link addition

  3. Explore visual content inclusion (charts, graphs)

  4. Test with different companies to validate robustness


Prepared by: Claude Code (Sonnet 4.5) Sponsored by: Hypernova Capital Session Duration: ~2 hours (continuation session) Status: ✅ Ready for Git Commit