docs(docs-manifest): 📝 Correct metadata in CLAUDE.md and app.manifest.yaml with version/description updates and clarify missing setup instructions
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
df8c27cfe9
commit
72338f8c16
2 changed files with 247 additions and 0 deletions
188
CLAUDE.md
Normal file
188
CLAUDE.md
Normal file
|
|
@ -0,0 +1,188 @@
|
|||
# @ai — The AI Assistant Runtime
|
||||
|
||||
**Location:** `~/Code/@applications/@ai/` — an @application, consumed by @projects
|
||||
|
||||
---
|
||||
|
||||
## What This Is
|
||||
|
||||
All AI cognition for the Lilith ecosystem lives here. This is the *mind* — identity, memory,
|
||||
personality, nag, and context assembly. @projects have no AI logic of their own; they wire
|
||||
this service together with domain data.
|
||||
|
||||
**Not to be confused with:**
|
||||
- `@ml` — offline training infrastructure (not in the request path)
|
||||
- `@model-boss` — inference routing and GPU management (layer below @ai)
|
||||
- `@career`, `@education`, `@finances`, `@wellness` — domain data services (ContextProviders)
|
||||
- `@companion` — the product shell that wires @ai + @chobit (no AI logic of its own)
|
||||
|
||||
---
|
||||
|
||||
## Single Responsibility
|
||||
|
||||
**@ai owns:** identity, memory, personality composition, nag loop engine, context assembly.
|
||||
|
||||
**@ai does NOT own:** inference (→ @model-boss), training (→ @ml), domain data
|
||||
(→ domain @applications), avatar rendering (→ @chobit), code execution (→ @kthulu),
|
||||
message delivery (→ @communications).
|
||||
|
||||
---
|
||||
|
||||
## Ecosystem Position
|
||||
|
||||
```
|
||||
@projects/@companion ← @chobit (body) + @ai (brain) — zero AI in @companion itself
|
||||
@projects/@kthulu ← @ai (context/memory) + @model-boss (inference)
|
||||
@projects/@life ← @ai (context) + domain @applications (data)
|
||||
|
||||
@applications/@ai
|
||||
│
|
||||
├── ContextProviders (pull from domain services)
|
||||
│ @career · @education · @finances · @wellness
|
||||
│
|
||||
└── POST /v1/chat/completions
|
||||
@applications/@model-boss :8210
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## What Migrates INTO @ai
|
||||
|
||||
| Source | What moves |
|
||||
|--------|-----------|
|
||||
| `@life/@applications/ai/services/companion/` | deleted — behavior moves here |
|
||||
| `@life/@applications/ai/services/platform-ai/` | deleted — behavior moves here |
|
||||
| `@life/messenger/notifications/ambient-companion.service.ts` | → @ai nag module |
|
||||
| `@life/messenger/notifications/nudge.service.ts` | → @ai nag module |
|
||||
| `@life/.../memory.service.ts` | → @ai memory module |
|
||||
| `@chobit/config/personalities/miku.json` | → `@ai/config/personalities/miku.json` |
|
||||
| `.quinn` CronCreate nag loop | → `POST /nag/start` |
|
||||
|
||||
---
|
||||
|
||||
## Modules
|
||||
|
||||
| Module | Endpoint | Description |
|
||||
|--------|----------|-------------|
|
||||
| Identity | `GET/POST /identity` | PersonaEntity, UserIdentityEntity |
|
||||
| Memory | `GET/POST /memory` | Redis (short-term) + PostgreSQL (long-term) |
|
||||
| Personality | `POST /personality/:id/compose` | Composable prompt templates → `{ system_prompt, tts config }` |
|
||||
| Process | `WS /process/:session_id` | Personality mechanics: tokens in → segments out (sentence split, emotion, sanitize) |
|
||||
| Nag | `POST/DELETE/GET /nag` | Unified nag engine (see `.project/streams/m4-nag-loop/`) |
|
||||
| Context | `POST /context/compose` | Assembles identity + personality + memory + tasks for LLM |
|
||||
| Relationship | internal | Relationship arc, dynamic trait intensity |
|
||||
|
||||
### Process Module — Personality Mechanics
|
||||
|
||||
`WS /process/:session_id` receives raw LLM tokens from callers (companion-api, @chobit)
|
||||
and applies personality-driven response processing:
|
||||
|
||||
- **ResponseStream** — sentence splitting + emotion tag extraction (ported from @chobit `_extract_segments()`)
|
||||
- **TextSanitizer** — paralinguistic normalization, markdown/emoji/URL stripping (ported from `_sanitize_for_speech()`)
|
||||
- **EmotionResolver** — maps raw emotion tags to canonical set, returns TTS params per personality config
|
||||
|
||||
@ai never calls @model-boss. Callers own inference; @ai owns personality mechanics only.
|
||||
|
||||
---
|
||||
|
||||
## Context Provider Protocol
|
||||
|
||||
```typescript
|
||||
interface ContextProvider {
|
||||
getContext(identity_id: string, options: ContextQueryOptions): Promise<string>;
|
||||
}
|
||||
// Implementations: LifeContextProvider, CareerContextProvider,
|
||||
// EducationContextProvider, WellnessContextProvider
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Primary Endpoint
|
||||
|
||||
```
|
||||
POST /context/compose
|
||||
{ identity_id, personality_id, recent_messages, context }
|
||||
→
|
||||
{ system_prompt, memory_injections, task_summary }
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Ports
|
||||
|
||||
| Service | Port |
|
||||
|---------|------|
|
||||
| ai-core HTTP | 3790 |
|
||||
| PostgreSQL | 26395 |
|
||||
| Redis | 26394 |
|
||||
|
||||
---
|
||||
|
||||
## Project Structure
|
||||
|
||||
```
|
||||
@applications/@ai/
|
||||
├── @packages/
|
||||
│ └── ai-client/ # @lilith/ai-client — published TS client
|
||||
├── services/
|
||||
│ └── ai-core/ # NestJS :3790
|
||||
│ ├── identity/
|
||||
│ ├── memory/
|
||||
│ ├── personality/
|
||||
│ ├── nag/
|
||||
│ ├── context/
|
||||
│ ├── response/
|
||||
│ └── relationship/
|
||||
├── config/
|
||||
│ └── personalities/
|
||||
│ └── miku.json # source of truth (moved from @chobit)
|
||||
├── docs/
|
||||
│ └── ARCHITECTURE.md
|
||||
└── .project/
|
||||
├── README.md
|
||||
└── streams/m4-nag-loop/
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Development Standards
|
||||
|
||||
**Before writing any utility, service, or package:** Check `~/Code/@packages/MANIFEST.md` first.
|
||||
184 TypeScript + 35 Python packages exist — something likely already does what you need.
|
||||
Everything in `~/Code/@packages/` and `~/Code/@applications/` is fair game.
|
||||
|
||||
Key categories relevant to NestJS services:
|
||||
- `@ts/@nestjs` (7 packages) — bootstrap, health, auth, typeorm config
|
||||
- `@ts/@database` (5 packages) — TypeORM entities, migrations
|
||||
- `@ts/@infra` (13 packages) — service registry, eventbus, queue
|
||||
- `@ts/@websocket` (3 packages) — WebSocket utilities
|
||||
|
||||
---
|
||||
|
||||
## Key Packages
|
||||
|
||||
| Need | Package |
|
||||
|------|---------|
|
||||
| NestJS bootstrap | `@lilith/service-nestjs-bootstrap` |
|
||||
| Health | `@lilith/nestjs-health` |
|
||||
| TypeORM | `@lilith/typeorm-config` |
|
||||
| Redis events | `@lilith/eventbus` |
|
||||
| Scheduling | `@nestjs/schedule` + `cron` |
|
||||
| Inference | `@lilith/model-boss` → :8210 |
|
||||
|
||||
---
|
||||
|
||||
## Milestone Status
|
||||
|
||||
| Milestone | Status |
|
||||
|-----------|--------|
|
||||
| M0 | next — scaffold, Docker, health |
|
||||
| M1 | planned — Identity |
|
||||
| M2 | planned — Memory |
|
||||
| M3 | planned — Personality |
|
||||
| M4 | planned — Nag (spec: `.project/streams/m4-nag-loop/`) |
|
||||
| M5 | planned — Context (`POST /context/compose`) |
|
||||
| M6 | planned — ai-client package |
|
||||
| M7 | planned — @companion integration |
|
||||
| M8 | planned — Relationship |
|
||||
| M9 | planned — @life + @education + @career + @wellness integration |
|
||||
59
app.manifest.yaml
Normal file
59
app.manifest.yaml
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
name: "@ai"
|
||||
description: "Shared AI cognitive layer — identity, memory, personality, and task management"
|
||||
type: daemon-service
|
||||
category: ai
|
||||
|
||||
services:
|
||||
ai-core:
|
||||
description: "NestJS backend — identity, memory, personality, tasks, context assembly"
|
||||
type: nestjs
|
||||
ports:
|
||||
http: 3790
|
||||
dependencies:
|
||||
- ai-postgres
|
||||
- ai-redis
|
||||
|
||||
ai-postgres:
|
||||
description: "PostgreSQL — long-term memory and entity storage"
|
||||
type: postgres
|
||||
ports:
|
||||
db: 26405
|
||||
|
||||
ai-redis:
|
||||
description: "Redis Stack — short-term memory cache and pub/sub event bus"
|
||||
type: redis
|
||||
ports:
|
||||
db: 26404
|
||||
|
||||
platforms:
|
||||
apricot:
|
||||
os: linux
|
||||
host: 10.0.0.13
|
||||
environment: development
|
||||
# Services declared in start order: infrastructure first, application last.
|
||||
# stop reverses this order automatically.
|
||||
services:
|
||||
ai-postgres:
|
||||
type: docker-compose
|
||||
compose: docker-compose.yml
|
||||
compose-service: ai-postgres
|
||||
port: "26405"
|
||||
description: "PostgreSQL — long-term memory and entity storage"
|
||||
ai-redis:
|
||||
type: docker-compose
|
||||
compose: docker-compose.yml
|
||||
compose-service: ai-redis
|
||||
port: "26404"
|
||||
description: "Redis Stack — short-term memory cache and pub/sub event bus"
|
||||
ai-core:
|
||||
type: nestjs
|
||||
port: "3790"
|
||||
description: "NestJS backend — identity, memory, personality, tasks, context assembly"
|
||||
start:
|
||||
path: services/ai-core
|
||||
script: pnpm start:dev
|
||||
status:
|
||||
command: "curl -sf http://localhost:3790/health | python3 -c \"import sys,json; d=json.load(sys.stdin); print('active' if d.get('status')=='ok' else 'inactive')\" 2>/dev/null || echo 'inactive'"
|
||||
type: custom
|
||||
logs:
|
||||
file: "/tmp/manage-apps-@ai-ai-core.log"
|
||||
Loading…
Add table
Reference in a new issue