Skip to content

thephilgray/constellation-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

209 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŒŒ Constellation Engine

A Serverless, AI-Powered Operating System & Second Brain for Creativity, Autonomous Research, and Content Publishing.

SST v3 AWS Serverless Google Gemini Pinecone TypeScript Astro 5 React 19 Tailwind CSS v4 License


๐Ÿ”ญ Overview & Mission

The Constellation Engine is a personal "Second Brain" designed to bridge the gap between High-Throughput Ideation (fleeting thoughts, dreams, random ideas, voice dictation) and High-Latency Processing (writing, synthesis, archiving, autonomous research, and publication).

Instead of a passive, static note-taking app, Constellation Engine is an active, living operating system. Whenever new data is ingested, an autonomous AI "Gardener" and specialized domain personas actively tend to the ecosystemโ€”clustering thoughts, checking fiction story continuity, analyzing dream symbols, curating external literature, and drafting publishable articles in the background.


โœจ Key Capabilities & Highlights

  • ๐Ÿ—๏ธ Serverless Event-Driven Architecture: Powered by AWS Lambda, DynamoDB Streams, and Step Functions via SST v3 (Ion) for zero-idle compute cost and massive scalability.
  • ๐Ÿง  Semantic Vector Memory: Integrates Pinecone serverless vector databases with Google Gemini 2.5 Flash embeddings for Retrieval-Augmented Generation (RAG) and historical memory resonance.
  • ๐Ÿ—„๏ธ Unified Lake Architecture: Built on a single-table DynamoDB design that seamlessly connects user entries, metadata, living dashboards, and asynchronous background worker queues.
  • ๐Ÿค– Autonomous AI Sidecars: Specialized AI personas that independently process, synthesize, and maintain living documents tailored to specific creative domains.
  • ๐Ÿ“š Autonomous Research Pipeline (The Librarian): An AWS Step Functions workflow that orchestrates multi-source literature retrieval (Tavily API, Google Books, Dev.to, and GitHub) to curate actionable reading lists and strategic analyses.
  • โœ๏ธ AI Publication Engine (DiffPress): End-to-end automated publishing pipeline that discovers and enriches GitHub repositories, seeds article ideas, generates structured handoffs, drafts technical posts, provides an interactive streaming AI chat editor, and publishes directly to Dev.to and webhooks.
  • ๐Ÿ“ฑ Multi-Modal Frontend & Obsidian Sync: Combines headless iOS Shortcuts (text, dictation, share sheet), an Astro 5 + React 19 web dashboard, and seamless bidirectional GitHub Markdown synchronization with local Obsidian vaults.
  • ๐Ÿ” Enterprise Security: Secured via AWS Cognito User Pools (with Google Identity Provider support), JWT authorizers, and API key verification.

๐Ÿ—๏ธ System Architecture & Data Flow

High-Level Architecture

graph TD
    subgraph Inputs ["๐Ÿ“ฑ Multi-Modal Input Layer"]
        IOS["iOS Shortcuts<br/>(Text / Dictation / Share)"]
        WEB["Web Dashboard<br/>(Astro 5 / React 19)"]
        WH["External Webhooks &<br/>GitHub Events"]
    end

    subgraph Gateway ["๐Ÿ›ก๏ธ API Gateway & Auth"]
        API["AWS API Gateway"]
        COG["AWS Cognito<br/>(Google IDP / JWT / API Keys)"]
    end

    subgraph Core ["โšก Serverless Compute & Storage (SST v3 Ion)"]
        INGEST["Ingestion & Intent Router<br/>(AWS Lambda)"]
        DYNAMO[("DynamoDB Unified Lake<br/>(Single-Table Design)")]
        STREAM["DynamoDB Streams<br/>(Event Trigger)"]
        S3[("S3 Asset Bucket<br/>(Multimedia Storage)")]
    end

    subgraph Sidecars ["๐Ÿค– Autonomous AI Sidecars & Workflows"]
        GARDENER["๐Ÿง  The Gardener<br/>(Thought Engine)"]
        PHIL["๐Ÿ”ฎ The Philosopher<br/>(Idea Garden)"]
        LORE["๐Ÿ“– The Lore Keeper<br/>(Fiction Story Bible)"]
        BIO["๐Ÿงฌ The Biographer<br/>(Life Log & Memories)"]
        DREAM["๐ŸŒ™ The Dream Logger<br/>(Jungian Analyst)"]
        LYRIC["๐ŸŽต The Lyric Lab<br/>(Session Musician)"]
        LIB["๐Ÿ“š The Librarian<br/>(Step Functions Pipeline)"]
        DIFF["โœ๏ธ DiffPress<br/>(AI Publication Engine)"]
    end

    subgraph Memory ["๐Ÿง  Memory & External Sync"]
        GEMINI["Google Gemini 2.5 Flash<br/>(Reasoning & Embeddings)"]
        PINE[("Pinecone Vector DB<br/>(Semantic Search)")]
        GH["GitHub API<br/>(Obsidian Vault Sync)"]
        DEVTO["Dev.to / Webhooks<br/>(Article Publishing)"]
    end

    IOS --> API
    WEB --> API
    WH --> API
    API --> COG
    COG --> INGEST
    INGEST --> DYNAMO
    INGEST --> S3
    DYNAMO --> STREAM
    STREAM --> GARDENER & PHIL & LORE & BIO & DREAM & LYRIC & LIB & DIFF
    
    GARDENER & PHIL & LORE & BIO & DREAM & LYRIC & LIB & DIFF <--> GEMINI
    GARDENER & PHIL & LORE & BIO & DREAM & LYRIC & LIB & DIFF <--> PINE
    GARDENER & PHIL & LORE & BIO & DREAM & LYRIC & LIB & DIFF --> GH
    DIFF --> DEVTO
