Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"@objectstack/service-job",
"@objectstack/service-queue",
"@objectstack/service-realtime",
"@objectstack/service-ai",
"@objectstack/service-storage",
"@objectstack/docs",
"create-objectstack",
Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

### Added
- **`@objectstack/service-ai` — Unified AI capability service plugin** — New kernel plugin
providing standardized AI service integration:
- Registers as kernel `'ai'` service conforming to `IAIService` contract
- LLM adapter layer with provider abstraction (`LLMAdapter` interface) and built-in
`MemoryLLMAdapter` for testing/development
- `ToolRegistry` for metadata/business tool registration and execution
- `InMemoryConversationService` implementing `IAIConversationService` for multi-turn
conversation management with message persistence
- REST/SSE route self-registration (`/api/v1/ai/chat`, `/api/v1/ai/chat/stream`,
`/api/v1/ai/complete`, `/api/v1/ai/models`, `/api/v1/ai/conversations`)
- Plugin lifecycle hooks (`ai:ready`, `ai:routes`) for extensibility
- **Expanded `IAIService` contract** — Added streaming (`streamChat`), tool calling protocol
(`AIToolDefinition`, `AIToolCall`, `AIToolResult`, `AIMessageWithTools`,
`AIRequestOptionsWithTools`, `AIStreamEvent`), and conversation management
(`IAIConversationService`, `AIConversation`) to `packages/spec/src/contracts/ai-service.ts`
- **`@objectstack/plugin-setup` — Platform Setup App plugin** — New internal plugin
(`packages/plugins/plugin-setup`) that owns and finalizes the platform Setup App.
Ships four built-in Setup Areas (Administration, Platform, System, AI) as empty
Expand Down
14 changes: 7 additions & 7 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -535,13 +535,13 @@ Objects now declare `namespace: 'sys'` and a short `name` (e.g., `name: 'user'`)
| `IAutomationService` | **P2** | `@objectstack/service-automation` | ✅ Plugin-based DAG flow engine + HTTP API + Client SDK (67 tests) |
| `IWorkflowService` | **P2** | `@objectstack/service-workflow` | State machine + approval processes |
| `IGraphQLService` | **P2** | `@objectstack/service-graphql` | Auto-generated GraphQL from objects |
| `IAIService` | **P2** | `@objectstack/service-ai` | LLM integration (OpenAI/Anthropic/local) |
| `IAIService` | **P2** | `@objectstack/service-ai` | LLM adapter layer, ToolRegistry, conversation management, REST/SSE routes, streaming (52 tests) |
| `IAnalyticsService` | **P3** | `@objectstack/service-analytics` | ✅ Multi-driver analytics with strategy pattern (NativeSQL/ObjectQL/InMemory), CubeRegistry, generateSql (34 tests) |

- [x] `service-automation` — Implement `IAutomationService` with plugin-based DAG flow engine (CRUD/Logic/HTTP nodes, fault edges, parallel branches, cycle detection, safe eval, timeout, versioning), HTTP API CRUD (9 routes), Client SDK (10 methods), execution history with step-level logging
- [ ] `service-workflow` — Implement `IWorkflowService` with state machine runtime
- [ ] `service-graphql` — Implement `IGraphQLService` with auto-schema generation
- [ ] `service-ai` — Implement `IAIService` with multi-provider LLM routing
- [x] `service-ai` — Implement `IAIService` with LLM adapter layer, ToolRegistry, InMemoryConversationService, REST/SSE routes (/api/v1/ai/*), streaming support (streamChat), kernel plugin (52 tests)
- [x] `service-analytics` — Implement full `IAnalyticsService` with multi-driver strategy pattern (NativeSQLStrategy P1, ObjectQLStrategy P2, InMemoryStrategy P3), CubeRegistry with auto-inference from object schemas, generateSql dry-run, kernel plugin lifecycle

---
Expand Down Expand Up @@ -584,7 +584,7 @@ Objects now declare `namespace: 'sys'` and a short `name` (e.g., `name: 'user'`)
- [x] **Phase A+: Dual Transport** (v3.2) — Remote-only mode via `@libsql/client` (libsql://, https://), auto-detection of transport mode, pre-configured client injection, full CRUD/schema/bulk/transaction support in remote mode
- [ ] **Phase B: Edge & Sync** (v3.2) — Embedded replica sync, WASM build for Cloudflare/Deno, offline write queue
- [x] **Phase C: Multi-Tenancy** (v3.3) — Database-per-tenant router with TTL cache, concurrency dedup, lifecycle callbacks
- [ ] **Phase D: Advanced** (v4.0) — Vector search + `IAIService`, FTS5 + `ISearchService`, ~~better-auth adapter~~ (✅ done in plugin-auth)
- [ ] **Phase D: Advanced** (v4.0) — Vector search + `IAIService` (✅ `service-ai` base implemented), FTS5 + `ISearchService`, ~~better-auth adapter~~ (✅ done in plugin-auth)
- [ ] Driver benchmark suite comparing performance across all drivers

### 6.2 Multi-Tenancy
Expand Down Expand Up @@ -644,15 +644,15 @@ Objects now declare `namespace: 'sys'` and a short `name` (e.g., `name: 'user'`)

### 7.1 Core AI Services

- [ ] `service-ai` — Multi-provider LLM service (OpenAI, Anthropic, Gemini, local models)
- [x] `service-ai` — Multi-provider LLM service with adapter pattern, streaming, tool registry, conversation management, REST/SSE routes
- [ ] NLQ (Natural Language Query) runtime — translate natural language to ObjectQL
- [ ] Embedding service for vector search and RAG

### 7.2 Agent Framework

- [ ] Agent runtime — execute AI agents defined in spec schemas
- [ ] Tool registry — connect agents to ObjectQL operations, APIs, and workflows
- [ ] Conversation management — persistent chat with context windows
- [x] Tool registry — connect agents to ObjectQL operations, APIs, and workflows (initial implementation in `service-ai`)
- [x] Conversation management — persistent chat with context windows (initial implementation in `service-ai`)

### 7.3 RAG Pipeline

Expand Down Expand Up @@ -870,7 +870,7 @@ Final polish and advanced features.
| 15 | Feed Service | `IFeedService` | ✅ | `@objectstack/service-feed` | In-memory feed/chatter (comments, reactions, subscriptions) |
| 16 | Search Service | `ISearchService` | ❌ | `@objectstack/service-search` (planned) | Spec only |
| 17 | Notification Service | `INotificationService` | ❌ | `@objectstack/service-notification` (planned) | Spec only |
| 18 | AI Service | `IAIService` | | `@objectstack/service-ai` (planned) | Spec only |
| 18 | AI Service | `IAIService` | | `@objectstack/service-ai` | LLM adapter layer, ToolRegistry, conversation management, REST/SSE routes (52 tests) |
| 19 | Automation Service | `IAutomationService` | ✅ | `@objectstack/service-automation` | DAG engine + HTTP API CRUD + Client SDK + typed returns (67 tests) |
| 20 | Workflow Service | `IWorkflowService` | ❌ | `@objectstack/service-workflow` (planned) | Spec only |
| 21 | GraphQL Service | `IGraphQLService` | ❌ | `@objectstack/service-graphql` (planned) | Spec only |
Expand Down
12 changes: 12 additions & 0 deletions packages/services/service-ai/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# @objectstack/service-ai

## 3.3.1

### Patch Changes

- Initial release of AI Service plugin
- LLM adapter layer with provider abstraction (memory adapter included)
- Conversation management service with in-memory persistence
- Tool registry for metadata/business tool registration
- REST/SSE route self-registration (`/api/v1/ai/*`)
- Kernel plugin registering as `'ai'` service conforming to `IAIService` contract
29 changes: 29 additions & 0 deletions packages/services/service-ai/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "@objectstack/service-ai",
"version": "3.3.1",
"license": "Apache-2.0",
"description": "AI Service for ObjectStack — implements IAIService with LLM adapter layer, conversation management, tool registry, and REST/SSE routes",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/index.cjs"
}
},
"scripts": {
"build": "tsup --config ../../../tsup.config.ts",
"test": "vitest run"
},
"dependencies": {
"@objectstack/core": "workspace:*",
"@objectstack/spec": "workspace:*"
},
"devDependencies": {
"@types/node": "^25.5.0",
"typescript": "^6.0.2",
"vitest": "^4.1.2"
}
}
Loading