Repository navigation
docs: add new video for flows and integrate CLI into crews docs - #1580
Merged
Merged
Conversation
Signed-off-by: Tyler Slaton <[email protected]>
tylerslaton
requested review from
ataibarkai,
mme,
ranst91 and
suhasdeshpande
as code owners
March 27, 2025 15:31
⏭️ Changeset Not RequiredLatest commit: 768247a No changes in this PR affected the Changeset is not required for this PR. |
Contributor
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Contributor
PreviewsCommit SHA: 9ca9474
|
1 of 3 tasks
tylerslaton
added a commit
that referenced
this pull request
Oct 2, 2026
Try it: `pnpm --filter demo exec next dev --turbopack -p 3471`, then open `http://localhost:3471/learning` and click through a deal. This PR adds Trajectory capture to CopilotKit. `@copilotkit/learning` records browser activity (clicks, form edits, page changes, and network requests) as AG-UI `CUSTOM` events. With CopilotKit, Core authenticates through Runtime and sends the events to the Intelligence Realtime Gateway. Apps that do not pass `learning` behave exactly as before. This PR now also contains #7566 (Runtime authentication and Gateway delivery), which was stacked on it. ## What does this PR do? - **`@copilotkit/learning`** (new, about 5.8 KB gzip): the collector. Capture follows the approved October 9 self-hosted scope: maximum resolution, with no filtering or categorization. Two kinds of values never leave the browser: password values and credential headers become `[redacted]`. - **Runtime:** a `trajectory/connect` route (REST and single endpoint). It resolves the user with `identifyUser` and requests a single-use join token from Intelligence. The project key stays on the server. - **Core:** - A `learning` config, plus `startTrajectory()`, `stopTrajectory()`, `emitTrajectoryEvent()`, and `registerOpenThread()`. - Batches go over Phoenix with sequence numbers, receipts, the Gateway limits, and `dropped` counts. A failed batch is never resent. - A custom `sink` keeps the standalone mode, which also adds Thread, message, and tool context. - **React:** a `learning` prop on `CopilotKitProvider`, with automatic or manual start and cleanup on unmount. The `data-tool-call-id` wrapper renders only while capture is active. - **Demo and docs:** the `/learning` pages in `examples/v2/react/demo`, and three Intelligence docs pages. ## Related PRs and Issues - Linear: [PE-471](https://linear.app/copilotkit/issue/PE-471), [PE-506](https://linear.app/copilotkit/issue/PE-506) - Includes #7566. Backend: CopilotKit/Intelligence#1569 (ingestion) and #1580 (read APIs). ## Checklist - [ ] I have read the [Contribution Guide](https://github.com/copilotkit/copilotkit/blob/master/CONTRIBUTING.md) - [x] If the PR changes or adds functionality, I have updated the relevant documentation - [ ] "Allow edits by maintainers" is checked (lets us help iterate on your PR directly — faster turnaround for everyone) ## Changes in the latest push - Merged #7566 and `main`. - **Fix:** with `"auto"` transport (the default), capture started before `/info` finished and sent a single-endpoint request to REST runtimes, which failed. Core now waits for transport detection. - **CodeRabbit:** - Password values and credential headers are redacted. - `data-copilotkit-ignore` now works through shadow roots. - Click text is capped at 1,000 characters, so a large container cannot exceed the 16 KiB event limit. - Reopening an in-flight XHR no longer reports the old request. ## Existing users (PE-506) With no `learning` prop or config: - No listeners, patches, timers, sockets, or Core or agent subscriptions are installed. The tests `installs nothing without the learning prop` and `warns and captures nothing without the learning option` cover this. - The tool-call DOM is unchanged, because the wrapper renders only during capture. - Runtime routes are unchanged. `trajectory/connect` is new and returns clear errors outside Intelligence. - `fetch`, XHR, and streaming responses are untouched. ## Testing Commands run (Windows, local): - `pnpm nx run-many --targets=test,check-types --projects=@copilotkit/learning,@copilotkit/core,@copilotkit/react-core,@copilotkit/runtime`: all pass. learning 77 tests, core 1,140, react-core 1,786 (plus 54 node checks), runtime 2,803. Types pass in all four. - `node packages/learning/scripts/check-size.mjs`: 5,783 bytes gzip (budget 6,144). - `oxfmt` and `oxlint` on the changed files: 0 errors. - Skipped: the local lefthook hooks (heavy, and flaky on this machine). CI runs the full checks. Manual test: 1. Run the demo, then open `/learning`. 2. Click **Open** on a deal, send a chat message, and click **Approve** in the approval prompt. 3. Open **Captured events**. Check the click, page, network, and agent events. How this PR makes testing easy: unit tests in all four packages, a real-Phoenix boundary test in Core, and the demo pages. ## Risk / rollback Low for existing users, because nothing runs without `learning`. Core now bundles the collector, so `@copilotkit/core` grows. Rollback: revert this PR. Open items, not in this PR: - In the authenticated mode, events carry no Thread context yet. The backend already supports Thread links. This was deferred on purpose, and the decision is tracked in PE-504. - No real round trip against Intelligence Dev yet. That is PE-507. ## Public API change **Before** ```tsx <CopilotKitProvider runtimeUrl="/api/copilotkit">{children}</CopilotKitProvider> ``` **After** ```tsx <CopilotKitProvider runtimeUrl="/api/copilotkit" learning={{ trajectoryId }}> {children} </CopilotKitProvider>; // Or start capture yourself: const result = await copilotkit.startTrajectory(); // { status: "started", trajectoryId } copilotkit.emitTrajectoryEvent("deal.approved", { dealId: "deal-1" }); copilotkit.stopTrajectory(); ``` 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added learning and interaction capture for page navigation, clicks, form input, network activity, agent messages, and tool interactions, with credential redaction. * Added controls to start and stop trajectories, send custom events, filter captured data, and deliver event batches to custom endpoints. * Added authenticated trajectory capture through the CopilotKit provider. * Added a demo for reviewing captured events and trying deal approval flows. * **Documentation** * Added guides for interaction capture, standalone collection, captured data, and setup. * **Bug Fixes** * Preserved message and tool-call identifiers in custom chat layouts for interaction attribution. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.