Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Psyence is an open-source SaaS project that builds the ultimate **human psychology + social intelligence copilot**.

Notifications You must be signed in to change notification settings

sh20raj-dump/Psyence

Repository files navigation

🧠 Psyence

Psyence is a SaaS + open-source project that acts as a psychology-powered copilot for human interaction.
It uses Retrieval-Augmented Generation (RAG) with Cloudflare AutoRAG + R2 storage to deliver practical, context-grounded answers on:

  • Flirting & dating (respectful approaches, handling rejection)
  • Leadership & communication (speak like a CEO, motivate teams)
  • Self-improvement (habits, mindset, productivity, stoicism)
  • Humor & wit (light teasing, comebacks, banter)
  • Negotiation & persuasion (influence ethically, set boundaries)
  • Everyday psychology (confidence, charisma, relationships)

Psyence draws from psychology research, public-domain classics, playbooks, and curated templates.
It’s like Duolingo + Charisma on Command + Psychology Today, powered by AI.


πŸš€ Features

  • RAG Answers β†’ grounded in psychology & communication playbooks.
  • Tone Styles β†’ Friendly β€’ Witty β€’ Direct β€’ Empathic β€’ CEO-style.
  • Role-Play Mode β†’ simulate conversations, get feedback.
  • Knowledge Cards β†’ bite-sized psychology insights, negotiation tactics, humor patterns.
  • Citations β†’ every answer cites its source.
  • Cloudflare Native β†’ AutoRAG + R2 for low-latency, cheap storage.

πŸ—οΈ Tech Stack

  • Frontend β†’ Next.js 15 (App Router), TailwindCSS, shadcn/ui
  • Backend β†’ Cloudflare Workers + AutoRAG (RAG pipeline, retrieval, safety layer)
  • Storage β†’ Cloudflare R2 (documents, embeddings JSONL)
  • Vector Search β†’ AutoRAG indexer (with hybrid search: embeddings + BM25)
  • LLM β†’ OpenAI GPT-4.1 (default) or open-source (Mistral, LLaMA via plugins)
  • Auth β†’ Clerk / Auth.js
  • Payments β†’ Stripe

πŸ“‚ Project Structure


psyence/
β”œβ”€β”€ apps/
β”‚ β”œβ”€β”€ web/ # Next.js frontend
β”‚ β”œβ”€β”€ worker/ # Cloudflare Worker (AutoRAG endpoints)
β”œβ”€β”€ data/
β”‚ β”œβ”€β”€ raw/ # source material (txt/md/pdf summaries)
β”‚ β”œβ”€β”€ processed/ # cleaned + chunked text
β”‚ β”œβ”€β”€ embeddings/ # JSONL embeddings stored in R2
β”œβ”€β”€ scripts/
β”‚ β”œβ”€β”€ ingest.ts # pipeline: clean β†’ chunk β†’ embed β†’ upload
β”œβ”€β”€ README.md

⚑ Getting Started

1. Clone

git clone https://github.com/<your-username>/psyence.git
cd psyence

2. Install

npm install

3. Env Setup

Create .env.local:

OPENAI_API_KEY=sk-xxxx
CLOUDFLARE_ACCOUNT_ID=xxxx
CLOUDFLARE_API_TOKEN=xxxx
R2_BUCKET=psyence-rag

4. Ingest Data

Put your .md or .txt notes in data/raw/. Then run:

npm run ingest

This will:

  1. Clean + chunk docs
  2. Generate embeddings
  3. Upload JSONL β†’ R2
  4. Register in AutoRAG index

5. Run Dev

npm run dev

πŸ“Š Data Sources

  • πŸ“š Public domain psychology texts β†’ Project Gutenberg, Internet Archive
  • 🧾 Your own notes & playbooks β†’ flirting, rejection replies, charisma hacks, negotiation scripts
  • πŸŽ™οΈ Podcast & YouTube transcripts (transformative summaries only)
  • πŸ“° Blogs & newsletters β†’ Farnam Street, Psychology Today, Charisma on Command
  • πŸ—‚οΈ Community datasets β†’ cleaned Reddit/Quora Q&A (e.g. r/socialskills)

⚠️ Copyright note: full copyrighted books (48 Laws of Power, etc.) are not stored. Only licensed summaries, notes, or public-domain equivalents are used.


πŸ› οΈ Optimizations with AutoRAG + R2

  • Pre-chunk text β†’ ~800–1200 tokens, avoids embedding huge docs.
  • Store embeddings in JSONL batches β†’ faster ingestion.
  • Compression β†’ gzip/zstd on R2 to cut storage by ×ば぀.
  • Metadata tagging β†’ tone, culture, context (dating, work, humor).
  • Hybrid search β†’ combine embeddings + keyword search for better accuracy.
  • Re-ranking β†’ small cross-encoder rerank top-12 β†’ top-4 chunks.
  • Caching β†’ store popular queries in Cloudflare KV or D1 for instant (<50ms) answers.

🀝 Contributing

  1. Fork & PR
  2. Add psychology notes / playbooks to data/raw/
  3. Run npm run ingest to process + embed
  4. Submit your PR πŸŽ‰

πŸ“œ License

MIT License β€” all contributed content must be public domain, licensed, or original.


🌟 Vision

Psyence is building the OS for human interaction β€” a universal copilot for charisma, influence, relationships, and personal growth.

Think: "ChatGPT trained on all of psychology, social intelligence, and charisma playbooks."


About

Psyence is an open-source SaaS project that builds the ultimate **human psychology + social intelligence copilot**.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /