Block a user
@phoenix-tekhne/react-sophia (0.3.0)
Published 2026-05-28 07:21:46 -07:00 by dmonphx
Installation
@phoenix-tekhne:registry=https://gitrepo.cstudiosinc.com/api/packages/dmonphx/npm/npm install @phoenix-tekhne/react-sophia@0.3.0"@phoenix-tekhne/react-sophia": "0.3.0"About this package
@phoenix-tekhne/react-sophia
AI/LLM integration components for Phoenix Tekhne.
Overview
Sophia (Σοφία - "wisdom" in Greek) provides AI/LLM integration components and utilities for building intelligent interfaces. While this package is primarily reserved for future AI features, it currently includes the Prompt Manager system for managing AI prompts and conversations.
Current Features
Prompt Manager
The Prompt Manager provides a comprehensive system for managing AI prompts with support for:
- Storage Adapters - Prisma (production) or In-Memory (testing)
- Conversation Management - Multi-turn conversations with context
- Prompt Templates - Reusable prompt patterns
- Metadata - Tags, categories, versioning
Components
| Component | Purpose |
|---|---|
| PromptManager | Core class for prompt operations |
| PrismaPromptStorage | Production storage with Prisma ORM |
| MemoryPromptStorage | In-memory storage for testing |
| IXDF Pattern Utilities | Domain-specific prompt patterns |
Installation
npm install @phoenix-tekhne/react-sophia
# For production storage:
npm install @prisma/client prisma
Usage
Basic Prompt Manager
import {
PromptManager,
MemoryPromptStorage,
} from "@phoenix-tekhne/react-sophia";
// Initialize with memory storage (for testing)
const storage = new MemoryPromptStorage();
const promptManager = new PromptManager(storage);
// Create a prompt
const prompt = await promptManager.createPrompt({
name: "greeting",
content: "Hello, {{name}}! How can I help you today?",
variables: ["name"],
tags: ["greeting", "welcome"],
});
// Render with variables
const rendered = await promptManager.renderPrompt("greeting", {
name: "Alice",
});
// Result: "Hello, Alice! How can I help you today?"
With Prisma (Production)
import { PrismaPromptStorage } from "@phoenix-tekhne/react-sophia";
import { PrismaClient } from "@prisma/client";
const prisma = new PrismaClient();
const storage = new PrismaPromptStorage(prisma);
const promptManager = new PromptManager(storage);
Conversation Management
// Start a conversation
const conversation = await promptManager.createConversation({
title: "Customer Support",
systemPrompt: "You are a helpful customer support assistant.",
});
// Add messages
await promptManager.addMessage(conversation.id, {
role: "user",
content: "I need help with my order.",
});
await promptManager.addMessage(conversation.id, {
role: "assistant",
content: "I'd be happy to help! What's your order number?",
});
// Get conversation history
const messages = await promptManager.getMessages(conversation.id);
IXDF Pattern Utilities
import { createIXDFPrompt, IXDFPattern } from "@phoenix-tekhne/react-sophia";
// Create domain-specific prompts
const coursePrompt = createIXDFPrompt(IXDFPattern.COURSE_DESCRIPTION, {
courseName: "UX Design Fundamentals",
duration: "8 weeks",
level: "Beginner",
});
For AI Agents: Quick Reference
When to Use This Package
| Use Case | Component | Import |
|---|---|---|
| AI prompt management | PromptManager | @phoenix-tekhne/react-sophia |
| Conversation history | Conversation API | @phoenix-tekhne/react-sophia |
| Prompt templates | Template system | @phoenix-tekhne/react-sophia |
| IXDF domain prompts | createIXDFPrompt | @phoenix-tekhne/react-sophia |
Important Rules
DO NOT add standard UI components to this package:
| ❌ Don't Add Here | ✅ Use Instead |
|---|---|
| Buttons, Cards, Dialogs | @phoenix-tekhne/react-tupos |
| Layout, Grid | @phoenix-tekhne/react-poiesis |
| Animations | @phoenix-tekhne/react-kinesis |
| Icons | @phoenix-tekhne/react-graphikos |
Future Scope
This package is reserved for:
- LLM wrappers - ChatGPT, Claude, Gemini integrations
- Intent recognition - Natural language parsers
- Generative UI - AI-generated components
- Vector stores - Embedding storage
Related Packages
@phoenix-tekhne/react-tupos- UI components@phoenix-tekhne/react-poiesis- Layout components
Documentation
See src/prompt-manager/PromptManager-AGENT.md for detailed prompt manager documentation.
License
MIT - Phoenix Inceptions Media LLC
Dependencies
Dependencies
| ID | Version |
|---|---|
| @phoenix-tekhne/icon-service | 0.2.0 |
| @phoenix-tekhne/pattern-core | 0.2.0 |
Development Dependencies
| ID | Version |
|---|---|
| @phoenix-tekhne/tokens | 0.3.0 |
| @types/node | ^25.3.5 |
| @types/react | ^19.2.14 |
| @vitejs/plugin-react | ^4.7.0 |
| typescript | ^5.9.3 |
| vite | ^5.4.21 |
| vite-plugin-dts | ^4.5.4 |
Peer Dependencies
| ID | Version |
|---|---|
| @prisma/client | >=5.0.0 |
| react | >=19.0.0 |
Keywords
design-system
ai
llm
prompt-management
phoenix-tekhne