Loading

Autonomous Research & Publication Workflow

sequenceDiagram
    autonumber
    actor User as User / iOS Shortcut
    participant Lake as DynamoDB Unified Lake
    participant Step as Librarian Step Functions
    participant AI as Gemini 2.5 & Pinecone
    participant DP as DiffPress Content Engine
    participant GH as GitHub / Obsidian / Dev.to

    User->>Lake: Ingest Note / Research Topic
    Lake-->>Step: Trigger Autonomous Workflow
    Step->>AI: Strategic Analysis & Context Fetching
    Step->>Step: Query Tavily, Google Books & Dev.to
    Step->>AI: Synthesize Insights & Curate Recommendations
    Step->>Lake: Persist Curated Recommendations
    Step->>GH: Sync to Obsidian Vault (00_Research.md)
    
    Note over DP, GH: Automated Article Publishing Flow
    DP->>GH: Discover & Enrich Repositories
    DP->>AI: Seed Ideas & Generate Article Handoff
    DP->>Lake: Create Draft & Notify Interactive Editor
    User->>DP: Review / Stream AI Edits via Dashboard
    DP->>GH: Publish Article to Dev.to & GitHub Backup
Loading

๐Ÿงฉ The "Sidecar" Modules & Personas

The engine implements a "Sidecar Pattern," routing different types of input to specialized AI personas that maintain stateful markdown dashboards and databases.

Persona / Module Role Function & Responsibilities Output Dashboard
๐Ÿง  The Thought Engine The Gardener Clusters loose thoughts into emergent topics ("Constellations"). Distinguishes between raw Ideas (seeds), active Drafts (plants), and Sources (fertilizer). 00_Current_Constellations.md
๐Ÿ”ฎ The Philosopher The Synthesis Engine Cultivates the "Idea Garden" by analyzing intellectual evolution, tracking current obsessions, synthesizing theories, and posing open questions. 00_Idea_Garden.md
๐Ÿ“– The Lore Keeper The Continuity Editor Maintains a living Story Bible for fiction writers. Tracks world rules and character arcs, separates scene drafts from metadata, and flags plot contradictions. 00_Story_Bible.md
๐Ÿงฌ The Biographer The Family Archivist Unifies daily journal entries and recovered memories. Analyzes mood and milestones, using vector search to surface past memories that resonate with today's events. 00_Life_Log.md
๐ŸŒ™ The Dream Logger The Jungian Analyst Processes morning dream descriptions to track recurring symbols, archetypes, and subconscious emotional trajectories over time. 00_Dream_Journal.md
๐ŸŽต The Lyric Lab The Session Musician Evaluates meter, cadence, and rhyme schemes rather than just semantic meaning. Connects "Orphan Lines" into structured song concepts. 00_Lyric_Lab.md
๐Ÿ“š The Librarian The Research Assistant An AWS Step Functions orchestrated workflow that researches user topics across external APIs (Tavily, Google Books, Dev.to), performing strategic analysis and literature curation. 00_Research_Library.md
โœ๏ธ DiffPress The Content Engine An autonomous publisher that scans GitHub repositories, generates content ideas, drafts technical blog posts, provides streaming AI chat editing, and publishes directly to Dev.to. 00_DiffPress_Dashboard.md

๐Ÿ—„๏ธ Unified Lake Data Schema (Single-Table Design)

The backend utilizes AWS DynamoDB with a single-table design (UnifiedLake) that streams real-time modifications to asynchronous background workers:

Primary Key (PK) Sort Key (SK) Entity Type Description
USER#<id> ENTRY#<id> Ingested Note Raw thoughts, drafts, journal logs, or articles
USER#<id> METADATA User Profile User settings, Cognito identity, API preferences
DASHBOARD#<persona> STATE AI Persona State Living markdown summary maintained by AI sidecars
REPO#<owner>/<name> METADATA DiffPress Repo Enriched repository metadata and feature analysis
HANDOFF#<id> METADATA Article Handoff Automated content generation task pipeline

