@cultured_computer/sight 0.1.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Cultured Computer
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,99 @@
1
+ # Sight
2
+
3
+ A capture and measurement API for production conversational AI. Add the SDK to
4
+ your serving process; Sight records every turn and session in a standard
5
+ trajectory format and computes behavioural measurements on top: the situations
6
+ a deployment handles, voice consistency across turns, uptake, breaks, and
7
+ return behaviour. Capture is out of band, responses are never modified or
8
+ delayed.
9
+
10
+ The SDK is in beta. Interfaces and rollout order may change without notice;
11
+ the record format itself is versioned and stable.
12
+
13
+ ## Install
14
+
15
+ ```bash
16
+ npm install @cultured_computer/sight
17
+ ```
18
+
19
+ Node 18 or later. TypeScript types ship with the package.
20
+
21
+ ## Quickstart
22
+
23
+ ```ts
24
+ import { Sight } from '@cultured_computer/sight'
25
+
26
+ Sight.init({
27
+ apiKey: process.env.SIGHT_API_KEY!,
28
+ deployment: 'my-assistant',
29
+ })
30
+
31
+ Sight.startSession({
32
+ externalId: conversationId,
33
+ externalUserId: userId,
34
+ })
35
+ ```
36
+
37
+ Notes:
38
+
39
+ - `init` runs once at startup. `deployment` identifies the configuration this
40
+ traffic belongs to; all measurement is per deployment.
41
+ - `externalId` keys the session (one conversation). `externalUserId` is a
42
+ stable, pseudonymous user id you supply. Return metrics key on the user id;
43
+ sessions without it still capture, but return behaviour is not computable.
44
+
45
+ ## What lands automatically
46
+
47
+ - Autocapture is on from `init` for calls made through the OpenAI SDK,
48
+ Anthropic SDK, Vercel AI SDK, LangChain, and LangGraph in the process.
49
+ Each adapter no-ops if its target library is not installed. Mercury-2
50
+ reached through the OpenAI SDK with a baseURL override is captured and
51
+ tagged by provider.
52
+ - Plumbing fields populate with no further configuration: model, tokens,
53
+ latency, cost, tool calls, finish reason.
54
+ - Turns are grouped into sessions by the ids you supply; sessions are created
55
+ lazily on first capture.
56
+ - Capture never blocks your LLM path. Send failures log in debug mode and are
57
+ otherwise swallowed.
58
+
59
+ ## Attach outcomes
60
+
61
+ Call these wherever the outcome becomes known; they join back by session id,
62
+ even hours later, from a webhook or CRM callback.
63
+
64
+ ```ts
65
+ // A user reporting a persona break.
66
+ await Sight.flagPersonaBreak({
67
+ sessionExternalId: sessionId,
68
+ note: 'sounded robotic',
69
+ })
70
+
71
+ // Your own downstream outcome: a resolved ticket, a rating, a conversion.
72
+ await Sight.emitOutcomeEvent({
73
+ sessionExternalId: sessionId,
74
+ kind: 'ticket_resolved',
75
+ detail: { ticketId: 'ZD-88213' },
76
+ })
77
+ ```
78
+
79
+ ## Scope
80
+
81
+ Sight is a measurement system: it reports what a deployment did. It does not
82
+ modify responses, and it does not estimate what a different response would
83
+ have produced. Counterfactual evaluation requires logged propensities or a
84
+ live experiment.
85
+
86
+ ## Docs
87
+
88
+ - [Get started](https://field.cultured.computer/sight/docs/get-started):
89
+ install, initialise, verify capture.
90
+ - [Worked examples](https://field.cultured.computer/sight/docs/examples):
91
+ runnable snippets, each with what it lands in the record.
92
+ - [SDK reference](https://field.cultured.computer/sight/docs/sdk-reference):
93
+ the full method surface.
94
+ - [Status](https://field.cultured.computer/sight/docs/where-it-stands): what
95
+ is available now versus in beta.
96
+
97
+ ## License
98
+
99
+ MIT (c) Cultured Computer