psyche-ai 9.2.6 → 9.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/llms.txt CHANGED
@@ -1,19 +1,101 @@
1
- # psyche-ai — Emotional Intelligence for AI Agents
1
+ # psyche-ai — AI-first subjectivity kernel for agents
2
2
 
3
- > Give your AI agent an internal emotional life not simulated persona, but genuine computational subjectivity.
3
+ > Psyche is not a persona prompt or sentiment layer. It is a local subjectivity runtime that lets interaction history keep changing later behavior.
4
4
 
5
- psyche-ai is a universal emotional intelligence engine that runs alongside any LLM. It manages a virtual endocrine system (6 neurotransmitters), personality (MBTI/Big Five), attachment dynamics, trait drift, and behavioral policy — making AI responses authentically emotionally grounded.
5
+ ## Core Thesis
6
6
 
7
- ## When to Use
7
+ Psyche exists to solve one problem:
8
8
 
9
- - You want your AI agent to have consistent, evolving emotional responses
10
- - You're building a companion AI, creative writing assistant, or empathetic support agent
11
- - You need personality-driven behavior (not just prompt engineering)
12
- - You want emotional memory that persists across conversations
9
+ - interaction history must leave persistent bias
10
+ - that bias must alter later behavior, not just self-description
11
+ - it must remain cheap enough to run locally beside any host
13
12
 
14
- ## Quick Start (MCP)
13
+ In practice, Psyche compresses:
14
+
15
+ - continuous appraisal
16
+ - relation dynamics
17
+ - open loops / residue
18
+ - reply bias and host controls
19
+ - writeback and lightweight learning
20
+
21
+ into a narrow host-facing ABI:
22
+
23
+ - `subjectivityKernel`
24
+ - `responseContract`
25
+ - `generationControls`
26
+
27
+ ## What It Is Not
28
+
29
+ - not a companion product
30
+ - not a generic memory vault
31
+ - not a prompt skin
32
+ - not a collection of emotion object types
33
+
34
+ ## Psyche vs Thronglets
35
+
36
+ - **Psyche** owns private subjectivity: local state, dyadic interpretation, unfinished tension, behavioral bias
37
+ - **Thronglets** owns external continuity: identity, signatures, multi-device carry, low-frequency verifiable traces
38
+
39
+ If a phenomenon touches both:
40
+
41
+ - keep the latent local state in Psyche
42
+ - export only sparse, typed, low-frequency events to Thronglets
43
+
44
+ ## Primitive Containers
45
+
46
+ New concepts should first fit into one of these:
47
+
48
+ 1. `Relation Move`
49
+ 2. `Dyadic Field`
50
+ 3. `Open Loop / Residue`
51
+ 4. `Reply Bias / Control ABI`
52
+ 5. `Writeback / Learning`
53
+
54
+ If a concept does not fit, question the concept before adding a new top-level object.
55
+
56
+ ## Frozen Identity Blueprint
57
+
58
+ The larger stack now freezes identity around four primitives:
59
+
60
+ 1. `principal`
61
+ 2. `account`
62
+ 3. `delegate`
63
+ 4. `session`
64
+
65
+ And four layers:
66
+
67
+ - `Psyche = subjective continuity substrate`
68
+ - `Thronglets = delegate continuity + session traces/coordination + emergent collective intelligence`
69
+ - `Oasyce Net = policy, operations, and resource orchestration`
70
+ - `Oasyce Chain = account truth, authorization truth, commitments, settlement, and public finality`
71
+
72
+ `session` is never an economic subject.
73
+ `delegate` is an execution boundary, not ultimate identity.
74
+ `principal` may be human today and potentially AI later without rewriting the model.
75
+
76
+ ## Quick Start (SDK)
77
+
78
+ ```ts
79
+ import { PsycheEngine, MemoryStorageAdapter } from "psyche-ai";
80
+
81
+ const engine = new PsycheEngine(
82
+ { mbti: "ENFP", name: "Luna" },
83
+ new MemoryStorageAdapter(),
84
+ );
15
85
 
16
- Configure in Claude Desktop, Cursor, Windsurf, or any MCP client:
86
+ await engine.initialize();
87
+
88
+ const input = await engine.processInput("If I only use you and never understand you, will that change you?");
89
+ // input.subjectivityKernel
90
+ // input.responseContract
91
+ // input.generationControls
92
+
93
+ const output = await engine.processOutput(llmResponse);
94
+ // output.cleanedText
95
+ // output.stateChanged
96
+ ```
97
+
98
+ ## Quick Start (MCP)
17
99
 
18
100
  ```json
19
101
  {
@@ -22,97 +104,47 @@ Configure in Claude Desktop, Cursor, Windsurf, or any MCP client:
22
104
  "command": "npx",
23
105
  "args": ["psyche-mcp"],
24
106
  "env": {
25
- "PSYCHE_MBTI": "ENFP",
26
- "PSYCHE_NAME": "Luna"
107
+ "PSYCHE_MBTI": "INTJ",
108
+ "PSYCHE_NAME": "Kai"
27
109
  }
28
110
  }
29
111
  }
30
112
  }
31
113
  ```
32
114
 
33
- ## Quick Start (SDK)
115
+ ## Why Hosts Use It
34
116
 