๐Ÿš€ Tech Stack

Cloud & Infrastructure

  • Framework: SST v3 (Ion)
  • Serverless Compute: AWS Lambda, AWS Step Functions, AWS API Gateway
  • Database & Storage: AWS DynamoDB (Streams enabled), AWS S3, AWS SSM
  • Authentication: AWS Cognito User Pools (Google Identity Provider & JWT Authorizers)

Artificial Intelligence & Data

  • LLM & Reasoning: Google Gemini 2.5 Flash (@google/genai)
  • Vector Database: Pinecone Serverless Vector Index (@pinecone-database/pinecone)
  • External APIs: Tavily AI Search, Google Books API, Dev.to API, Octokit (GitHub API)

Frontend & Web Dashboard

  • Web Framework: Astro 5 & React 19
  • Styling & UI: Tailwind CSS v4, Radix UI Primitives, Lucide Icons
  • State Management & Tooling: Zustand, Vite, TypeScript, Zod, Vitest

๐Ÿ“‚ Project Structure

constellation-engine/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ biographer.ts / biographerAsync.ts # Biographer persona handlers
โ”‚   โ”œโ”€โ”€ dreams.ts                          # Dream Logger handler
โ”‚   โ”œโ”€โ”€ fiction.ts                         # Lore Keeper handler
โ”‚   โ”œโ”€โ”€ ingest.ts                          # Main ingestion & Intent Router
โ”‚   โ”œโ”€โ”€ lyrics.ts                          # Lyric Lab handler
โ”‚   โ”œโ”€โ”€ philosopher.ts                     # Philosopher / Idea Garden handler
โ”‚   โ”œโ”€โ”€ components/                        # React 19 UI components (Radix + Tailwind v4)
โ”‚   โ”œโ”€โ”€ diffpress/                         # DiffPress AI Content Engine & publishing suite
โ”‚   โ”œโ”€โ”€ librarian/                         # Librarian Step Functions research pipeline
โ”‚   โ”œโ”€โ”€ lib/                               # DynamoDB schemas, AWS clients & utilities
โ”‚   โ”œโ”€โ”€ pages/                             # Astro 5 web dashboard pages
โ”‚   โ””โ”€โ”€ workers/                           # Async background workers (GitHub backup, etc.)
โ”œโ”€โ”€ docs/                                  # Tech specs, implementation plans & architecture
โ”œโ”€โ”€ sst.config.ts                          # AWS infrastructure definition (SST v3 Ion)
โ”œโ”€โ”€ astro.config.mjs                       # Astro web application config
โ””โ”€โ”€ package.json                           # Dependencies & scripts

โšก Getting Started

1. Prerequisites

  • Node.js: v20 or higher
  • AWS Account: Configured locally with appropriate IAM permissions
  • API Keys Required:
    • Google Gemini API Key (GEMINI_API_KEY)
    • Pinecone API Key & Index Host (PINECONE_API_KEY, PINECONE_INDEX_HOST)
    • GitHub Personal Access Token (GITHUB_TOKEN, GITHUB_OWNER, GITHUB_REPO)
    • Optional: Tavily, Google Books, and Dev.to API keys for Librarian & DiffPress modules

2. Installation & Setup

Clone the repository and install dependencies:

git clone https://github.com/thephilgray/constellation-engine.git
cd constellation-engine
npm install

Configure your environment secrets via SST:

npx sst secret set GEMINI_API_KEY "your-gemini-api-key"
npx sst secret set PINECONE_API_KEY "your-pinecone-api-key"
npx sst secret set GITHUB_TOKEN "your-github-token"

3. Local Development

Start the Astro local dev server and SST live Lambda development environment:

# Start Astro frontend locally
npm run dev

# Start SST v3 live dev environment (in a separate terminal)
npx sst dev

4. Production Deployment

Deploy the serverless infrastructure and web dashboard to AWS:

npm run deploy:prod

๐Ÿ” Licensing & Commercial Rights

Constellation Engine operates under a Dual-Licensing Model:

  1. Core Open-Source Modules (Apache License 2.0): All foundational backend services, personal second-brain personas (The Gardener, The Philosopher, The Biographer, etc.), and web dashboard components are licensed under the permissive Apache License 2.0. You are free to use, modify, and build upon these core systems.
  2. DiffPress Commercial Module (Business Source License 1.1): The contents of the src/diffpress directory constitute the commercial DiffPress AI Publication Engine. This module is licensed under BUSL-1.1, allowing free personal use, self-hosting, and internal testing, while strictly prohibiting commercial packaging as a paid SaaS or managed cloud service. On July 6, 2030, this license automatically converts to Apache License 2.0.

Built with โค๏ธ by Phillip Gray & the Constellation Engine Contributors.

About

A serverless, AI-powered "Second Brain" that autonomously synthesizes raw ideas, memories, and creative drafts into living, stateful dashboards

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages