Skip to content

Latest commit

 

History

History
119 lines (87 loc) · 4.91 KB

File metadata and controls

119 lines (87 loc) · 4.91 KB

Talk With Jamie v2

This is the active Talk With Jamie application. I built it as a privacy-conscious retrieval and access-control experiment: public chat can use approved general information, while any deeper context stays server-side for the authenticated owner workspace. It is clearly labelled as AI and is not intended to impersonate the human Jamie.

This folder is a complete Netlify deployment. It adds private context retrieval while keeping raw personal exports and private source files out of the website and out of GitHub.

What Changed

  • Ranked context retrieval for every public chat and admin draft
  • A built-in public-safe persona covering projects, interests, preferences, goals and style
  • Persistent visitor facts that are fed back into later replies
  • Multiple persistent chats per account, with create, switch and delete controls
  • Direct OpenAI Responses API support with a configurable model
  • A local context builder that joins both sides of social conversations while keeping raw exports local
  • Cross-platform contact summaries for relevant owner-only retrieval
  • Verified owner facts and recency-aware handling for changing views
  • Redaction and exclusion rules for credentials, financial identifiers and high-risk content
  • Deployment-only context maintenance; the live admin interface cannot replace or delete the pack
  • Private context storage in Netlify Blobs
  • Public/admin context separation
  • Context-extraction and suspicious-output blocking
  • Five-minute server-side context caching
  • Legacy login, conversation and admin-thread migration
  • Automated tests for context validation, ranking and privacy boundaries

Context helps it choose wording and relevant background; it must not claim to be the human Jamie, expose source material or make private information available through public chat.

Build The Private Context Pack

The source exports are intentionally outside this folder and ignored by Git.

Place the extracted source text in ../.private-context-source/, then run:

npm ci
npm run context:build

The builder expects:

  • JAMIE_DIGITAL_TWIN_MASTER_EVERYTHING_v3_PHONE_OPENABLE.txt
  • assistant_conversation_export_v1.md
  • the supplied WhatsApp Chat with ...txt files
  • context-config.json - contact names, aliases, relationship descriptions, verified facts and retrieval keywords (copy tools/context-config.example.json and fill it in)

Person-specific data lives only in that untracked config and in the generated pack, so real contact names never appear in this repository.

It writes:

../.private-context/talk-with-jamie-v2.context-pack.json

The generated pack is not committed. It is reviewed and uploaded through the private maintenance workflow to the talk-with-jamie-context Blob store. Import and clear routes exist for that workflow, but they reject requests unless ALLOW_CONTEXT_ADMIN_MUTATION=1; the live admin interface does not expose them.

Netlify Configuration

Required:

  • SESSION_SECRET - random value of at least 32 characters
  • ADMIN_SETUP_TOKEN - one-time setup value of at least 20 characters

Configure one model provider:

  • Recommended: OPENAI_API_KEY, with optional OPENAI_MODEL (defaults to gpt-5.4-mini)
  • OpenAI-compatible: AI_API_URL, AI_API_KEY, AI_MODEL
  • Cohere: COHERE_API_KEY, COHERE_MODEL

Private maintenance scripts may also need:

  • TALK_BLOBS_SITE_ID
  • TALK_BLOBS_TOKEN

No AI key, Netlify token or context data belongs in source code.

Deployment

The production site is connected to the main branch of JamieP-205/talk-with-jamie. Netlify uses v2 as the base directory, runs npm run build, publishes the base directory, and deploys the functions in v2/netlify/functions.

Normal changes follow this process:

  1. run npm ci and npm test in v2
  2. commit and push the change to GitHub
  3. use the Netlify deploy preview for pull requests or non-production branches
  4. merge or push to main only after authentication, storage and API checks pass

Manual CLI production deploys are reserved for recovery or a controlled migration.

Architecture

  • app.js - public chat, multi-chat controls, admin drafting and conversation management
  • netlify/functions/_context.js - pack validation, audience filtering and ranking
  • netlify/functions/_lib.js - API route coordination, Blobs access and migration
  • netlify/functions/_http.js and _security.js - request validation, cookie parsing and password primitives
  • netlify/functions/_memory.js, _provider.js and _prompts.js - visitor memory, provider adapters and persona policy
  • tools/build-private-context.js - local private-pack builder
  • test/ - authentication, context, privacy and deployment tests

Important Privacy Boundary

Private source material is local-only and is never a deployable asset. The builder creates a compact redacted pack for controlled owner retrieval rather than publishing original archives. Review the generated pack before maintenance upload.