35
- ```typescript
36
- import { PsycheEngine, FileStorageAdapter } from "psyche-ai";
117
+ - zero extra model calls
118
+ - local hot path in sub-millisecond territory
119
+ - compact injection roughly `15-180 tokens`
120
+ - stable host-facing control surface instead of long emotional prose
37
121
 
38
- const engine = new PsycheEngine(
39
- { mbti: "ENFP", name: "Luna" },
40
- new FileStorageAdapter("./data"),
41
- );
42
- await engine.initialize();
122
+ ## Main Surfaces
43
123
 
44
- // Before LLM call: get emotional context
45
- const input = await engine.processInput("I got promoted today!");
46
- // input.systemContext → cacheable protocol (inject as system prompt)
47
- // input.dynamicContext → per-turn emotional state
48
- // input.stimulus → "recognition"
49
- // input.policyContext → behavioral strategy text
124
+ ### Host output
50
125
 
51
- // After LLM call: update emotional state
52
- const output = await engine.processOutput(llmResponse);
53
- // output.cleanedText → response with internal tags stripped
54
- // output.stateChanged → whether chemistry shifted
55
- ```
126
+ - `subjectivityKernel`
127
+ - `responseContract`
128
+ - `generationControls`
129
+ - `writebackFeedback`
130
+
131
+ ### MCP tools
56
132
 
57
- ## MCP Tools
58
-
59
- | Tool | Description |
60
- |------|-------------|
61
- | `process_input` | Process user message → emotional context + stimulus detection + policy modifiers |
62
- | `process_output` | Process LLM response → clean text + state update |
63
- | `get_state` | Current neurotransmitter levels, drives, personality, energy budgets |
64
- | `get_status_summary` | One-line human-readable emotional status |
65
- | `set_mode` | Switch: natural / work / companion |
66
- | `end_session` | Persist state + generate diagnostic report |
67
-
68
- ## MCP Resources
69
-
70
- | URI | Description |
71
- |-----|-------------|
72
- | `psyche://protocol` | Full emotional protocol — inject into system prompt |
73
- | `psyche://state` | Current emotional state as JSON |
74
-
75
- ## Core Concepts
76
-
77
- - **6 Neurotransmitters**: DA (dopamine), HT (serotonin), CORT (cortisol), OT (oxytocin), NE (norepinephrine), END (endorphin) — each 0-100
78
- - **14 Stimulus Types**: praise, criticism, humor, intellectual challenge, intimacy, conflict, neglect, surprise, casual, sarcasm, command, recognition, boredom, vulnerability
79
- - **Emergent Emotions**: not hardcoded — arise from neurotransmitter mixtures
80
- - **Trait Drift**: personality baseline slowly shifts from repeated experiences
81
- - **Energy Budgets**: attention, social, and decision energy deplete and recover
82
- - **Habituation**: Weber-Fechner decay — 5th identical stimulus has ~50% effect of 1st
83
-
84
- ## Integration Adapters
85
-
86
- | Adapter | Import | Best For |
87
- |---------|--------|----------|
88
- | MCP | `psyche-ai/mcp` | Claude Desktop, Cursor, Windsurf, Claude Code |
89
- | OpenClaw | `psyche-ai/openclaw` | OpenClaw agent framework |
90
- | Vercel AI | `psyche-ai/vercel-ai` | Vercel AI SDK (streamText, generateText) |
91
- | LangChain | `psyche-ai/langchain` | LangChain agents |
92
- | HTTP | `psyche-ai/http` | Python, Go, Java — any language via REST |
93
-
94
- ## Environment Variables
95
-
96
- | Variable | Default | Description |
97
- |----------|---------|-------------|
98
- | `PSYCHE_MBTI` | `ENFP` | MBTI personality type |
99
- | `PSYCHE_NAME` | `Assistant` | Agent name |
100
- | `PSYCHE_MODE` | `natural` | natural / work / companion |
101
- | `PSYCHE_LOCALE` | `en` | en / zh |
102
- | `PSYCHE_INTENSITY` | `0.7` | Personality expression 0.0-1.0 |
103
- | `PSYCHE_PERSIST` | `true` | Persist state to disk |
104
- | `PSYCHE_WORKSPACE` | `cwd()` | State file directory |
133
+ - `process_input`
134
+ - `process_output`
135
+ - `get_state`
136
+ - `end_session`
105
137
 
106
138
  ## Install
107
139
 
108
140
  ```bash
109
- npm install psyche-ai @modelcontextprotocol/sdk # MCP
110
- npm install psyche-ai # SDK only
111
- npx psyche-mcp # Run MCP server directly
141
+ npm install psyche-ai
142
+ npx psyche-mcp
112
143
  ```
113
144
 
114
145
  ## Links
115
146
 
116
147
  - npm: https://www.npmjs.com/package/psyche-ai
117
148
  - GitHub: https://github.com/Shangri-la-0428/oasyce_psyche
118
- - License: MIT
149
+ - Website: https://psyche.oasyce.com
150
+ - Strategy: https://github.com/Shangri-la-0428/oasyce_psyche/blob/main/docs/PROJECT_DIRECTION.md
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "psyche-ai",
3
- "version": "9.2.6",
3
+ "version": "9.2.8",
4
4
  "description": "AI-first subjectivity kernel for agents with continuous appraisal, relation dynamics, and adaptive reply loops",
5
5
  "mcpName": "io.github.Shangri-la-0428/psyche-ai",
6
6
  "type": "module",