How aaronmarkham/spiritwriter-core works
spiritwriter is a local-first memory and trust substrate for agent systems, not an agent framework or retriever. Its main workflow is to create content-addressed memory shards, store and later hydrate them, optionally protecting or sharing them under scoped entitlements. Separate capabilities provide entity resolution, hash-chained provenance and audit verification, plus document ingestion and classification. The graph follows README statements and SOURCE INDEX references; unsampled implementation details and their runtime connections are not inferred.
Main entry points: store.py Shard store · document.py Document ingestor · runner.py Job runner · shard.py Memory shards
Components 23
Memory substrate
- Memory shards
spiritwriter/fabric/shard.py - Shard store
spiritwriter/fabric/store.py - Network resolver
spiritwriter/fabric/network.py - IPFS backend
spiritwriter/fabric/backends/ipfs.py - S3 backend
spiritwriter/fabric/backends/s3.py - Delegated jobs
spiritwriter/fabric/jobs.py - Job runner
spiritwriter/fabric/runner.py
Trust and audit
- Scoped entitlements
spiritwriter/fabric/entitlement.py - AES encryption
spiritwriter/fabric/crypto.py - Sealed encryption
spiritwriter/fabric/sealed.py - Trace emitter
spiritwriter/fabric/emitter.py - Audit lifecycle
spiritwriter/audit - Audit redaction
spiritwriter/audit/redact.py
Entity resolution
- Canonical registry
spiritwriter/fabric/canonicalize.py - Vocabulary registry
spiritwriter/sw_vocab/registry.py
Document ingestion
- PDF extraction
spiritwriter/ingest/extraction.py - Document classifier
spiritwriter/classify/classifier.py - Document model
spiritwriter/models/document.py - Document ingestor
spiritwriter/ingest/document.py - Anthropic provider
spiritwriter/llm/anthropic.py
Integrations
- MemPalace adapter
spiritwriter/integrations/mempalace/backend.py - MCP server
spiritwriter_mcp/server.py
Other components
- Agent or app
Connections 25
- Agent or app → Memory shards: creates memory
README.md - Agent or app → Shard store: stores and hydrates
README.md - Shard store → Memory shards: reads and writes
spiritwriter/fabric/store.py - Shard store → Network resolver: resolves missing
spiritwriter/fabric/store.py - Network resolver → IPFS backend: fetches shards
spiritwriter/fabric/backends/ipfs.py - Shard store → AES encryption: encrypts content
spiritwriter/fabric/store.py - Shard store → Sealed encryption: seals content
spiritwriter/fabric/store.py - Shard store → Scoped entitlements: enforces scope
spiritwriter/fabric/store.py - Agent or app → Delegated jobs: packages task
README.md - Delegated jobs → Job runner: runs work
- Job runner → Shard store: hydrates shards
- Job runner → Trace emitter: records steps
- Agent or app → Trace emitter: emits events
README.md - Audit lifecycle → Trace emitter: chains evidence
spiritwriter/audit/provenance.py - Audit lifecycle → Audit redaction: redacts bundle
spiritwriter/audit/redact.py - Agent or app → Canonical registry: resolves entities
README.md - Vocabulary registry → Canonical registry: uses registry
spiritwriter/sw_vocab/registry.py - Document ingestor → PDF extraction: extracts content
spiritwriter/ingest/document.py - Document ingestor → Document classifier: classifies content
spiritwriter/ingest/document.py - Document ingestor → Document model: builds document
spiritwriter/ingest/document.py - Document ingestor → Anthropic provider: queries provider
spiritwriter/ingest/document.py - Document classifier → Document model: uses document types
spiritwriter/classify/classifier.py - MemPalace adapter → Shard store: stores shards
spiritwriter/integrations/mempalace/backend.py - MCP server → Shard store: uses shard store
spiritwriter_mcp/server.py - MCP server → Memory shards: uses shard model
spiritwriter_mcp/server.py