diff --git a/CHANGELOG.md b/CHANGELOG.md
index bed65f2a..8c012374 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
+## [2.5.1] - 2025-12-15
+
+### Fixed
+
+- Backwards compatibility for `message_ids` field in documents to handle legacy tuple format
+
## [2.5.0] - 2025-12-03
### Added
diff --git a/README.md b/README.md
index 7ed3cae8..18417149 100644
--- a/README.md
+++ b/README.md
@@ -8,7 +8,7 @@
---
-
+
[](https://pypi.org/project/honcho-ai/)
[](https://npmjs.org/package/@honcho-ai/sdk)
[](https://discord.gg/plasticlabs)
diff --git a/docs/changelog/compatibility-guide.mdx b/docs/changelog/compatibility-guide.mdx
index 61b6a4c4..98490721 100644
--- a/docs/changelog/compatibility-guide.mdx
+++ b/docs/changelog/compatibility-guide.mdx
@@ -8,7 +8,7 @@ This guide helps you understand which versions of Honcho's API are compatible wi
## Version Compatibility
-### Honcho API v2.5.0 (Current)
+### Honcho API v2.5.1 (Current)
@@ -34,7 +34,8 @@ This guide helps you understand which versions of Honcho's API are compatible wi
| Honcho API Version | TypeScript SDK | Python SDK |
|-------------------|---------------|------------|
-| v2.5.0 (Current) | v1.6.0 | v1.6.0 |
+| v2.5.1 (Current) | v1.6.0 | v1.6.0 |
+| v2.5.0 | v1.6.0 | v1.6.0 |
| v2.4.3 | v1.5.0 | v1.5.0 |
| v2.4.2 | v1.5.0 | v1.5.0 |
| v2.4.1 | v1.5.0 | v1.5.0 |
diff --git a/docs/changelog/introduction.mdx b/docs/changelog/introduction.mdx
index b3eab09d..09c15174 100644
--- a/docs/changelog/introduction.mdx
+++ b/docs/changelog/introduction.mdx
@@ -27,7 +27,13 @@ Welcome to the Honcho changelog! This section documents all notable changes to t
### Honcho API and SDK Changelogs
-
+
+ ### Fixed
+
+ - Backwards compatibility for `message_ids` field in documents to handle legacy tuple format
+
+
+
### Added
- Message level configurations
diff --git a/docs/docs.json b/docs/docs.json
index da07fa4d..0999a428 100644
--- a/docs/docs.json
+++ b/docs/docs.json
@@ -2,6 +2,12 @@
"$schema": "https://mintlify.com/docs.json",
"theme": "mint",
"name": "Honcho",
+ "redirects": [
+ {
+ "source": "/",
+ "destination": "/v2/documentation/introduction/overview"
+ }
+ ],
"colors": {
"primary": "#66AAFF",
"dark": "#151E27",
@@ -19,7 +25,7 @@
"navigation": {
"versions": [
{
- "version": "v2.5.0",
+ "version": "v2.5.1",
"api": {
"openapi": [
"openapi.json"
diff --git a/docs/images/app-screenshots/api-playground.png b/docs/images/app-screenshots/api-playground.png
index 3a3c4c5f..d8d73811 100644
Binary files a/docs/images/app-screenshots/api-playground.png and b/docs/images/app-screenshots/api-playground.png differ
diff --git a/docs/v2.6.0-alpha/api-reference/endpoint/keys/create-key.mdx b/docs/v2.6.0-alpha/api-reference/endpoint/keys/create-key.mdx
index 41b759f7..eb133652 100644
--- a/docs/v2.6.0-alpha/api-reference/endpoint/keys/create-key.mdx
+++ b/docs/v2.6.0-alpha/api-reference/endpoint/keys/create-key.mdx
@@ -1,3 +1,3 @@
---
-openapi: post /v2/keys
+openapi: post /v2.6.0-alpha/keys
---
diff --git a/docs/v2.6.0-alpha/api-reference/endpoint/messages/create-messages-for-session.mdx b/docs/v2.6.0-alpha/api-reference/endpoint/messages/create-messages-for-session.mdx
index 19e9c9cb..59f2a1ad 100644
--- a/docs/v2.6.0-alpha/api-reference/endpoint/messages/create-messages-for-session.mdx
+++ b/docs/v2.6.0-alpha/api-reference/endpoint/messages/create-messages-for-session.mdx
@@ -1,3 +1,3 @@
---
-openapi: post /v2/workspaces/{workspace_id}/sessions/{session_id}/messages/
+openapi: post /v2.6.0-alpha/workspaces/{workspace_id}/sessions/{session_id}/messages/
---
diff --git a/docs/v2.6.0-alpha/api-reference/endpoint/messages/create-messages-with-file.mdx b/docs/v2.6.0-alpha/api-reference/endpoint/messages/create-messages-with-file.mdx
index 55ca55a8..f87b8243 100644
--- a/docs/v2.6.0-alpha/api-reference/endpoint/messages/create-messages-with-file.mdx
+++ b/docs/v2.6.0-alpha/api-reference/endpoint/messages/create-messages-with-file.mdx
@@ -1,3 +1,3 @@
---
-openapi: post /v2/workspaces/{workspace_id}/sessions/{session_id}/messages/upload
+openapi: post /v2.6.0-alpha/workspaces/{workspace_id}/sessions/{session_id}/messages/upload
---
diff --git a/docs/v2.6.0-alpha/api-reference/endpoint/messages/get-message.mdx b/docs/v2.6.0-alpha/api-reference/endpoint/messages/get-message.mdx
index 53765daa..db9c62ef 100644
--- a/docs/v2.6.0-alpha/api-reference/endpoint/messages/get-message.mdx
+++ b/docs/v2.6.0-alpha/api-reference/endpoint/messages/get-message.mdx
@@ -1,3 +1,3 @@
---
-openapi: get /v2/workspaces/{workspace_id}/sessions/{session_id}/messages/{message_id}
+openapi: get /v2.6.0-alpha/workspaces/{workspace_id}/sessions/{session_id}/messages/{message_id}
---
diff --git a/docs/v2.6.0-alpha/api-reference/endpoint/messages/get-messages.mdx b/docs/v2.6.0-alpha/api-reference/endpoint/messages/get-messages.mdx
index 612c7aab..eb5b5097 100644
--- a/docs/v2.6.0-alpha/api-reference/endpoint/messages/get-messages.mdx
+++ b/docs/v2.6.0-alpha/api-reference/endpoint/messages/get-messages.mdx
@@ -1,3 +1,3 @@
---
-openapi: post /v2/workspaces/{workspace_id}/sessions/{session_id}/messages/list
+openapi: post /v2.6.0-alpha/workspaces/{workspace_id}/sessions/{session_id}/messages/list
---
diff --git a/docs/v2.6.0-alpha/api-reference/endpoint/messages/update-message.mdx b/docs/v2.6.0-alpha/api-reference/endpoint/messages/update-message.mdx
index 77a296b2..3cb2db81 100644
--- a/docs/v2.6.0-alpha/api-reference/endpoint/messages/update-message.mdx
+++ b/docs/v2.6.0-alpha/api-reference/endpoint/messages/update-message.mdx
@@ -1,3 +1,3 @@
---
-openapi: put /v2/workspaces/{workspace_id}/sessions/{session_id}/messages/{message_id}
+openapi: put /v2.6.0-alpha/workspaces/{workspace_id}/sessions/{session_id}/messages/{message_id}
---
diff --git a/docs/v2.6.0-alpha/api-reference/endpoint/observations/create-observations.mdx b/docs/v2.6.0-alpha/api-reference/endpoint/observations/create-observations.mdx
index 1aafec44..569e7190 100644
--- a/docs/v2.6.0-alpha/api-reference/endpoint/observations/create-observations.mdx
+++ b/docs/v2.6.0-alpha/api-reference/endpoint/observations/create-observations.mdx
@@ -1,3 +1,3 @@
---
-openapi: post /v2/workspaces/{workspace_id}/observations
+openapi: post /v2.6.0-alpha/workspaces/{workspace_id}/observations
---
diff --git a/docs/v2.6.0-alpha/api-reference/endpoint/observations/delete-observation.mdx b/docs/v2.6.0-alpha/api-reference/endpoint/observations/delete-observation.mdx
index 172ef679..69c9ddd3 100644
--- a/docs/v2.6.0-alpha/api-reference/endpoint/observations/delete-observation.mdx
+++ b/docs/v2.6.0-alpha/api-reference/endpoint/observations/delete-observation.mdx
@@ -1,3 +1,3 @@
---
-openapi: delete /v2/workspaces/{workspace_id}/observations/{observation_id}
+openapi: delete /v2.6.0-alpha/workspaces/{workspace_id}/observations/{observation_id}
---
diff --git a/docs/v2.6.0-alpha/api-reference/endpoint/observations/list-observations.mdx b/docs/v2.6.0-alpha/api-reference/endpoint/observations/list-observations.mdx
index 3063a96e..1c4bef72 100644
--- a/docs/v2.6.0-alpha/api-reference/endpoint/observations/list-observations.mdx
+++ b/docs/v2.6.0-alpha/api-reference/endpoint/observations/list-observations.mdx
@@ -1,3 +1,3 @@
---
-openapi: post /v2/workspaces/{workspace_id}/observations/list
+openapi: post /v2.6.0-alpha/workspaces/{workspace_id}/observations/list
---
diff --git a/docs/v2.6.0-alpha/api-reference/endpoint/observations/query-observations.mdx b/docs/v2.6.0-alpha/api-reference/endpoint/observations/query-observations.mdx
index d5d15a14..00c5c6f8 100644
--- a/docs/v2.6.0-alpha/api-reference/endpoint/observations/query-observations.mdx
+++ b/docs/v2.6.0-alpha/api-reference/endpoint/observations/query-observations.mdx
@@ -1,3 +1,3 @@
---
-openapi: post /v2/workspaces/{workspace_id}/observations/query
+openapi: post /v2.6.0-alpha/workspaces/{workspace_id}/observations/query
---
diff --git a/docs/v2.6.0-alpha/api-reference/endpoint/peers/chat.mdx b/docs/v2.6.0-alpha/api-reference/endpoint/peers/chat.mdx
index 8fe3cd18..b7f8047e 100644
--- a/docs/v2.6.0-alpha/api-reference/endpoint/peers/chat.mdx
+++ b/docs/v2.6.0-alpha/api-reference/endpoint/peers/chat.mdx
@@ -1,3 +1,3 @@
---
-openapi: post /v2/workspaces/{workspace_id}/peers/{peer_id}/chat
+openapi: post /v2.6.0-alpha/workspaces/{workspace_id}/peers/{peer_id}/chat
---
diff --git a/docs/v2.6.0-alpha/api-reference/endpoint/peers/get-or-create-peer.mdx b/docs/v2.6.0-alpha/api-reference/endpoint/peers/get-or-create-peer.mdx
index 724d8100..9964c2aa 100644
--- a/docs/v2.6.0-alpha/api-reference/endpoint/peers/get-or-create-peer.mdx
+++ b/docs/v2.6.0-alpha/api-reference/endpoint/peers/get-or-create-peer.mdx
@@ -1,3 +1,3 @@
---
-openapi: post /v2/workspaces/{workspace_id}/peers
+openapi: post /v2.6.0-alpha/workspaces/{workspace_id}/peers
---
diff --git a/docs/v2.6.0-alpha/api-reference/endpoint/peers/get-peer-card.mdx b/docs/v2.6.0-alpha/api-reference/endpoint/peers/get-peer-card.mdx
index ef12d719..5ced4d68 100644
--- a/docs/v2.6.0-alpha/api-reference/endpoint/peers/get-peer-card.mdx
+++ b/docs/v2.6.0-alpha/api-reference/endpoint/peers/get-peer-card.mdx
@@ -1,3 +1,3 @@
---
-openapi: get /v2/workspaces/{workspace_id}/peers/{peer_id}/card
+openapi: get /v2.6.0-alpha/workspaces/{workspace_id}/peers/{peer_id}/card
---
diff --git a/docs/v2.6.0-alpha/api-reference/endpoint/peers/get-peer-context.mdx b/docs/v2.6.0-alpha/api-reference/endpoint/peers/get-peer-context.mdx
index ed6563c2..3e2c9508 100644
--- a/docs/v2.6.0-alpha/api-reference/endpoint/peers/get-peer-context.mdx
+++ b/docs/v2.6.0-alpha/api-reference/endpoint/peers/get-peer-context.mdx
@@ -1,3 +1,3 @@
---
-openapi: get /v2/workspaces/{workspace_id}/peers/{peer_id}/context
+openapi: get /v2.6.0-alpha/workspaces/{workspace_id}/peers/{peer_id}/context
---
diff --git a/docs/v2.6.0-alpha/api-reference/endpoint/peers/get-peers.mdx b/docs/v2.6.0-alpha/api-reference/endpoint/peers/get-peers.mdx
index 954e89b2..7b885554 100644
--- a/docs/v2.6.0-alpha/api-reference/endpoint/peers/get-peers.mdx
+++ b/docs/v2.6.0-alpha/api-reference/endpoint/peers/get-peers.mdx
@@ -1,3 +1,3 @@
---
-openapi: post /v2/workspaces/{workspace_id}/peers/list
+openapi: post /v2.6.0-alpha/workspaces/{workspace_id}/peers/list
---
diff --git a/docs/v2.6.0-alpha/api-reference/endpoint/peers/get-sessions-for-peer.mdx b/docs/v2.6.0-alpha/api-reference/endpoint/peers/get-sessions-for-peer.mdx
index 8b33a832..93ff788d 100644
--- a/docs/v2.6.0-alpha/api-reference/endpoint/peers/get-sessions-for-peer.mdx
+++ b/docs/v2.6.0-alpha/api-reference/endpoint/peers/get-sessions-for-peer.mdx
@@ -1,3 +1,3 @@
---
-openapi: post /v2/workspaces/{workspace_id}/peers/{peer_id}/sessions
+openapi: post /v2.6.0-alpha/workspaces/{workspace_id}/peers/{peer_id}/sessions
---
diff --git a/docs/v2.6.0-alpha/api-reference/endpoint/peers/get-working-representation.mdx b/docs/v2.6.0-alpha/api-reference/endpoint/peers/get-working-representation.mdx
index b712a032..b77e17de 100644
--- a/docs/v2.6.0-alpha/api-reference/endpoint/peers/get-working-representation.mdx
+++ b/docs/v2.6.0-alpha/api-reference/endpoint/peers/get-working-representation.mdx
@@ -1,3 +1,3 @@
---
-openapi: post /v2/workspaces/{workspace_id}/peers/{peer_id}/representation
+openapi: post /v2.6.0-alpha/workspaces/{workspace_id}/peers/{peer_id}/representation
---
diff --git a/docs/v2.6.0-alpha/api-reference/endpoint/peers/search-peer.mdx b/docs/v2.6.0-alpha/api-reference/endpoint/peers/search-peer.mdx
index c8c25451..0053845c 100644
--- a/docs/v2.6.0-alpha/api-reference/endpoint/peers/search-peer.mdx
+++ b/docs/v2.6.0-alpha/api-reference/endpoint/peers/search-peer.mdx
@@ -1,3 +1,3 @@
---
-openapi: post /v2/workspaces/{workspace_id}/peers/{peer_id}/search
+openapi: post /v2.6.0-alpha/workspaces/{workspace_id}/peers/{peer_id}/search
---
diff --git a/docs/v2.6.0-alpha/api-reference/endpoint/peers/set-peer-card.mdx b/docs/v2.6.0-alpha/api-reference/endpoint/peers/set-peer-card.mdx
index c209ca8c..ab484cf3 100644
--- a/docs/v2.6.0-alpha/api-reference/endpoint/peers/set-peer-card.mdx
+++ b/docs/v2.6.0-alpha/api-reference/endpoint/peers/set-peer-card.mdx
@@ -1,3 +1,3 @@
---
-openapi: put /v2/workspaces/{workspace_id}/peers/{peer_id}/card
+openapi: put /v2.6.0-alpha/workspaces/{workspace_id}/peers/{peer_id}/card
---
diff --git a/docs/v2.6.0-alpha/api-reference/endpoint/peers/update-peer.mdx b/docs/v2.6.0-alpha/api-reference/endpoint/peers/update-peer.mdx
index 91b6da61..7bc1b2a5 100644
--- a/docs/v2.6.0-alpha/api-reference/endpoint/peers/update-peer.mdx
+++ b/docs/v2.6.0-alpha/api-reference/endpoint/peers/update-peer.mdx
@@ -1,3 +1,3 @@
---
-openapi: put /v2/workspaces/{workspace_id}/peers/{peer_id}
+openapi: put /v2.6.0-alpha/workspaces/{workspace_id}/peers/{peer_id}
---
diff --git a/docs/v2.6.0-alpha/api-reference/endpoint/sessions/add-peers-to-session.mdx b/docs/v2.6.0-alpha/api-reference/endpoint/sessions/add-peers-to-session.mdx
index e73ece96..e04fe792 100644
--- a/docs/v2.6.0-alpha/api-reference/endpoint/sessions/add-peers-to-session.mdx
+++ b/docs/v2.6.0-alpha/api-reference/endpoint/sessions/add-peers-to-session.mdx
@@ -1,3 +1,3 @@
---
-openapi: post /v2/workspaces/{workspace_id}/sessions/{session_id}/peers
+openapi: post /v2.6.0-alpha/workspaces/{workspace_id}/sessions/{session_id}/peers
---
diff --git a/docs/v2.6.0-alpha/api-reference/endpoint/sessions/clone-session.mdx b/docs/v2.6.0-alpha/api-reference/endpoint/sessions/clone-session.mdx
index e06f19a1..016cb1de 100644
--- a/docs/v2.6.0-alpha/api-reference/endpoint/sessions/clone-session.mdx
+++ b/docs/v2.6.0-alpha/api-reference/endpoint/sessions/clone-session.mdx
@@ -1,3 +1,3 @@
---
-openapi: get /v2/workspaces/{workspace_id}/sessions/{session_id}/clone
+openapi: get /v2.6.0-alpha/workspaces/{workspace_id}/sessions/{session_id}/clone
---
diff --git a/docs/v2.6.0-alpha/api-reference/endpoint/sessions/delete-session.mdx b/docs/v2.6.0-alpha/api-reference/endpoint/sessions/delete-session.mdx
index 2d1252fb..c4348148 100644
--- a/docs/v2.6.0-alpha/api-reference/endpoint/sessions/delete-session.mdx
+++ b/docs/v2.6.0-alpha/api-reference/endpoint/sessions/delete-session.mdx
@@ -1,3 +1,3 @@
---
-openapi: delete /v2/workspaces/{workspace_id}/sessions/{session_id}
+openapi: delete /v2.6.0-alpha/workspaces/{workspace_id}/sessions/{session_id}
---
diff --git a/docs/v2.6.0-alpha/api-reference/endpoint/sessions/get-or-create-session.mdx b/docs/v2.6.0-alpha/api-reference/endpoint/sessions/get-or-create-session.mdx
index c013803e..b3aab9d8 100644
--- a/docs/v2.6.0-alpha/api-reference/endpoint/sessions/get-or-create-session.mdx
+++ b/docs/v2.6.0-alpha/api-reference/endpoint/sessions/get-or-create-session.mdx
@@ -1,3 +1,3 @@
---
-openapi: post /v2/workspaces/{workspace_id}/sessions
+openapi: post /v2.6.0-alpha/workspaces/{workspace_id}/sessions
---
diff --git a/docs/v2.6.0-alpha/api-reference/endpoint/sessions/get-peer-config.mdx b/docs/v2.6.0-alpha/api-reference/endpoint/sessions/get-peer-config.mdx
index e84f5cea..33438219 100644
--- a/docs/v2.6.0-alpha/api-reference/endpoint/sessions/get-peer-config.mdx
+++ b/docs/v2.6.0-alpha/api-reference/endpoint/sessions/get-peer-config.mdx
@@ -1,3 +1,3 @@
---
-openapi: get /v2/workspaces/{workspace_id}/sessions/{session_id}/peers/{peer_id}/config
+openapi: get /v2.6.0-alpha/workspaces/{workspace_id}/sessions/{session_id}/peers/{peer_id}/config
---
diff --git a/docs/v2.6.0-alpha/api-reference/endpoint/sessions/get-session-context.mdx b/docs/v2.6.0-alpha/api-reference/endpoint/sessions/get-session-context.mdx
index c8c1bdd1..4e0444f5 100644
--- a/docs/v2.6.0-alpha/api-reference/endpoint/sessions/get-session-context.mdx
+++ b/docs/v2.6.0-alpha/api-reference/endpoint/sessions/get-session-context.mdx
@@ -1,3 +1,3 @@
---
-openapi: get /v2/workspaces/{workspace_id}/sessions/{session_id}/context
+openapi: get /v2.6.0-alpha/workspaces/{workspace_id}/sessions/{session_id}/context
---
diff --git a/docs/v2.6.0-alpha/api-reference/endpoint/sessions/get-session-peers.mdx b/docs/v2.6.0-alpha/api-reference/endpoint/sessions/get-session-peers.mdx
index 18beb221..fa85d340 100644
--- a/docs/v2.6.0-alpha/api-reference/endpoint/sessions/get-session-peers.mdx
+++ b/docs/v2.6.0-alpha/api-reference/endpoint/sessions/get-session-peers.mdx
@@ -1,3 +1,3 @@
---
-openapi: get /v2/workspaces/{workspace_id}/sessions/{session_id}/peers
+openapi: get /v2.6.0-alpha/workspaces/{workspace_id}/sessions/{session_id}/peers
---
diff --git a/docs/v2.6.0-alpha/api-reference/endpoint/sessions/get-session-summaries.mdx b/docs/v2.6.0-alpha/api-reference/endpoint/sessions/get-session-summaries.mdx
index 9ae150bc..77208467 100644
--- a/docs/v2.6.0-alpha/api-reference/endpoint/sessions/get-session-summaries.mdx
+++ b/docs/v2.6.0-alpha/api-reference/endpoint/sessions/get-session-summaries.mdx
@@ -1,3 +1,3 @@
---
-openapi: get /v2/workspaces/{workspace_id}/sessions/{session_id}/summaries
+openapi: get /v2.6.0-alpha/workspaces/{workspace_id}/sessions/{session_id}/summaries
---
diff --git a/docs/v2.6.0-alpha/api-reference/endpoint/sessions/get-sessions.mdx b/docs/v2.6.0-alpha/api-reference/endpoint/sessions/get-sessions.mdx
index 75dc7eba..671f02b3 100644
--- a/docs/v2.6.0-alpha/api-reference/endpoint/sessions/get-sessions.mdx
+++ b/docs/v2.6.0-alpha/api-reference/endpoint/sessions/get-sessions.mdx
@@ -1,3 +1,3 @@
---
-openapi: post /v2/workspaces/{workspace_id}/sessions/list
+openapi: post /v2.6.0-alpha/workspaces/{workspace_id}/sessions/list
---
diff --git a/docs/v2.6.0-alpha/api-reference/endpoint/sessions/remove-peers-from-session.mdx b/docs/v2.6.0-alpha/api-reference/endpoint/sessions/remove-peers-from-session.mdx
index 31acf6bf..c08aa744 100644
--- a/docs/v2.6.0-alpha/api-reference/endpoint/sessions/remove-peers-from-session.mdx
+++ b/docs/v2.6.0-alpha/api-reference/endpoint/sessions/remove-peers-from-session.mdx
@@ -1,3 +1,3 @@
---
-openapi: delete /v2/workspaces/{workspace_id}/sessions/{session_id}/peers
+openapi: delete /v2.6.0-alpha/workspaces/{workspace_id}/sessions/{session_id}/peers
---
diff --git a/docs/v2.6.0-alpha/api-reference/endpoint/sessions/search-session.mdx b/docs/v2.6.0-alpha/api-reference/endpoint/sessions/search-session.mdx
index 308138d5..b246354d 100644
--- a/docs/v2.6.0-alpha/api-reference/endpoint/sessions/search-session.mdx
+++ b/docs/v2.6.0-alpha/api-reference/endpoint/sessions/search-session.mdx
@@ -1,3 +1,3 @@
---
-openapi: post /v2/workspaces/{workspace_id}/sessions/{session_id}/search
+openapi: post /v2.6.0-alpha/workspaces/{workspace_id}/sessions/{session_id}/search
---
diff --git a/docs/v2.6.0-alpha/api-reference/endpoint/sessions/set-peer-config.mdx b/docs/v2.6.0-alpha/api-reference/endpoint/sessions/set-peer-config.mdx
index 6e6ee462..39b6199b 100644
--- a/docs/v2.6.0-alpha/api-reference/endpoint/sessions/set-peer-config.mdx
+++ b/docs/v2.6.0-alpha/api-reference/endpoint/sessions/set-peer-config.mdx
@@ -1,3 +1,3 @@
---
-openapi: post /v2/workspaces/{workspace_id}/sessions/{session_id}/peers/{peer_id}/config
+openapi: post /v2.6.0-alpha/workspaces/{workspace_id}/sessions/{session_id}/peers/{peer_id}/config
---
diff --git a/docs/v2.6.0-alpha/api-reference/endpoint/sessions/set-session-peers.mdx b/docs/v2.6.0-alpha/api-reference/endpoint/sessions/set-session-peers.mdx
index 475db5b9..aa8b3f8d 100644
--- a/docs/v2.6.0-alpha/api-reference/endpoint/sessions/set-session-peers.mdx
+++ b/docs/v2.6.0-alpha/api-reference/endpoint/sessions/set-session-peers.mdx
@@ -1,3 +1,3 @@
---
-openapi: put /v2/workspaces/{workspace_id}/sessions/{session_id}/peers
+openapi: put /v2.6.0-alpha/workspaces/{workspace_id}/sessions/{session_id}/peers
---
diff --git a/docs/v2.6.0-alpha/api-reference/endpoint/sessions/update-session.mdx b/docs/v2.6.0-alpha/api-reference/endpoint/sessions/update-session.mdx
index 94d14d1b..d2f51dd3 100644
--- a/docs/v2.6.0-alpha/api-reference/endpoint/sessions/update-session.mdx
+++ b/docs/v2.6.0-alpha/api-reference/endpoint/sessions/update-session.mdx
@@ -1,3 +1,3 @@
---
-openapi: put /v2/workspaces/{workspace_id}/sessions/{session_id}
+openapi: put /v2.6.0-alpha/workspaces/{workspace_id}/sessions/{session_id}
---
diff --git a/docs/v2.6.0-alpha/api-reference/endpoint/webhooks/delete-webhook-endpoint.mdx b/docs/v2.6.0-alpha/api-reference/endpoint/webhooks/delete-webhook-endpoint.mdx
index 03663d39..44a48097 100644
--- a/docs/v2.6.0-alpha/api-reference/endpoint/webhooks/delete-webhook-endpoint.mdx
+++ b/docs/v2.6.0-alpha/api-reference/endpoint/webhooks/delete-webhook-endpoint.mdx
@@ -1,3 +1,3 @@
---
-openapi: delete /v2/workspaces/{workspace_id}/webhooks/{endpoint_id}
+openapi: delete /v2.6.0-alpha/workspaces/{workspace_id}/webhooks/{endpoint_id}
---
diff --git a/docs/v2.6.0-alpha/api-reference/endpoint/webhooks/get-or-create-webhook-endpoint.mdx b/docs/v2.6.0-alpha/api-reference/endpoint/webhooks/get-or-create-webhook-endpoint.mdx
index 3eca8afb..3303c4dd 100644
--- a/docs/v2.6.0-alpha/api-reference/endpoint/webhooks/get-or-create-webhook-endpoint.mdx
+++ b/docs/v2.6.0-alpha/api-reference/endpoint/webhooks/get-or-create-webhook-endpoint.mdx
@@ -1,3 +1,3 @@
---
-openapi: post /v2/workspaces/{workspace_id}/webhooks
+openapi: post /v2.6.0-alpha/workspaces/{workspace_id}/webhooks
---
diff --git a/docs/v2.6.0-alpha/api-reference/endpoint/webhooks/list-webhook-endpoints.mdx b/docs/v2.6.0-alpha/api-reference/endpoint/webhooks/list-webhook-endpoints.mdx
index a205df80..4f0288c2 100644
--- a/docs/v2.6.0-alpha/api-reference/endpoint/webhooks/list-webhook-endpoints.mdx
+++ b/docs/v2.6.0-alpha/api-reference/endpoint/webhooks/list-webhook-endpoints.mdx
@@ -1,3 +1,3 @@
---
-openapi: get /v2/workspaces/{workspace_id}/webhooks
+openapi: get /v2.6.0-alpha/workspaces/{workspace_id}/webhooks
---
diff --git a/docs/v2.6.0-alpha/api-reference/endpoint/webhooks/test-emit.mdx b/docs/v2.6.0-alpha/api-reference/endpoint/webhooks/test-emit.mdx
index 8c2cbddd..e12c94f3 100644
--- a/docs/v2.6.0-alpha/api-reference/endpoint/webhooks/test-emit.mdx
+++ b/docs/v2.6.0-alpha/api-reference/endpoint/webhooks/test-emit.mdx
@@ -1,3 +1,3 @@
---
-openapi: get /v2/workspaces/{workspace_id}/webhooks/test
+openapi: get /v2.6.0-alpha/workspaces/{workspace_id}/webhooks/test
---
diff --git a/docs/v2.6.0-alpha/api-reference/endpoint/workspaces/delete-workspace.mdx b/docs/v2.6.0-alpha/api-reference/endpoint/workspaces/delete-workspace.mdx
index f8eb6168..01d7774f 100644
--- a/docs/v2.6.0-alpha/api-reference/endpoint/workspaces/delete-workspace.mdx
+++ b/docs/v2.6.0-alpha/api-reference/endpoint/workspaces/delete-workspace.mdx
@@ -1,3 +1,3 @@
---
-openapi: delete /v2/workspaces/{workspace_id}
+openapi: delete /v2.6.0-alpha/workspaces/{workspace_id}
---
diff --git a/docs/v2.6.0-alpha/api-reference/endpoint/workspaces/get-all-workspaces.mdx b/docs/v2.6.0-alpha/api-reference/endpoint/workspaces/get-all-workspaces.mdx
index 12e3d931..dbfa1d98 100644
--- a/docs/v2.6.0-alpha/api-reference/endpoint/workspaces/get-all-workspaces.mdx
+++ b/docs/v2.6.0-alpha/api-reference/endpoint/workspaces/get-all-workspaces.mdx
@@ -1,3 +1,3 @@
---
-openapi: post /v2/workspaces/list
+openapi: post /v2.6.0-alpha/workspaces/list
---
diff --git a/docs/v2.6.0-alpha/api-reference/endpoint/workspaces/get-deriver-status.mdx b/docs/v2.6.0-alpha/api-reference/endpoint/workspaces/get-deriver-status.mdx
index 0b7a32b9..b5460068 100644
--- a/docs/v2.6.0-alpha/api-reference/endpoint/workspaces/get-deriver-status.mdx
+++ b/docs/v2.6.0-alpha/api-reference/endpoint/workspaces/get-deriver-status.mdx
@@ -1,3 +1,3 @@
---
-openapi: get /v2/workspaces/{workspace_id}/deriver/status
+openapi: get /v2.6.0-alpha/workspaces/{workspace_id}/deriver/status
---
diff --git a/docs/v2.6.0-alpha/api-reference/endpoint/workspaces/get-or-create-workspace.mdx b/docs/v2.6.0-alpha/api-reference/endpoint/workspaces/get-or-create-workspace.mdx
index 513f4fbb..85246932 100644
--- a/docs/v2.6.0-alpha/api-reference/endpoint/workspaces/get-or-create-workspace.mdx
+++ b/docs/v2.6.0-alpha/api-reference/endpoint/workspaces/get-or-create-workspace.mdx
@@ -1,3 +1,3 @@
---
-openapi: post /v2/workspaces
+openapi: post /v2.6.0-alpha/workspaces
---
diff --git a/docs/v2.6.0-alpha/api-reference/endpoint/workspaces/search-workspace.mdx b/docs/v2.6.0-alpha/api-reference/endpoint/workspaces/search-workspace.mdx
index f17e4e52..9fa73978 100644
--- a/docs/v2.6.0-alpha/api-reference/endpoint/workspaces/search-workspace.mdx
+++ b/docs/v2.6.0-alpha/api-reference/endpoint/workspaces/search-workspace.mdx
@@ -1,3 +1,3 @@
---
-openapi: post /v2/workspaces/{workspace_id}/search
+openapi: post /v2.6.0-alpha/workspaces/{workspace_id}/search
---
diff --git a/docs/v2.6.0-alpha/api-reference/endpoint/workspaces/trigger-dream.mdx b/docs/v2.6.0-alpha/api-reference/endpoint/workspaces/trigger-dream.mdx
index 138c58be..d238dc7f 100644
--- a/docs/v2.6.0-alpha/api-reference/endpoint/workspaces/trigger-dream.mdx
+++ b/docs/v2.6.0-alpha/api-reference/endpoint/workspaces/trigger-dream.mdx
@@ -1,3 +1,3 @@
---
-openapi: post /v2/workspaces/{workspace_id}/trigger_dream
+openapi: post /v2.6.0-alpha/workspaces/{workspace_id}/trigger_dream
---
diff --git a/docs/v2.6.0-alpha/api-reference/endpoint/workspaces/update-workspace.mdx b/docs/v2.6.0-alpha/api-reference/endpoint/workspaces/update-workspace.mdx
index 07d3b75e..0ab685e7 100644
--- a/docs/v2.6.0-alpha/api-reference/endpoint/workspaces/update-workspace.mdx
+++ b/docs/v2.6.0-alpha/api-reference/endpoint/workspaces/update-workspace.mdx
@@ -1,3 +1,3 @@
---
-openapi: put /v2/workspaces/{workspace_id}
+openapi: put /v2.6.0-alpha/workspaces/{workspace_id}
---
diff --git a/docs/v2.6.0-alpha/api-reference/introduction.mdx b/docs/v2.6.0-alpha/api-reference/introduction.mdx
index 6765e7a3..5234167e 100644
--- a/docs/v2.6.0-alpha/api-reference/introduction.mdx
+++ b/docs/v2.6.0-alpha/api-reference/introduction.mdx
@@ -5,7 +5,7 @@ title: 'Introduction'
This section documents all available API endpoints in the Honcho Server. Each
endpoint provides CRUD operations for our core primitives. For information
about these primitives, see
-[Architecture](/v2/documentation/core-concepts/architecture).
+[Architecture](/v2.6.0-alpha/documentation/core-concepts/architecture).
We strongly recommend using our official SDKs instead of calling these APIs directly. The SDKs provide better error handling, type safety, and developer experience.
diff --git a/docs/v2.6.0-alpha/contributing/self-hosting.mdx b/docs/v2.6.0-alpha/contributing/self-hosting.mdx
index 3e5e1e42..88fca48e 100644
--- a/docs/v2.6.0-alpha/contributing/self-hosting.mdx
+++ b/docs/v2.6.0-alpha/contributing/self-hosting.mdx
@@ -276,8 +276,8 @@ const client = new Honcho({
### Next Steps
-- **Explore the API**: Check out the [API Reference](/v2/api-reference/introduction)
-- **Try the SDKs**: See our [guides](/v2/guides) for examples
+- **Explore the API**: Check out the [API Reference](/v2.6.0-alpha/api-reference/introduction)
+- **Try the SDKs**: See our [guides](/v2.6.0-alpha/guides) for examples
- **Configure Honcho**: Visit the [Configuration Guide](./configuration) for detailed settings
- **Join the community**: [Discord](https://discord.gg/plasticlabs)
diff --git a/docs/v2.6.0-alpha/documentation/core-concepts/architecture.mdx b/docs/v2.6.0-alpha/documentation/core-concepts/architecture.mdx
index b0eb7dc3..35ec932a 100644
--- a/docs/v2.6.0-alpha/documentation/core-concepts/architecture.mdx
+++ b/docs/v2.6.0-alpha/documentation/core-concepts/architecture.mdx
@@ -5,7 +5,7 @@ icon: "sitemap"
sidebarTitle: "Architecture"
---
-Honcho is memory infrastructure that continuously [*reasons*](/v2/documentation/core-concepts/reasoning) about data to build rich representations of peers (users, agents, or any entity) over time. This document explains the data model, system components, and how data flows through Honcho.
+Honcho is memory infrastructure that continuously [*reasons*](/v2.6.0-alpha/documentation/core-concepts/reasoning) about data to build rich representations of peers (users, agents, or any entity) over time. This document explains the data model, system components, and how data flows through Honcho.
## Data Model
@@ -40,7 +40,7 @@ Authentication is scoped to the workspace level, and configuration settings can
### Peers
-Peers are the most important entity in Honcho--everything revolves around building and maintaining their [*representations*](/v2/documentation/core-concepts/representation). A peer represents any individual user, agent, or entity in a workspace. Treating humans and agents the same way lets you build arbitrary combinations for multi-agent or group chat scenarios.
+Peers are the most important entity in Honcho--everything revolves around building and maintaining their [*representations*](/v2.6.0-alpha/documentation/core-concepts/representation). A peer represents any individual user, agent, or entity in a workspace. Treating humans and agents the same way lets you build arbitrary combinations for multi-agent or group chat scenarios.
Each peer has a unique identifier within a workspace and is a container for reasoning across all their sessions. This cross-session context means conclusions drawn about a peer in one session can inform interactions in completely different sessions. Peers can be configured to control whether Honcho reasons about them.
@@ -90,13 +90,13 @@ Honcho's architecture follows a few core principles. Everything revolves around
Sign up for the Honcho platform and start building
-
+
Get started with your first integration
-
+
Learn how Honcho reasons about messages to build memory
-
+
Understand what peer representations are and how they work
diff --git a/docs/v2.6.0-alpha/documentation/core-concepts/reasoning.mdx b/docs/v2.6.0-alpha/documentation/core-concepts/reasoning.mdx
index 143abfba..38aec7b5 100644
--- a/docs/v2.6.0-alpha/documentation/core-concepts/reasoning.mdx
+++ b/docs/v2.6.0-alpha/documentation/core-concepts/reasoning.mdx
@@ -84,13 +84,13 @@ Without exhaustive reasoning, you're stuck with surface-level retrieval or someo
Sign up for the Honcho platform and start building
-
+
Get started with your first integration
-
+
See how reasoning fits into Honcho's overall architecture
-
+
Learn how reasoning produces peer representations
diff --git a/docs/v2.6.0-alpha/documentation/core-concepts/representation.mdx b/docs/v2.6.0-alpha/documentation/core-concepts/representation.mdx
index a9bd2325..5d9efb83 100644
--- a/docs/v2.6.0-alpha/documentation/core-concepts/representation.mdx
+++ b/docs/v2.6.0-alpha/documentation/core-concepts/representation.mdx
@@ -10,7 +10,7 @@ When you write messages to Honcho, the reasoning models extract premises, draw c
## What's in a Representation?
-A peer representation is made up of several types of artifacts that Honcho generates through [*reasoning*](/v2/documentation/core-concepts/reasoning):
+A peer representation is made up of several types of artifacts that Honcho generates through [*reasoning*](/v2.6.0-alpha/documentation/core-concepts/reasoning):
**Conclusions** are insights derived through formal logic. Deductive conclusions are things Honcho can be certain about based on extracted premises. Inductive conclusions identify patterns across multiple messages. Abductive conclusions infer the simplest explanations for observed behavior. For example, if a user frequently mentions work deadlines and rarely mentions hobbies, Honcho might inductively conclude they're time-constrained or career-focused.
@@ -25,7 +25,7 @@ These enable continuous improvement. Each new message refines conclusions, updat
Honcho can build different representations based on what each peer observes. This enables sophisticated multi-peer scenarios where understanding is relative to what was actually witnessed.
-There are two observation modes controlled by [configuration](/v2/documentation/features/advanced/configuration):
+There are two observation modes controlled by [configuration](/v2.6.0-alpha/documentation/features/advanced/configuration):
**Honcho observing peers** (`observe_me`): When enabled (default), Honcho forms a representation of the peer based on all messages they've sent across all sessions. This is Honcho's understanding of that peer, built from everything they've said and done in your system. Set `observe_me: false` if you don't want Honcho to reason about that peer at all.
@@ -54,13 +54,13 @@ Humans reconstruct the past from imperfect recollections, then act on those reco
Sign up for the Honcho platform and start building
-
+
See representations in action with a working example
-
+
Understand how representations fit into Honcho's architecture
-
+
Learn how to query representations with natural language
diff --git a/docs/v2.6.0-alpha/documentation/features/advanced/overview.mdx b/docs/v2.6.0-alpha/documentation/features/advanced/overview.mdx
index 9891a34f..916334a6 100644
--- a/docs/v2.6.0-alpha/documentation/features/advanced/overview.mdx
+++ b/docs/v2.6.0-alpha/documentation/features/advanced/overview.mdx
@@ -9,12 +9,12 @@ Advanced features give you fine-grained control over Honcho's behavior and imple
## Configuration & Monitoring
-- [Queue Status](/v2/documentation/features/advanced/queue-status) - Monitor background processing and reasoning tasks
-- [Configuration](/v2/documentation/features/advanced/toggle-reasoning) - Configure reasoning models and behavior
-- [Summarizer](/v2/documentation/features/advanced/summarizer) - Automatic session summarization
+- [Queue Status](/v2.6.0-alpha/documentation/features/advanced/queue-status) - Monitor background processing and reasoning tasks
+- [Configuration](/v2.6.0-alpha/documentation/features/advanced/toggle-reasoning) - Configure reasoning models and behavior
+- [Summarizer](/v2.6.0-alpha/documentation/features/advanced/summarizer) - Automatic session summarization
## Querying & Filtering
-- [Search](/v2/documentation/features/advanced/search) - Search across peers, sessions, and messages
-- [Filters](/v2/documentation/features/advanced/using-filters) - Filter queries with advanced parameters
-- [Streaming Responses](/v2/documentation/features/advanced/streaming-response) - Stream dialectic responses in real-time
+- [Search](/v2.6.0-alpha/documentation/features/advanced/search) - Search across peers, sessions, and messages
+- [Filters](/v2.6.0-alpha/documentation/features/advanced/using-filters) - Filter queries with advanced parameters
+- [Streaming Responses](/v2.6.0-alpha/documentation/features/advanced/streaming-response) - Stream dialectic responses in real-time
diff --git a/docs/v2.6.0-alpha/documentation/features/advanced/queue-status.mdx b/docs/v2.6.0-alpha/documentation/features/advanced/queue-status.mdx
index 9b00eb01..5b3d8dfa 100644
--- a/docs/v2.6.0-alpha/documentation/features/advanced/queue-status.mdx
+++ b/docs/v2.6.0-alpha/documentation/features/advanced/queue-status.mdx
@@ -4,7 +4,7 @@ description: Learn how to check the status of Honcho's reasoning
icon: "lines-leaning"
---
-Whenever messages are stored in Honcho, a background process kicks off to [reason](/v2/documentation/core-concepts/reasoning) about the conversation and generate insights.
+Whenever messages are stored in Honcho, a background process kicks off to [reason](/v2.6.0-alpha/documentation/core-concepts/reasoning) about the conversation and generate insights.
Reasoning is an asynchronous process and, depending on load, may not immediately
generate insights for the latest message you've sent. To help with this, Honcho
diff --git a/docs/v2.6.0-alpha/documentation/features/advanced/reasoning-configuration.mdx b/docs/v2.6.0-alpha/documentation/features/advanced/reasoning-configuration.mdx
index 28cb8876..50d20f2c 100644
--- a/docs/v2.6.0-alpha/documentation/features/advanced/reasoning-configuration.mdx
+++ b/docs/v2.6.0-alpha/documentation/features/advanced/reasoning-configuration.mdx
@@ -157,7 +157,7 @@ You may therefore disable observation of a peer by setting the `observe_me` flag
If the peer has a session-level configuration, it will override this configuration. If the flag is not set, or is set to `true`, the peer will be observed.
-For session-level observation controls and local representations (where peers build separate models of each other), see [Representation Scopes](/v2/documentation/features/advanced/representation-scopes).
+For session-level observation controls and local representations (where peers build separate models of each other), see [Representation Scopes](/v2.6.0-alpha/documentation/features/advanced/representation-scopes).
diff --git a/docs/v2.6.0-alpha/documentation/features/chat.mdx b/docs/v2.6.0-alpha/documentation/features/chat.mdx
index 97296f83..b983846d 100644
--- a/docs/v2.6.0-alpha/documentation/features/chat.mdx
+++ b/docs/v2.6.0-alpha/documentation/features/chat.mdx
@@ -172,7 +172,7 @@ When you call `peer.chat(query)`:
3. Combines them with segments of source messages, if needed, to gather more context
4. Synthesizes them into a coherent natural language response to your query
-Honcho [reasoning](/v2/documentation/core-concepts/reasoning) runs continuously in the background, processing new messages and updating representations. The chat endpoint always has access to Honcho's latest conclusions about the peer.
+Honcho [reasoning](/v2.6.0-alpha/documentation/core-concepts/reasoning) runs continuously in the background, processing new messages and updating representations. The chat endpoint always has access to Honcho's latest conclusions about the peer.
## Best Practices
@@ -188,4 +188,4 @@ Don't just use chat for LLM prompts - use it to drive application logic, routing
### Combine with get_context()
Use `get_context()` for conversation context and `peer.chat()` for specific insights. They complement each other.
-For more ideas on using the chat endpoint, see our [guides](/v2/guides/overview).
+For more ideas on using the chat endpoint, see our [guides](/v2.6.0-alpha/guides/overview).
diff --git a/docs/v2.6.0-alpha/documentation/features/get-context.mdx b/docs/v2.6.0-alpha/documentation/features/get-context.mdx
index a564e9d9..6b4ba186 100644
--- a/docs/v2.6.0-alpha/documentation/features/get-context.mdx
+++ b/docs/v2.6.0-alpha/documentation/features/get-context.mdx
@@ -6,8 +6,11 @@ icon: 'messages'
The `get_context()` method is a powerful feature that retrieves formatted conversation context from sessions, making it easy to integrate with LLMs like OpenAI, Anthropic, and others. This guide covers everything you need to know about working with session context.
+
+By default, the context includes a blend of summary and messages ***which covers the entire session history of a peer***.
+
-By default, the context includes a blend of summary and messages which covers the entire history of the session. Summaries are automatically generated at intervals and recent messages are included depending on how many tokens the context is intended to be. You can specify any token limit you want, and can disable summaries to fill that limit entirely with recent messages. To get representation data, you need to specify a target peer.
+Summaries are automatically generated at intervals and recent messages are included depending on how many tokens the context is intended to be. You can specify any token limit you want, and can disable summaries to fill that limit entirely with recent messages. To get representation data, you need to specify a target peer.
## Basic Usage
@@ -96,7 +99,7 @@ context = session.get_context(summary=False, tokens=2000)
### Peer Representation in Context
-You can include a peer's [representation](/v2/documentation/core-concepts/representation) and peer card in the context by specifying `peer_target`. This is useful for providing the LLM with knowledge about a specific peer.
+You can include a peer's [representation](/v2.6.0-alpha/documentation/core-concepts/representation) and peer card in the context by specifying `peer_target`. This is useful for providing the LLM with knowledge about a specific peer.
```python Python
@@ -601,40 +604,24 @@ anthropic_messages = context.to_anthropic(assistant=assistant)
### 3. Error Handling
-Always handle potential errors when working with context:
+Always handle potential errors when retrieving context:
```python Python
try:
context = session.get_context(tokens=2000)
- messages = context.to_openai(assistant=assistant)
-
- # Use messages with LLM API
- response = openai_client.chat.completions.create(
- model="gpt-4",
- messages=messages
- )
-
except Exception as e:
print(f"Error getting context: {e}")
- # Handle error appropriately
+ # Handle error appropriately (fallback to basic context, retry, etc.)
```
```typescript TypeScript
(async () => {
try {
const context = await session.getContext({ tokens: 2000 });
- const messages = context.toOpenAI(assistant);
-
- // Use messages with LLM API
- const response = await openai.chat.completions.create({
- model: "gpt-4",
- messages: messages
- });
-
} catch (error) {
console.error(`Error getting context: ${error}`);
- // Handle error appropriately
+ // Handle error appropriately (fallback to basic context, retry, etc.)
}
})();
```
diff --git a/docs/v2.6.0-alpha/documentation/introduction/overview.mdx b/docs/v2.6.0-alpha/documentation/introduction/overview.mdx
index 3d9624f9..871c0c4e 100644
--- a/docs/v2.6.0-alpha/documentation/introduction/overview.mdx
+++ b/docs/v2.6.0-alpha/documentation/introduction/overview.mdx
@@ -10,7 +10,7 @@ Honcho is an open source memory library with a managed service for building stat
Sign up and start building with Honcho
-
+
Build your first stateful agent in minutes
@@ -63,7 +63,7 @@ Honcho has four storage primitives that work together:
- **Sessions** - Interaction threads between peers with temporal boundaries
- **Messages** - Units of data that trigger reasoning (conversations, events, activity, documents, and more)
-When you write messages to Honcho, they're stored and processed in the background. Custom reasoning models perform formal logical [*reasoning*](/v2/documentation/core-concepts/reasoning) to generate conclusions about each peer. These conclusions are stored as [*representations*](/v2/documentation/core-concepts/representation) that you can query to provide rich context for your agents.
+When you write messages to Honcho, they're stored and processed in the background. Custom reasoning models perform formal logical [*reasoning*](/v2.6.0-alpha/documentation/core-concepts/reasoning) to generate conclusions about each peer. These conclusions are stored as [*representations*](/v2.6.0-alpha/documentation/core-concepts/representation) that you can query to provide rich context for your agents.

@@ -87,13 +87,13 @@ Welcome to Honcho. We're excited to have you at the frontier of AI with us 🫡.
Sign up for the Honcho platform and get your API key
-
+
Build your first stateful agent in minutes
-
+
Deep dive into how Honcho's primitives fit together
-
+
Learn how Honcho reasons about data to build memory
diff --git a/docs/v2.6.0-alpha/documentation/introduction/quickstart.mdx b/docs/v2.6.0-alpha/documentation/introduction/quickstart.mdx
index 927e0ba1..21feff6a 100644
--- a/docs/v2.6.0-alpha/documentation/introduction/quickstart.mdx
+++ b/docs/v2.6.0-alpha/documentation/introduction/quickstart.mdx
@@ -230,7 +230,7 @@ user.chat("What should I know about this user? 3 sentences max").then((response)
-Honcho needs a short amount of time to process messages you write to it. There are several utilities to [check the status](/v2/documentation/features/advanced/queue-status) of the queue. Honcho also offers numerous ways to query reasoning to fit latency needs: see the [Get Context](/v2/documentation/features/get-context) page.
+Honcho needs a short amount of time to process messages you write to it. There are several utilities to [check the status](/v2.6.0-alpha/documentation/features/advanced/queue-status) of the queue. Honcho also offers numerous ways to query reasoning to fit latency needs: see the [Get Context](/v2.6.0-alpha/documentation/features/get-context) page.
The response will look something like this:
@@ -389,16 +389,16 @@ console.log(response);
From here, you can explore how to use Honcho's features in your own applications:
-
+
Learn how to fetch the right context for your agent's next response
-
+
Deep dive into how Honcho's primitives fit together
-
+
Query representations with natural language
-
+
Integration patterns and advanced use cases
diff --git a/docs/v2.6.0-alpha/documentation/introduction/vibecoding.mdx b/docs/v2.6.0-alpha/documentation/introduction/vibecoding.mdx
index 1c0ae6ec..0e44dc04 100644
--- a/docs/v2.6.0-alpha/documentation/introduction/vibecoding.mdx
+++ b/docs/v2.6.0-alpha/documentation/introduction/vibecoding.mdx
@@ -23,9 +23,9 @@ I want to start building with Honcho - an open source memory library for buildin
**Documentation:**
- Main docs: https://docs.honcho.dev
-- API Reference: https://docs.honcho.dev/v2/api-reference/introduction
-- Quickstart: https://docs.honcho.dev/v2/documentation/introduction/quickstart
-- Architecture: https://docs.honcho.dev/v2/documentation/core-concepts/architecture
+- API Reference: https://docs.honcho.dev/v2.6.0-alpha/api-reference/introduction
+- Quickstart: https://docs.honcho.dev/v2.6.0-alpha/documentation/introduction/quickstart
+- Architecture: https://docs.honcho.dev/v2.6.0-alpha/documentation/core-concepts/architecture
**Code & Examples:**
- Core repo: https://github.com/plastic-labs/honcho
diff --git a/docs/v2.6.0-alpha/documentation/reference/platform.mdx b/docs/v2.6.0-alpha/documentation/reference/platform.mdx
index 426af86f..34e9e237 100644
--- a/docs/v2.6.0-alpha/documentation/reference/platform.mdx
+++ b/docs/v2.6.0-alpha/documentation/reference/platform.mdx
@@ -1,7 +1,7 @@
---
title: "The Honcho Dashboard"
icon: "rocket"
-description: "Build socially intelligent agents without worrying about infrastructure"
+description: "Build stateful agents without worrying about infrastructure"
sidebarTitle: "Dashboard Overview"
---
@@ -10,7 +10,7 @@ sidebarTitle: "Dashboard Overview"
The quickest way to begin using Honcho in production is with the
-[Honcho Cloud Platform](https://app.honcho.dev). Sign up, generate an API key,
+[Honcho Cloud Service](https://app.honcho.dev). Sign up, generate an API key,
and start building with Honcho.
## 1. Go to [app.honcho.dev](https://app.honcho.dev)
@@ -93,7 +93,7 @@ Expand the `Peers` list from the `Workspace` dashboard to see a detailed view of
-Click into any peer to navigate to their respective utilities page. Next to the `Peer` name you can edit the [Global Peer Configuration](/v2/documentation/core-concepts/configuration), and in the tabs below, explore all utilities for the `Peer`.
+Click into any peer to navigate to their respective utilities page. Next to the `Peer` name you can edit the [Peer Configuration](/v2.6.0-alpha/documentation/features/advanced/reasoning-configuration), and in the tabs below, explore all utilities for the `Peer`.
@@ -101,14 +101,14 @@ Click into any peer to navigate to their respective utilities page. Next to the
Utilities include:
- **Message search** across all sessions for a `Peer`
-- **Dialectic Chat** to query `Peer` representations globally or session-scoped (results vary dependant on the `Peer`'s configuration)
+- **Chat** to query `Peer` representations with an optional session scope (results vary based on the `Peer`'s configuration)
- **Session logs** view which `Sessions` the `Peer` is active
-- **Peer configuration and metadata management** including [Session-Peer Configuration](/v2/documentation/core-concepts/configuration#session-peer-configuration)
+- **Peer configuration and metadata management** including [Session-Peer Configuration](/v2.6.0-alpha/documentation/features/advanced/reasoning-configuration#session-configuration)
@@ -153,9 +153,9 @@ The [Members](https://app.honcho.dev/members) page provides organization adminis
## Go Further
-View the [Architecture](/v2/documentation/core-concepts/architecture) to see how Honcho works under the hood.
+View the [Architecture](/v2.6.0-alpha/documentation/core-concepts/architecture) to see how Honcho works under the hood.
-Dive into our [API Reference](/v2/api-reference) to explore all available endpoints.
+Dive into our [API Reference](/v2.6.0-alpha/api-reference) to explore all available endpoints.
## Next Steps
@@ -166,16 +166,11 @@ Dive into our [API Reference](/v2/api-reference) to explore all available endpoi
Connect with 1000+ developers building with Honcho
-
+
View our guidelines and explore the codebase
-
+
See Honcho in action with real examples
-We're excited to see what you'll build with Honcho Platform. Let's create smarter, more personalized AI experiences together!
-
----
-
-*Ready to build personally aligned AI? [Get started with Honcho →](https://app.honcho.dev)*
diff --git a/docs/v2.6.0-alpha/documentation/reference/sdk.mdx b/docs/v2.6.0-alpha/documentation/reference/sdk.mdx
index 038e3cbc..7e4f7f80 100644
--- a/docs/v2.6.0-alpha/documentation/reference/sdk.mdx
+++ b/docs/v2.6.0-alpha/documentation/reference/sdk.mdx
@@ -944,7 +944,7 @@ const response = await openai.chat.completions.create({
When creating messages, you can optionally specify a custom `created_at` timestamp instead of using the server's current time:
```bash
-curl -X POST "https://api.honcho.dev/v2/workspaces/{workspace_id}/sessions/{session_id}/messages" \
+curl -X POST "https://api.honcho.dev/v2.6.0-alpha/workspaces/{workspace_id}/sessions/{session_id}/messages" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
@@ -968,7 +968,7 @@ If `created_at` is not provided, messages will use the server's current timestam
### Metadata and Filtering
-See [Using Filters](/v2/guides/using-filters) for more examples on how to use filters.
+See [Using Filters](/v2.6.0-alpha/guides/using-filters) for more examples on how to use filters.
```python Python
diff --git a/docs/v2.6.0-alpha/documentation/scratch/honcho-memory/advanced-retrieval/get-context.mdx b/docs/v2.6.0-alpha/documentation/scratch/honcho-memory/advanced-retrieval/get-context.mdx
index 520fb362..c30dcf51 100644
--- a/docs/v2.6.0-alpha/documentation/scratch/honcho-memory/advanced-retrieval/get-context.mdx
+++ b/docs/v2.6.0-alpha/documentation/scratch/honcho-memory/advanced-retrieval/get-context.mdx
@@ -150,13 +150,13 @@ for query in user_queries:
## Related Features
-
+
Learn about basic context retrieval
-
+
Understand session summarization
-
+
Chat with Honcho for insights
diff --git a/docs/v2.6.0-alpha/documentation/scratch/honcho-memory/quickstart.mdx b/docs/v2.6.0-alpha/documentation/scratch/honcho-memory/quickstart.mdx
index 812bfb95..228d0861 100644
--- a/docs/v2.6.0-alpha/documentation/scratch/honcho-memory/quickstart.mdx
+++ b/docs/v2.6.0-alpha/documentation/scratch/honcho-memory/quickstart.mdx
@@ -237,19 +237,19 @@ and Bob. We:
As soon as you save a message in Honcho, it will start to reason about it to
pull out insights and develop a profile of the user. This is the default
-behavior and can be toggled off via [the configuration](/v2/documentation/core-concepts/configuration).
+behavior and can be toggled off via [the configuration](/v2.6.0-alpha/documentation/core-concepts/configuration).
## Next Steps
+ href="/v2.6.0-alpha/documentation/core-concepts/architecture">
Learn about the data primitives in Honcho and how they work together
Sign up for Managed Honcho and get started building agents now.
-
+
Check out spellbooks to see different examples apps built with Honcho
diff --git a/docs/v2.6.0-alpha/documentation/scratch/local-vs-global.mdx b/docs/v2.6.0-alpha/documentation/scratch/local-vs-global.mdx
index e5670229..c9036cdd 100644
--- a/docs/v2.6.0-alpha/documentation/scratch/local-vs-global.mdx
+++ b/docs/v2.6.0-alpha/documentation/scratch/local-vs-global.mdx
@@ -53,7 +53,7 @@ This feature is illustrated in the graphic below:
We can enable local representation for a `Peer` by setting `observe_others=True`.
This is shown in the [Configure
-Reasoning](/v2/documentation/core-concepts/configuration) page.
+Reasoning](/v2.6.0-alpha/documentation/core-concepts/configuration) page.
Now if we used Bob's local representation of Alice then Bob would only get
insights on what they've seen Alice say to them.
diff --git a/docs/v2.6.0-alpha/documentation/scratch/working-rep.mdx b/docs/v2.6.0-alpha/documentation/scratch/working-rep.mdx
deleted file mode 100644
index f3ea09b6..00000000
--- a/docs/v2.6.0-alpha/documentation/scratch/working-rep.mdx
+++ /dev/null
@@ -1,347 +0,0 @@
----
-title: 'Working Representations'
-description: "Learn how to retrieve cached peer knowledge and understanding using Honcho's working representation system"
-icon: 'brain'
----
-
-Working representations are Honcho's system for accessing cached psychological models that capture what peers know, think, and remember. Unlike the `chat()` method which generates fresh representations on-demand, the `working_rep()` method retrieves pre-computed representations that have been automatically built and stored as conversations progress.
-
-## How Working Representations Are Created
-
-Working representations are automatically generated and cached through Honcho's background processing system:
-
-1. **Automatic Generation**: When messages are added to sessions, they trigger background jobs that analyze conversations using theory of mind inference and long-term memory integration
-
-2. **Cached Storage**: The generated representations are stored in the database as metadata on `Peer` objects (for global representations) or `SessionPeer` objects (for session-scoped representations)
-
-3. **Retrieval**: The `working_rep()` method provides fast access to these cached representations without requiring LLM processing
-
-
-**Cached vs On-Demand**: `working_rep()` retrieves cached representations for fast access, while `peer.chat()` generates fresh representations using the dialectic system. Use `working_rep()` when you need fast access to stored knowledge, and `chat()` when you need current analysis with custom queries.
-
-
-## Basic Usage
-
-Working representations are accessed through the `working_rep()` method on Session or Peer objects:
-
-
-```python Python
-from honcho import Honcho
-
-# Initialize client
-honcho = Honcho()
-
-# Create peers and session
-user = honcho.peer("user-123")
-assistant = honcho.peer("ai-assistant")
-session = honcho.session("support-conversation")
-
-# Add conversation to trigger representation generation
-session.add_messages([
- user.message("I'm having trouble with my billing account"),
- assistant.message("I can help with that. What specific issue are you seeing?"),
- user.message("My credit card was charged twice last month"),
- assistant.message("I see duplicate charges on your account. Let me refund one of them.")
-])
-
-# Chat to generate a working representation
-response = user.chat("What is this user's main concern right now?", session_id=session.id)
-
-# Retrieve the cached working representation for the user
-user_representation = session.working_rep("user-123")
-print("Cached user representation:", user_representation)
-
-# Or access from the peer directly
-peer_representation = user.working_rep()
-```
-
-```typescript TypeScript
-import { Honcho } from "@honcho-ai/sdk";
-
-// Initialize client
-const honcho = new Honcho({});
-
-// Create peers and session
-const user = await honcho.peer("user-123");
-const assistant = await honcho.peer("ai-assistant");
-const session = await honcho.session("support-conversation");
-
-// Add conversation to trigger representation generation
-await session.addMessages([
- user.message("I'm having trouble with my billing account"),
- assistant.message("I can help with that. What specific issue are you seeing?"),
- user.message("My credit card was charged twice last month"),
- assistant.message("I see duplicate charges on your account. Let me refund one of them.")
-]);
-
-// Chat to generate a working representation
-const response = await user.chat("What is this user's main concern right now?", { sessionId: session.id });
-
-// Retrieve the cached working representation for the user
-const userRepresentation = await session.workingRep("user-123");
-console.log("Cached user representation:", userRepresentation);
-
-// Or access from the peer directly
-const peerRepresentation = await user.workingRep();
-```
-
-
-## Semantic Search in Representations
-
-Working representations support semantic search to retrieve the most relevant observations for a given query. This is useful when you want to focus the representation on specific topics.
-
-### Parameters
-
-| Parameter | Type | Description |
-|-----------|------|-------------|
-| `search_query` | `str` | Semantic search query to filter relevant observations |
-| `search_top_k` | `int` | Number of semantic search results to include (1-100) |
-| `search_max_distance` | `float` | Maximum semantic distance threshold (0.0-1.0) |
-| `include_most_derived` | `bool` | Whether to include the most recently derived observations |
-| `max_observations` | `int` | Maximum number of observations to include (1-100) |
-
-
-```python Python
-# Get representation focused on a specific topic
-billing_rep = session.working_rep(
- "user-123",
- search_query="billing and payment issues",
- search_top_k=10,
- search_max_distance=0.8,
- include_most_derived=True,
- max_observations=25
-)
-
-# Get representation from peer with target
-# What user-123 knows about the assistant
-local_rep = session.working_rep(
- "user-123",
- target="ai-assistant",
- search_query="support interactions"
-)
-
-# Access from peer object with semantic search
-user_rep = user.working_rep(
- session=session,
- search_query="preferences",
- search_top_k=5
-)
-```
-
-```typescript TypeScript
-// Get representation focused on a specific topic
-const billingRep = await session.workingRep("user-123", {
- searchQuery: "billing and payment issues",
- searchTopK: 10,
- searchMaxDistance: 0.8,
- includeMostDerived: true,
- maxObservations: 25
-});
-
-// Get representation from peer with target
-// What user-123 knows about the assistant
-const localRep = await session.workingRep("user-123", {
- target: "ai-assistant",
- searchQuery: "support interactions"
-});
-
-// Access from peer object with semantic search
-const userRep = await user.workingRep(session, undefined, {
- searchQuery: "preferences",
- searchTopK: 5
-});
-```
-
-
-## Understanding Representation Content
-
-Cached working representations contain structured psychological analysis based on conversation history. The format typically includes:
-
-### Current Mental State Predictions
-Information about what the peer is currently thinking, feeling, or focused on based on recent messages.
-
-### Relevant Long-term Facts
-Facts about the peer that have been extracted and stored over time from various conversations.
-
-### Example Representation Structure
-
-
-```python Python
-# Example of what a cached representation might contain
-representation = session.working_rep("user-123")
-
-# Typical content structure:
-"""
-PREDICTION ABOUT THE USER'S CURRENT MENTAL STATE:
-The user appears frustrated with a billing issue, specifically concerning duplicate charges.
-They seem to have some confidence in the support process as they provided specific details.
-
-RELEVANT LONG-TERM FACTS ABOUT THE USER:
-- User has had previous billing inquiries
-- User prefers direct, specific communication
-- User is detail-oriented when reporting issues
-"""
-
-print("Full representation:", representation)
-```
-
-```typescript TypeScript
-// Example of what a cached representation might contain
-const representation = await session.workingRep("user-123");
-
-// Typical content structure:
-/*
-PREDICTION ABOUT THE USER'S CURRENT MENTAL STATE:
-The user appears frustrated with a billing issue, specifically concerning duplicate charges.
-They seem to have some confidence in the support process as they provided specific details.
-
-RELEVANT LONG-TERM FACTS ABOUT THE USER:
-- User has had previous billing inquiries
-- User prefers direct, specific communication
-- User is detail-oriented when reporting issues
-*/
-
-console.log("Full representation:", representation);
-```
-
-
-## When Representations Are Updated
-
-Working representations are automatically updated through Honcho's background processing system:
-
-### Message Processing Pipeline
-
-1. **Message Creation**: When messages are added via `session.add_messages()` or similar methods
-2. **Background Queuing**: Messages are queued for processing in the background
-3. **Theory of Mind Analysis**: The system analyzes conversation patterns and psychological states
-4. **Fact Extraction**: Long-term facts are extracted and stored in vector embeddings
-5. **Representation Generation**: New representations are created combining current analysis with historical facts
-6. **Cache Update**: The new representation is stored in the database metadata
-
-### Processing Triggers
-
-Representations are updated when:
-- New messages are added to sessions
-- Sufficient new content has accumulated
-- The background processing system determines an update is needed
-
-## Comparison with Chat Method
-
-Understanding when to use `working_rep()` vs `peer.chat()`:
-
-### Use `working_rep()` when:
-- You need fast access to stored psychological models
-- You want to see what the system has already learned about a peer
-- You're building dashboards or analytics that display peer understanding
-- You need consistent representations that don't change between calls
-
-### Use `peer.chat()` when:
-- You need to ask specific questions about a peer
-- You want fresh analysis based on current conversation state
-- You need customized insights for specific use cases
-- You want to query about relationships between peers
-
-
-```python Python
-# Fast cached access
-cached_rep = session.working_rep("user-123")
-print("Cached:", cached_rep[:100] + "...")
-
-# Custom query with fresh analysis
-custom_analysis = user.chat("What is this user's main concern right now?", session_id=session.id)
-print("Fresh analysis:", custom_analysis)
-```
-
-```typescript TypeScript
-// Fast cached access
-const cachedRep = await session.workingRep("user-123");
-console.log("Cached:", cachedRep.substring(0, 100) + "...");
-
-// Custom query with fresh analysis
-const customAnalysis = await user.chat("What is this user's main concern right now?", { sessionId: session.id });
-console.log("Fresh analysis:", customAnalysis);
-```
-
-
-## Best Practices
-
-### 1. Ensure Availability Before Using
-
-Make sure that a representation exists before processing it by using the chat endpoint first.
-
-### 2. Use for Fast Analytics
-
-Cached representations are ideal for analytics dashboards:
-
-
-```python Python
-# Good: Fast dashboard updates using cached data
-def update_analytics_dashboard(sessions):
- analytics = {}
- for session in sessions:
- for peer_id in session.get_peer_ids():
- rep = session.working_rep(peer_id)
- analytics[peer_id] = analyze_representation(rep)
- return analytics
-```
-
-```typescript TypeScript
-// Good: Fast dashboard updates using cached data
-async function updateAnalyticsDashboard(sessions) {
- const analytics: Record = {};
- for (const session of sessions) {
- const peerIds = await session.getPeerIds();
- for (const peerId of peerIds) {
- const rep = await session.workingRep(peerId);
- analytics[peerId] = analyzeRepresentation(rep);
- }
- }
- return analytics;
-}
-```
-
-
-### 3. Combine with Fresh Analysis When Needed
-
-Use cached representations for baseline understanding, and fresh analysis for current insights:
-
-
-```python Python
-# Get baseline understanding from cache
-baseline = session.working_rep("user-123")
-
-# Get current specific insights
-current_state = user.chat("How is this user feeling right now?", session_id=session.id)
-
-# Combine for comprehensive view
-comprehensive_view = {
- "baseline_knowledge": baseline,
- "current_analysis": current_state
-}
-```
-
-```typescript TypeScript
-// Get baseline understanding from cache
-const baseline = await session.workingRep("user-123");
-
-// Get current specific insights
-const currentState = await user.chat("How is this user feeling right now?", { sessionId: session.id });
-
-// Combine for comprehensive view
-const comprehensiveView = {
- baselineKnowledge: baseline,
- currentAnalysis: currentState
-};
-```
-
-
-## Conclusion
-
-Working representations provide fast access to cached psychological models that Honcho automatically builds and maintains. By understanding how to:
-
-- Retrieve cached representations using `session.working_rep()`
-- Parse and interpret representation content
-- Handle cases where representations aren't available
-- Combine cached and fresh analysis appropriately
-
-You can build efficient applications that leverage Honcho's continuous learning about peer knowledge and mental states without the latency of real-time generation.
diff --git a/docs/v2.6.0-alpha/guides/integrations/crewai.mdx b/docs/v2.6.0-alpha/guides/integrations/crewai.mdx
index 6d39d983..d6cb34a2 100644
--- a/docs/v2.6.0-alpha/guides/integrations/crewai.mdx
+++ b/docs/v2.6.0-alpha/guides/integrations/crewai.mdx
@@ -53,7 +53,7 @@ This tutorial uses the Honcho demo server at https://demo.honcho.dev which runs
The `honcho_crewai` package provides `HonchoStorage`, a storage provider that implements CrewAI's `Storage` interface using Honcho's session-based memory.
-Before proceeding, it's important to understand Honcho's core concepts (`Peers` and `Sessions`). Review the [Honcho Architecture](/v2/documentation/core-concepts/architecture) to familiarize yourself with these primitives.
+Before proceeding, it's important to understand Honcho's core concepts (`Peers` and `Sessions`). Review the [Honcho Architecture](/v2.6.0-alpha/documentation/core-concepts/architecture) to familiarize yourself with these primitives.
`HonchoStorage` implements CrewAI's `Storage` interface using Honcho's `peer` and `session` primitives.
@@ -97,7 +97,7 @@ results = storage.search("query", filters={
})
```
-For the full filter syntax including logical operators (AND, OR, NOT), comparison operators, and metadata filtering, see the [Using Filters](https://docs.honcho.dev/v2/documentation/core-concepts/features/using-filters) documentation.
+For the full filter syntax including logical operators (AND, OR, NOT), comparison operators, and metadata filtering, see the [Using Filters](https://docs.honcho.dev/v2.6.0-alpha/documentation/core-concepts/features/using-filters) documentation.
For comprehensive details about CrewAI's memory system, see the [official CrewAI Memory documentation](https://docs.crewai.com/en/concepts/memory).
@@ -279,16 +279,16 @@ Now that you have a working CrewAI integration with Honcho, you can:
## Related Resources
-
+
Understand Honcho's peer-based model and core primitives
-
+
Learn about retrieving and formatting conversation context
-
+
Query `peer` representations for deeper understanding
-
+
Build stateful agents with LangGraph and Honcho
diff --git a/docs/v2.6.0-alpha/guides/integrations/langgraph.mdx b/docs/v2.6.0-alpha/guides/integrations/langgraph.mdx
index 26af8c17..3eba2565 100644
--- a/docs/v2.6.0-alpha/guides/integrations/langgraph.mdx
+++ b/docs/v2.6.0-alpha/guides/integrations/langgraph.mdx
@@ -109,7 +109,7 @@ const llm = new OpenAI({
Define your state schema to pass data through the graph. The state stores Honcho objects directly along with the current user message and assistant response.
-Before proceeding, it's important to understand Honcho's core concepts (`Peers` and `Sessions`). Review the [Honcho Architecture](/v2/documentation/core-concepts/architecture) to familiarize yourself with these primitives.
+Before proceeding, it's important to understand Honcho's core concepts (`Peers` and `Sessions`). Review the [Honcho Architecture](/v2.6.0-alpha/documentation/core-concepts/architecture) to familiarize yourself with these primitives.
@@ -227,7 +227,7 @@ const graph = new StateGraph(StateAnnotation)
### Understanding get_context()
-The [`get_context()`](/v2/documentation/core-concepts/features/get-context) method retrieves comprehensive conversation context and formats it for your LLM. It automatically:
+The [`get_context()`](/v2.6.0-alpha/documentation/core-concepts/features/get-context) method retrieves comprehensive conversation context and formats it for your LLM. It automatically:
- **Manages conversation history** - Tracks all messages and determines what's relevant
- **Respects token limits** - Stays within context window constraints without manual counting
@@ -248,7 +248,7 @@ That's it. Call `session.get_context().to_openai(assistant)` and you get properl
-For more details on all available parameters, see [`get_context() documentation`](/v2/documentation/core-concepts/features/get-context)
+For more details on all available parameters, see [`get_context() documentation`](/v2.6.0-alpha/documentation/core-concepts/features/get-context)
## Chat Loop
@@ -354,10 +354,10 @@ Now that you have a working LangGraph integration with Honcho, you can:
## Related Resources
-
+
Learn more about retrieving and formatting conversation context
-
+
Use Honcho in Claude Desktop with MCP
diff --git a/docs/v2.6.0-alpha/guides/overview.mdx b/docs/v2.6.0-alpha/guides/overview.mdx
index bfd96981..1944c7d6 100644
--- a/docs/v2.6.0-alpha/guides/overview.mdx
+++ b/docs/v2.6.0-alpha/guides/overview.mdx
@@ -5,7 +5,7 @@ description: 'Helpful guides and design patterns for building with Honcho'
icon: 'hat-wizard'
---
- Before you start a guide, follow [Quickstart](/v2/documentation/introduction/quickstart) to get up and running with Honcho in your language of choice.
+ Before you start a guide, follow [Quickstart](/v2.6.0-alpha/documentation/introduction/quickstart) to get up and running with Honcho in your language of choice.
These guides provide concrete examples and implementation patterns for building with Honcho. Whether you're integrating Honcho into existing platforms, exploring advanced features, or getting up and running quickly, you'll find working code you can adapt to your needs.
@@ -16,10 +16,10 @@ Each guide focuses on a specific use case with practical examples. The goal is t
Quick integration guides to get up and running:
-
+
Get Honcho running with a single prompt in Claude Code
-
+
Add persistent memory and theory of mind to your LangGraph agents
@@ -28,10 +28,10 @@ Quick integration guides to get up and running:
Ready-to-use integration patterns for popular platforms:
-
+
Build a Discord bot that remembers users across conversations
-
+
Create a Telegram bot with persistent user understanding
diff --git a/docs/v2.6.0-alpha/guides/storing-data.mdx b/docs/v2.6.0-alpha/guides/storing-data.mdx
index 7f280473..4d49e744 100644
--- a/docs/v2.6.0-alpha/guides/storing-data.mdx
+++ b/docs/v2.6.0-alpha/guides/storing-data.mdx
@@ -42,7 +42,7 @@ Once a `Message` is saved in Honcho, it will kick off a background task that
looks at the new data to generate insights about the `Peer` that sent the `Message`
This is the default behavior of Honcho and can be turned off by [configuring the
-Peer or Session](/v2/documentation/core-concepts/configuration)
+Peer or Session](/v2.6.0-alpha/documentation/core-concepts/configuration)
This pattern of having a Peer, Session, and Messages is highly flexible and
works for many different use cases and agent setups. Some use cases may only
diff --git a/docs/v2/documentation/core-concepts/features/dialectic-endpoint.mdx b/docs/v2/documentation/core-concepts/features/dialectic-endpoint.mdx
index add5921f..86f04a92 100644
--- a/docs/v2/documentation/core-concepts/features/dialectic-endpoint.mdx
+++ b/docs/v2/documentation/core-concepts/features/dialectic-endpoint.mdx
@@ -84,4 +84,4 @@ for await (const line of responseStream.iter_text()) {
```
-We've designed the Dialectic endpoint to be infinitely flexible. We wrote an incomplete list of ideas on how to use it on our blog [here](https://blog.plasticlabs.ai/blog/Introducing-Honcho's-Dialectic-API#how-it-works).
+We've designed the Dialectic endpoint to be infinitely flexible. We wrote an incomplete list of ideas on how to use it on our blog [here](https://blog.plasticlabs.ai/archive/ARCHIVED;-Introducing-Honcho's-Dialectic-API#how-it-works).
diff --git a/docs/v2/documentation/reference/platform.mdx b/docs/v2/documentation/reference/platform.mdx
index 426af86f..0c666a5b 100644
--- a/docs/v2/documentation/reference/platform.mdx
+++ b/docs/v2/documentation/reference/platform.mdx
@@ -26,38 +26,32 @@ prompting you to create a new one.
-Once you've created an organization, you'll be taken to the dashboard and see
-the Welcome page with integration guidance and links to documentation.
+Once you've created an organization, you'll be taken to the welcome dashboard.
-Each organization has dedicated infrastructure running to isolate your
-workloads. Once you add a valid payment method under the
+Each organization has dedicated infrastructure running to isolate your workloads.
+Once you add a valid payment method under the
[Billing](https://app.honcho.dev/billing) page, your instance will turn on.
## 2. Activate your Honcho instance
-Navigate to the [Billing](https://app.honcho.dev/billing) page to add a payment method. Your Honcho instance provisions automatically, and you can monitor the deployment on the [Instance Status](https://app.honcho.dev/status) page until all systems show a green check mark.
+With credits and a payment method on file (managed via the [Billing](https://app.honcho.dev/billing) page), your Honcho instance will be provisioned and ready to use. Monitor your machine status, and check for version upgrades on the [Instance Status](https://app.honcho.dev/status) page.
-You can also upgrade Honcho when new versions are made available directly from the status page.
+If there is an upgrade available you will see an indicator like this:
-
-The **Performance** page provides comprehensive monitoring with usage metrics, health analytics, API response times, and endpoint usage across Honcho.
-
-
-
-
+Upgrading your machines may take a few minutes and you can monitor progress. If for any reason your machine goes offline, you will see a red status indicator. Navigate to the [Instance Status](https://app.honcho.dev/status) page and try to trigger a refresh of your machines.
## 3. Manage API Keys
The [API Keys](https://app.honcho.dev/api-keys) page allows you to create and manage authentication tokens for different environments. You can create admin-level keys with full instance access or scope keys to specific `Workspaces`, `Peers`, or `Sessions`.
@@ -67,12 +61,48 @@ The [API Keys](https://app.honcho.dev/api-keys) page allows you to create and ma
## 4. Test with API Playground
-The [API Playground](https://app.honcho.dev/playground) provides a Postman-like interface to test queries, explore endpoints, and validate your integration. Authenticate with an API key and send requests directly to your Honcho instance with real-time responses and full request/response logging.
+The [API Playground](https://app.honcho.dev/playground) provides a developer-friendly interface to quickly iterate and test queries, explore endpoints, and validate your integration directly from your browser—no code required.
+
+The playground automatically loads all available API endpoints to match your Honcho instance version. Endpoints can be filtered by category at the top of the list.
+
+If you prefer, you can set up your queries in the UI and copy to cURL for help with building scripts or general terminal use.
+
+### Step-by-Step:
+
+**1. Select an Endpoint**: Choose your desired endpoint from the available list.
+
+**2. Choose Path Parameters**: For fields like Workspace, Session, or Peer, select options from dropdown menus—no need to manually enter IDs.
+
+**3. Add Request Body Data**: Complete any required fields for POST/PUT requests.
+
+**4. Execute or Copy Request**: Run it directly or copy as cURL to use elsewhere (just add your API key).
+
+
+### Example Usage
+
+Build a complete conversation flow without ever leaving the playground:
+
+1. **Create a Workspace**:
+ select `POST Get or Create Workspace` and type workspace name into the request body
+ → Returns workspace ID
+
+2. **Create new Peer(s)**:
+ select `POST Get or Create Peer,` choose your workspace from the dropdown, and type peer name into the request body. (repeat for each peer)
+ → Returns peer ID
+
+3. **POST Get or Create Session**
+ `POST /sessions` selecting your workspace from the dropdown then type session name into the request body
+ → Returns session ID and adds to dropdown
+
+4. **POST Create Messages for Session**
+ `POST /messages` selecting your workspace & session from the dropdown then type peer id(s) and message content into the request body
+ → Adds message(s) to the session
+
## 5. Workspaces
The [Explore](https://app.honcho.dev/explore) page provides comprehensive `Workspace` management where you can create workspaces and begin exploring the platform. Each `Workspace` serves as a container for organizing your Honcho data.
@@ -137,14 +167,27 @@ Here you can:
-## 8. Webhooks Integration
-The [Webhooks](https://app.honcho.dev/webhooks) page enables Webhook creation and management.
+## 8. Performance Monitoring & Analytics
+
+The **Performance** page offers comprehensive monitoring tools, including usage metrics, health analytics, API response times, and endpoint usage across Honcho.
+
+
+
+
+
+## 9. Webhooks Integration
+
+The [Webhooks](https://app.honcho.dev/webhooks) page allows managing and creation of webhooks for Honcho. React to events in real-time—such as message delivery, session updates, peer state changes, and more—by sending event payloads via HTTP POST requests to your provided endpoints.
+
+
+
+
+## 10. Organization Member Access
-## 9. Organization Member Access
The [Members](https://app.honcho.dev/members) page provides organization administration to manage your team's access to Honcho with the ability to grant admin permissions.
diff --git a/docs/v2/openapi.json b/docs/v2/openapi.json
index bca1b8e9..971277cc 100644
--- a/docs/v2/openapi.json
+++ b/docs/v2/openapi.json
@@ -9,14 +9,17 @@
"url": "https://honcho.dev/",
"email": "hello@plasticlabs.ai"
},
- "version": "2.5.0"
+ "version": "2.5.1"
},
"servers": [
{
"url": "http://localhost:8000",
"description": "Local Development Server"
},
- { "url": "https://demo.honcho.dev", "description": "Demo Server" },
+ {
+ "url": "https://demo.honcho.dev",
+ "description": "Demo Server"
+ },
{
"url": "https://api.honcho.dev",
"description": "Production SaaS Platform"
@@ -25,7 +28,9 @@
"paths": {
"/v2/workspaces": {
"post": {
- "tags": ["workspaces"],
+ "tags": [
+ "workspaces"
+ ],
"summary": "Get Or Create Workspace",
"description": "Get a Workspace by ID.\n\nIf workspace_id is provided as a query parameter, it uses that (must match JWT workspace_id).\nOtherwise, it uses the workspace_id from the JWT.",
"operationId": "get_or_create_workspace_v2_workspaces_post",
@@ -45,7 +50,9 @@
"description": "Successful Response",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/Workspace" }
+ "schema": {
+ "$ref": "#/components/schemas/Workspace"
+ }
}
}
},
@@ -53,21 +60,33 @@
"description": "Validation Error",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
}
}
}
},
- "security": [{ "HTTPBearer": [] }]
+ "security": [
+ {
+ "HTTPBearer": []
+ }
+ ]
}
},
"/v2/workspaces/list": {
"post": {
- "tags": ["workspaces"],
+ "tags": [
+ "workspaces"
+ ],
"summary": "Get All Workspaces",
"description": "Get all Workspaces",
"operationId": "get_all_workspaces_v2_workspaces_list_post",
- "security": [{ "HTTPBearer": [] }],
+ "security": [
+ {
+ "HTTPBearer": []
+ }
+ ],
"parameters": [
{
"name": "page",
@@ -102,8 +121,12 @@
"application/json": {
"schema": {
"anyOf": [
- { "$ref": "#/components/schemas/WorkspaceGet" },
- { "type": "null" }
+ {
+ "$ref": "#/components/schemas/WorkspaceGet"
+ },
+ {
+ "type": "null"
+ }
],
"description": "Filtering and pagination options for the workspaces list",
"title": "Options"
@@ -116,7 +139,9 @@
"description": "Successful Response",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/Page_Workspace_" }
+ "schema": {
+ "$ref": "#/components/schemas/Page_Workspace_"
+ }
}
}
},
@@ -124,7 +149,9 @@
"description": "Validation Error",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
}
}
}
@@ -133,11 +160,17 @@
},
"/v2/workspaces/{workspace_id}": {
"put": {
- "tags": ["workspaces"],
+ "tags": [
+ "workspaces"
+ ],
"summary": "Update Workspace",
"description": "Update a Workspace",
"operationId": "update_workspace_v2_workspaces__workspace_id__put",
- "security": [{ "HTTPBearer": [] }],
+ "security": [
+ {
+ "HTTPBearer": []
+ }
+ ],
"parameters": [
{
"name": "workspace_id",
@@ -167,7 +200,9 @@
"description": "Successful Response",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/Workspace" }
+ "schema": {
+ "$ref": "#/components/schemas/Workspace"
+ }
}
}
},
@@ -175,18 +210,26 @@
"description": "Validation Error",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
}
}
}
}
},
"delete": {
- "tags": ["workspaces"],
+ "tags": [
+ "workspaces"
+ ],
"summary": "Delete Workspace",
"description": "Delete a Workspace",
"operationId": "delete_workspace_v2_workspaces__workspace_id__delete",
- "security": [{ "HTTPBearer": [] }],
+ "security": [
+ {
+ "HTTPBearer": []
+ }
+ ],
"parameters": [
{
"name": "workspace_id",
@@ -205,7 +248,9 @@
"description": "Successful Response",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/Workspace" }
+ "schema": {
+ "$ref": "#/components/schemas/Workspace"
+ }
}
}
},
@@ -213,7 +258,9 @@
"description": "Validation Error",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
}
}
}
@@ -222,11 +269,17 @@
},
"/v2/workspaces/{workspace_id}/search": {
"post": {
- "tags": ["workspaces"],
+ "tags": [
+ "workspaces"
+ ],
"summary": "Search Workspace",
"description": "Search a Workspace",
"operationId": "search_workspace_v2_workspaces__workspace_id__search_post",
- "security": [{ "HTTPBearer": [] }],
+ "security": [
+ {
+ "HTTPBearer": []
+ }
+ ],
"parameters": [
{
"name": "workspace_id",
@@ -258,7 +311,9 @@
"application/json": {
"schema": {
"type": "array",
- "items": { "$ref": "#/components/schemas/Message" },
+ "items": {
+ "$ref": "#/components/schemas/Message"
+ },
"title": "Response Search Workspace V2 Workspaces Workspace Id Search Post"
}
}
@@ -268,7 +323,9 @@
"description": "Validation Error",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
}
}
}
@@ -277,11 +334,17 @@
},
"/v2/workspaces/{workspace_id}/deriver/status": {
"get": {
- "tags": ["workspaces"],
+ "tags": [
+ "workspaces"
+ ],
"summary": "Get Deriver Status",
"description": "Get the deriver processing status, optionally scoped to an observer, sender, and/or session",
"operationId": "get_deriver_status_v2_workspaces__workspace_id__deriver_status_get",
- "security": [{ "HTTPBearer": [] }],
+ "security": [
+ {
+ "HTTPBearer": []
+ }
+ ],
"parameters": [
{
"name": "workspace_id",
@@ -299,7 +362,14 @@
"in": "query",
"required": false,
"schema": {
- "anyOf": [{ "type": "string" }, { "type": "null" }],
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
"description": "Optional observer ID to filter by",
"title": "Observer Id"
},
@@ -310,7 +380,14 @@
"in": "query",
"required": false,
"schema": {
- "anyOf": [{ "type": "string" }, { "type": "null" }],
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
"description": "Optional sender ID to filter by",
"title": "Sender Id"
},
@@ -321,7 +398,14 @@
"in": "query",
"required": false,
"schema": {
- "anyOf": [{ "type": "string" }, { "type": "null" }],
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
"description": "Optional session ID to filter by",
"title": "Session Id"
},
@@ -333,7 +417,9 @@
"description": "Successful Response",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/DeriverStatus" }
+ "schema": {
+ "$ref": "#/components/schemas/DeriverStatus"
+ }
}
}
},
@@ -341,7 +427,9 @@
"description": "Validation Error",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
}
}
}
@@ -350,11 +438,17 @@
},
"/v2/workspaces/{workspace_id}/trigger_dream": {
"post": {
- "tags": ["workspaces"],
+ "tags": [
+ "workspaces"
+ ],
"summary": "Trigger Dream",
"description": "Manually trigger a dream task immediately for a specific collection.\n\nThis endpoint bypasses all automatic dream conditions (document threshold,\nminimum hours between dreams) and executes the dream task immediately without delay.",
"operationId": "trigger_dream_v2_workspaces__workspace_id__trigger_dream_post",
- "security": [{ "HTTPBearer": [] }],
+ "security": [
+ {
+ "HTTPBearer": []
+ }
+ ],
"parameters": [
{
"name": "workspace_id",
@@ -380,12 +474,16 @@
}
},
"responses": {
- "204": { "description": "Successful Response" },
+ "204": {
+ "description": "Successful Response"
+ },
"422": {
"description": "Validation Error",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
}
}
}
@@ -394,11 +492,17 @@
},
"/v2/workspaces/{workspace_id}/peers/list": {
"post": {
- "tags": ["peers"],
+ "tags": [
+ "peers"
+ ],
"summary": "Get Peers",
"description": "Get All Peers for a Workspace",
"operationId": "get_peers_v2_workspaces__workspace_id__peers_list_post",
- "security": [{ "HTTPBearer": [] }],
+ "security": [
+ {
+ "HTTPBearer": []
+ }
+ ],
"parameters": [
{
"name": "workspace_id",
@@ -444,8 +548,12 @@
"application/json": {
"schema": {
"anyOf": [
- { "$ref": "#/components/schemas/PeerGet" },
- { "type": "null" }
+ {
+ "$ref": "#/components/schemas/PeerGet"
+ },
+ {
+ "type": "null"
+ }
],
"description": "Filtering options for the peers list",
"title": "Options"
@@ -458,7 +566,9 @@
"description": "Successful Response",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/Page_Peer_" }
+ "schema": {
+ "$ref": "#/components/schemas/Page_Peer_"
+ }
}
}
},
@@ -466,7 +576,9 @@
"description": "Validation Error",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
}
}
}
@@ -475,11 +587,17 @@
},
"/v2/workspaces/{workspace_id}/peers": {
"post": {
- "tags": ["peers"],
+ "tags": [
+ "peers"
+ ],
"summary": "Get Or Create Peer",
"description": "Get a Peer by ID\n\nIf peer_id is provided as a query parameter, it uses that (must match JWT workspace_id).\nOtherwise, it uses the peer_id from the JWT.",
"operationId": "get_or_create_peer_v2_workspaces__workspace_id__peers_post",
- "security": [{ "HTTPBearer": [] }],
+ "security": [
+ {
+ "HTTPBearer": []
+ }
+ ],
"parameters": [
{
"name": "workspace_id",
@@ -509,7 +627,9 @@
"description": "Successful Response",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/Peer" }
+ "schema": {
+ "$ref": "#/components/schemas/Peer"
+ }
}
}
},
@@ -517,7 +637,9 @@
"description": "Validation Error",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
}
}
}
@@ -526,11 +648,17 @@
},
"/v2/workspaces/{workspace_id}/peers/{peer_id}": {
"put": {
- "tags": ["peers"],
+ "tags": [
+ "peers"
+ ],
"summary": "Update Peer",
"description": "Update a Peer's name and/or metadata",
"operationId": "update_peer_v2_workspaces__workspace_id__peers__peer_id__put",
- "security": [{ "HTTPBearer": [] }],
+ "security": [
+ {
+ "HTTPBearer": []
+ }
+ ],
"parameters": [
{
"name": "workspace_id",
@@ -571,7 +699,9 @@
"description": "Successful Response",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/Peer" }
+ "schema": {
+ "$ref": "#/components/schemas/Peer"
+ }
}
}
},
@@ -579,7 +709,9 @@
"description": "Validation Error",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
}
}
}
@@ -588,11 +720,17 @@
},
"/v2/workspaces/{workspace_id}/peers/{peer_id}/sessions": {
"post": {
- "tags": ["peers"],
+ "tags": [
+ "peers"
+ ],
"summary": "Get Sessions For Peer",
"description": "Get All Sessions for a Peer",
"operationId": "get_sessions_for_peer_v2_workspaces__workspace_id__peers__peer_id__sessions_post",
- "security": [{ "HTTPBearer": [] }],
+ "security": [
+ {
+ "HTTPBearer": []
+ }
+ ],
"parameters": [
{
"name": "workspace_id",
@@ -649,8 +787,12 @@
"application/json": {
"schema": {
"anyOf": [
- { "$ref": "#/components/schemas/SessionGet" },
- { "type": "null" }
+ {
+ "$ref": "#/components/schemas/SessionGet"
+ },
+ {
+ "type": "null"
+ }
],
"description": "Filtering options for the sessions list",
"title": "Options"
@@ -663,7 +805,9 @@
"description": "Successful Response",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/Page_Session_" }
+ "schema": {
+ "$ref": "#/components/schemas/Page_Session_"
+ }
}
}
},
@@ -671,7 +815,9 @@
"description": "Validation Error",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
}
}
}
@@ -680,10 +826,16 @@
},
"/v2/workspaces/{workspace_id}/peers/{peer_id}/chat": {
"post": {
- "tags": ["peers"],
+ "tags": [
+ "peers"
+ ],
"summary": "Chat",
"operationId": "chat_v2_workspaces__workspace_id__peers__peer_id__chat_post",
- "security": [{ "HTTPBearer": [] }],
+ "security": [
+ {
+ "HTTPBearer": []
+ }
+ ],
"parameters": [
{
"name": "workspace_id",
@@ -726,9 +878,14 @@
"application/json": {
"schema": {
"properties": {
- "content": { "title": "Content", "type": "string" }
+ "content": {
+ "title": "Content",
+ "type": "string"
+ }
},
- "required": ["content"],
+ "required": [
+ "content"
+ ],
"title": "DialecticResponse",
"type": "object"
}
@@ -740,7 +897,9 @@
"description": "Validation Error",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
}
}
}
@@ -749,11 +908,17 @@
},
"/v2/workspaces/{workspace_id}/peers/{peer_id}/representation": {
"post": {
- "tags": ["peers"],
+ "tags": [
+ "peers"
+ ],
"summary": "Get Working Representation",
"description": "Get a peer's working representation for a session.\n\nIf a session_id is provided in the body, we get the working representation of the peer in that session.\nIf a target is provided, we get the representation of the target from the perspective of the peer.\nIf no target is provided, we get the omniscient Honcho representation of the peer.",
"operationId": "get_working_representation_v2_workspaces__workspace_id__peers__peer_id__representation_post",
- "security": [{ "HTTPBearer": [] }],
+ "security": [
+ {
+ "HTTPBearer": []
+ }
+ ],
"parameters": [
{
"name": "workspace_id",
@@ -806,7 +971,9 @@
"description": "Validation Error",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
}
}
}
@@ -815,11 +982,17 @@
},
"/v2/workspaces/{workspace_id}/peers/{peer_id}/card": {
"get": {
- "tags": ["peers"],
+ "tags": [
+ "peers"
+ ],
"summary": "Get Peer Card",
"description": "Get a peer card for a specific peer relationship.\n\nReturns the peer card that the observer peer has for the target peer if it exists.\nIf no target is specified, returns the observer's own peer card.",
"operationId": "get_peer_card_v2_workspaces__workspace_id__peers__peer_id__card_get",
- "security": [{ "HTTPBearer": [] }],
+ "security": [
+ {
+ "HTTPBearer": []
+ }
+ ],
"parameters": [
{
"name": "workspace_id",
@@ -848,7 +1021,14 @@
"in": "query",
"required": false,
"schema": {
- "anyOf": [{ "type": "string" }, { "type": "null" }],
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
"description": "The peer whose card to retrieve. If not provided, returns the observer's own card",
"title": "Target"
},
@@ -860,7 +1040,9 @@
"description": "Successful Response",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/PeerCardResponse" }
+ "schema": {
+ "$ref": "#/components/schemas/PeerCardResponse"
+ }
}
}
},
@@ -868,18 +1050,26 @@
"description": "Validation Error",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
}
}
}
}
},
"put": {
- "tags": ["peers"],
+ "tags": [
+ "peers"
+ ],
"summary": "Set Peer Card",
"description": "Set a peer card for a specific peer relationship.\n\nSets the peer card that the observer peer has for the target peer.\nIf no target is specified, sets the observer's own peer card.",
"operationId": "set_peer_card_v2_workspaces__workspace_id__peers__peer_id__card_put",
- "security": [{ "HTTPBearer": [] }],
+ "security": [
+ {
+ "HTTPBearer": []
+ }
+ ],
"parameters": [
{
"name": "workspace_id",
@@ -908,7 +1098,14 @@
"in": "query",
"required": false,
"schema": {
- "anyOf": [{ "type": "string" }, { "type": "null" }],
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
"description": "The peer whose card to set. If not provided, sets the observer's own card",
"title": "Target"
},
@@ -931,7 +1128,9 @@
"description": "Successful Response",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/PeerCardResponse" }
+ "schema": {
+ "$ref": "#/components/schemas/PeerCardResponse"
+ }
}
}
},
@@ -939,7 +1138,9 @@
"description": "Validation Error",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
}
}
}
@@ -948,11 +1149,17 @@
},
"/v2/workspaces/{workspace_id}/peers/{peer_id}/context": {
"get": {
- "tags": ["peers"],
+ "tags": [
+ "peers"
+ ],
"summary": "Get Peer Context",
"description": "Get context for a peer, including their representation and peer card.\n\nThis endpoint returns the working representation and peer card for a peer.\nIf a target is specified, returns the context for the target from the\nobserver peer's perspective. If no target is specified, returns the\npeer's own context (self-observation).\n\nThis is useful for getting all the context needed about a peer without\nmaking multiple API calls.",
"operationId": "get_peer_context_v2_workspaces__workspace_id__peers__peer_id__context_get",
- "security": [{ "HTTPBearer": [] }],
+ "security": [
+ {
+ "HTTPBearer": []
+ }
+ ],
"parameters": [
{
"name": "workspace_id",
@@ -981,7 +1188,14 @@
"in": "query",
"required": false,
"schema": {
- "anyOf": [{ "type": "string" }, { "type": "null" }],
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
"description": "The target peer to get context for. If not provided, returns the peer's own context (self-observation)",
"title": "Target"
},
@@ -992,7 +1206,14 @@
"in": "query",
"required": false,
"schema": {
- "anyOf": [{ "type": "string" }, { "type": "null" }],
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
"description": "Optional query to curate the representation around semantic search results",
"title": "Search Query"
},
@@ -1004,8 +1225,14 @@
"required": false,
"schema": {
"anyOf": [
- { "type": "integer", "maximum": 100, "minimum": 1 },
- { "type": "null" }
+ {
+ "type": "integer",
+ "maximum": 100,
+ "minimum": 1
+ },
+ {
+ "type": "null"
+ }
],
"description": "Only used if `search_query` is provided. Number of semantic-search-retrieved observations to include",
"title": "Search Top K"
@@ -1018,8 +1245,14 @@
"required": false,
"schema": {
"anyOf": [
- { "type": "number", "maximum": 1.0, "minimum": 0.0 },
- { "type": "null" }
+ {
+ "type": "number",
+ "maximum": 1.0,
+ "minimum": 0.0
+ },
+ {
+ "type": "null"
+ }
],
"description": "Only used if `search_query` is provided. Maximum distance for semantically relevant observations",
"title": "Search Max Distance"
@@ -1044,8 +1277,14 @@
"required": false,
"schema": {
"anyOf": [
- { "type": "integer", "maximum": 100, "minimum": 1 },
- { "type": "null" }
+ {
+ "type": "integer",
+ "maximum": 100,
+ "minimum": 1
+ },
+ {
+ "type": "null"
+ }
],
"description": "Maximum number of observations to include in the representation",
"title": "Max Observations"
@@ -1058,7 +1297,9 @@
"description": "Successful Response",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/PeerContext" }
+ "schema": {
+ "$ref": "#/components/schemas/PeerContext"
+ }
}
}
},
@@ -1066,7 +1307,9 @@
"description": "Validation Error",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
}
}
}
@@ -1075,11 +1318,17 @@
},
"/v2/workspaces/{workspace_id}/peers/{peer_id}/search": {
"post": {
- "tags": ["peers"],
+ "tags": [
+ "peers"
+ ],
"summary": "Search Peer",
"description": "Search a Peer",
"operationId": "search_peer_v2_workspaces__workspace_id__peers__peer_id__search_post",
- "security": [{ "HTTPBearer": [] }],
+ "security": [
+ {
+ "HTTPBearer": []
+ }
+ ],
"parameters": [
{
"name": "workspace_id",
@@ -1122,7 +1371,9 @@
"application/json": {
"schema": {
"type": "array",
- "items": { "$ref": "#/components/schemas/Message" },
+ "items": {
+ "$ref": "#/components/schemas/Message"
+ },
"title": "Response Search Peer V2 Workspaces Workspace Id Peers Peer Id Search Post"
}
}
@@ -1132,7 +1383,9 @@
"description": "Validation Error",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
}
}
}
@@ -1141,11 +1394,17 @@
},
"/v2/workspaces/{workspace_id}/sessions": {
"post": {
- "tags": ["sessions"],
+ "tags": [
+ "sessions"
+ ],
"summary": "Get Or Create Session",
"description": "Get a specific session in a workspace.\n\nIf session_id is provided as a query parameter, it verifies the session is in the workspace.\nOtherwise, it uses the session_id from the JWT for verification.",
"operationId": "get_or_create_session_v2_workspaces__workspace_id__sessions_post",
- "security": [{ "HTTPBearer": [] }],
+ "security": [
+ {
+ "HTTPBearer": []
+ }
+ ],
"parameters": [
{
"name": "workspace_id",
@@ -1175,7 +1434,9 @@
"description": "Successful Response",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/Session" }
+ "schema": {
+ "$ref": "#/components/schemas/Session"
+ }
}
}
},
@@ -1183,7 +1444,9 @@
"description": "Validation Error",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
}
}
}
@@ -1192,11 +1455,17 @@
},
"/v2/workspaces/{workspace_id}/sessions/list": {
"post": {
- "tags": ["sessions"],
+ "tags": [
+ "sessions"
+ ],
"summary": "Get Sessions",
"description": "Get All Sessions in a Workspace",
"operationId": "get_sessions_v2_workspaces__workspace_id__sessions_list_post",
- "security": [{ "HTTPBearer": [] }],
+ "security": [
+ {
+ "HTTPBearer": []
+ }
+ ],
"parameters": [
{
"name": "workspace_id",
@@ -1242,8 +1511,12 @@
"application/json": {
"schema": {
"anyOf": [
- { "$ref": "#/components/schemas/SessionGet" },
- { "type": "null" }
+ {
+ "$ref": "#/components/schemas/SessionGet"
+ },
+ {
+ "type": "null"
+ }
],
"description": "Filtering and pagination options for the sessions list",
"title": "Options"
@@ -1256,7 +1529,9 @@
"description": "Successful Response",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/Page_Session_" }
+ "schema": {
+ "$ref": "#/components/schemas/Page_Session_"
+ }
}
}
},
@@ -1264,7 +1539,9 @@
"description": "Validation Error",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
}
}
}
@@ -1273,11 +1550,17 @@
},
"/v2/workspaces/{workspace_id}/sessions/{session_id}": {
"put": {
- "tags": ["sessions"],
+ "tags": [
+ "sessions"
+ ],
"summary": "Update Session",
"description": "Update the metadata of a Session",
"operationId": "update_session_v2_workspaces__workspace_id__sessions__session_id__put",
- "security": [{ "HTTPBearer": [] }],
+ "security": [
+ {
+ "HTTPBearer": []
+ }
+ ],
"parameters": [
{
"name": "workspace_id",
@@ -1318,7 +1601,9 @@
"description": "Successful Response",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/Session" }
+ "schema": {
+ "$ref": "#/components/schemas/Session"
+ }
}
}
},
@@ -1326,18 +1611,26 @@
"description": "Validation Error",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
}
}
}
}
},
"delete": {
- "tags": ["sessions"],
+ "tags": [
+ "sessions"
+ ],
"summary": "Delete Session",
"description": "Delete a session and all associated data.\n\nThe session is marked as inactive immediately and returns 202 Accepted. The actual\ndeletion of all related data (messages, embeddings, documents, etc.) happens\nasynchronously via the queue with retry support.\n\nThis action cannot be undone.",
"operationId": "delete_session_v2_workspaces__workspace_id__sessions__session_id__delete",
- "security": [{ "HTTPBearer": [] }],
+ "security": [
+ {
+ "HTTPBearer": []
+ }
+ ],
"parameters": [
{
"name": "workspace_id",
@@ -1365,13 +1658,19 @@
"responses": {
"202": {
"description": "Successful Response",
- "content": { "application/json": { "schema": {} } }
+ "content": {
+ "application/json": {
+ "schema": {}
+ }
+ }
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
}
}
}
@@ -1380,11 +1679,17 @@
},
"/v2/workspaces/{workspace_id}/sessions/{session_id}/clone": {
"get": {
- "tags": ["sessions"],
+ "tags": [
+ "sessions"
+ ],
"summary": "Clone Session",
"description": "Clone a session, optionally up to a specific message",
"operationId": "clone_session_v2_workspaces__workspace_id__sessions__session_id__clone_get",
- "security": [{ "HTTPBearer": [] }],
+ "security": [
+ {
+ "HTTPBearer": []
+ }
+ ],
"parameters": [
{
"name": "workspace_id",
@@ -1413,7 +1718,14 @@
"in": "query",
"required": false,
"schema": {
- "anyOf": [{ "type": "string" }, { "type": "null" }],
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
"description": "Message ID to cut off the clone at",
"title": "Message Id"
},
@@ -1425,7 +1737,9 @@
"description": "Successful Response",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/Session" }
+ "schema": {
+ "$ref": "#/components/schemas/Session"
+ }
}
}
},
@@ -1433,7 +1747,9 @@
"description": "Validation Error",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
}
}
}
@@ -1442,11 +1758,17 @@
},
"/v2/workspaces/{workspace_id}/sessions/{session_id}/peers": {
"post": {
- "tags": ["sessions"],
+ "tags": [
+ "sessions"
+ ],
"summary": "Add Peers To Session",
"description": "Add peers to a session",
"operationId": "add_peers_to_session_v2_workspaces__workspace_id__sessions__session_id__peers_post",
- "security": [{ "HTTPBearer": [] }],
+ "security": [
+ {
+ "HTTPBearer": []
+ }
+ ],
"parameters": [
{
"name": "workspace_id",
@@ -1491,7 +1813,9 @@
"description": "Successful Response",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/Session" }
+ "schema": {
+ "$ref": "#/components/schemas/Session"
+ }
}
}
},
@@ -1499,18 +1823,26 @@
"description": "Validation Error",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
}
}
}
}
},
"put": {
- "tags": ["sessions"],
+ "tags": [
+ "sessions"
+ ],
"summary": "Set Session Peers",
"description": "Set the peers in a session",
"operationId": "set_session_peers_v2_workspaces__workspace_id__sessions__session_id__peers_put",
- "security": [{ "HTTPBearer": [] }],
+ "security": [
+ {
+ "HTTPBearer": []
+ }
+ ],
"parameters": [
{
"name": "workspace_id",
@@ -1555,7 +1887,9 @@
"description": "Successful Response",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/Session" }
+ "schema": {
+ "$ref": "#/components/schemas/Session"
+ }
}
}
},
@@ -1563,18 +1897,26 @@
"description": "Validation Error",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
}
}
}
}
},
"delete": {
- "tags": ["sessions"],
+ "tags": [
+ "sessions"
+ ],
"summary": "Remove Peers From Session",
"description": "Remove peers from a session",
"operationId": "remove_peers_from_session_v2_workspaces__workspace_id__sessions__session_id__peers_delete",
- "security": [{ "HTTPBearer": [] }],
+ "security": [
+ {
+ "HTTPBearer": []
+ }
+ ],
"parameters": [
{
"name": "workspace_id",
@@ -1605,7 +1947,9 @@
"application/json": {
"schema": {
"type": "array",
- "items": { "type": "string" },
+ "items": {
+ "type": "string"
+ },
"description": "List of peer IDs to remove from the session",
"title": "Peers"
}
@@ -1617,7 +1961,9 @@
"description": "Successful Response",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/Session" }
+ "schema": {
+ "$ref": "#/components/schemas/Session"
+ }
}
}
},
@@ -1625,18 +1971,26 @@
"description": "Validation Error",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
}
}
}
}
},
"get": {
- "tags": ["sessions"],
+ "tags": [
+ "sessions"
+ ],
"summary": "Get Session Peers",
"description": "Get peers from a session",
"operationId": "get_session_peers_v2_workspaces__workspace_id__sessions__session_id__peers_get",
- "security": [{ "HTTPBearer": [] }],
+ "security": [
+ {
+ "HTTPBearer": []
+ }
+ ],
"parameters": [
{
"name": "workspace_id",
@@ -1693,7 +2047,9 @@
"description": "Successful Response",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/Page_Peer_" }
+ "schema": {
+ "$ref": "#/components/schemas/Page_Peer_"
+ }
}
}
},
@@ -1701,7 +2057,9 @@
"description": "Validation Error",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
}
}
}
@@ -1710,11 +2068,17 @@
},
"/v2/workspaces/{workspace_id}/sessions/{session_id}/peers/{peer_id}/config": {
"get": {
- "tags": ["sessions"],
+ "tags": [
+ "sessions"
+ ],
"summary": "Get Peer Config",
"description": "Get the configuration for a peer in a session",
"operationId": "get_peer_config_v2_workspaces__workspace_id__sessions__session_id__peers__peer_id__config_get",
- "security": [{ "HTTPBearer": [] }],
+ "security": [
+ {
+ "HTTPBearer": []
+ }
+ ],
"parameters": [
{
"name": "workspace_id",
@@ -1755,7 +2119,9 @@
"description": "Successful Response",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/SessionPeerConfig" }
+ "schema": {
+ "$ref": "#/components/schemas/SessionPeerConfig"
+ }
}
}
},
@@ -1763,18 +2129,26 @@
"description": "Validation Error",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
}
}
}
}
},
"post": {
- "tags": ["sessions"],
+ "tags": [
+ "sessions"
+ ],
"summary": "Set Peer Config",
"description": "Set the configuration for a peer in a session",
"operationId": "set_peer_config_v2_workspaces__workspace_id__sessions__session_id__peers__peer_id__config_post",
- "security": [{ "HTTPBearer": [] }],
+ "security": [
+ {
+ "HTTPBearer": []
+ }
+ ],
"parameters": [
{
"name": "workspace_id",
@@ -1824,13 +2198,19 @@
"responses": {
"200": {
"description": "Successful Response",
- "content": { "application/json": { "schema": {} } }
+ "content": {
+ "application/json": {
+ "schema": {}
+ }
+ }
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
}
}
}
@@ -1839,11 +2219,17 @@
},
"/v2/workspaces/{workspace_id}/sessions/{session_id}/context": {
"get": {
- "tags": ["sessions"],
+ "tags": [
+ "sessions"
+ ],
"summary": "Get Session Context",
"description": "Produce a context object from the session. The caller provides an optional token limit which the entire context must fit into.\nIf not provided, the context will be exhaustive (within configured max tokens). To do this, we allocate 40% of the token limit\nto the summary, and 60% to recent messages -- as many as can fit. Note that the summary will usually take up less space than\nthis. If the caller does not want a summary, we allocate all the tokens to recent messages.",
"operationId": "get_session_context_v2_workspaces__workspace_id__sessions__session_id__context_get",
- "security": [{ "HTTPBearer": [] }],
+ "security": [
+ {
+ "HTTPBearer": []
+ }
+ ],
"parameters": [
{
"name": "workspace_id",
@@ -1873,8 +2259,13 @@
"required": false,
"schema": {
"anyOf": [
- { "type": "integer", "maximum": 100000 },
- { "type": "null" }
+ {
+ "type": "integer",
+ "maximum": 100000
+ },
+ {
+ "type": "null"
+ }
],
"description": "Number of tokens to use for the context. Includes summary if set to true. Includes representation and peer card if they are included in the response. If not provided, the context will be exhaustive (within 100000 tokens)",
"title": "Tokens"
@@ -1886,7 +2277,14 @@
"in": "query",
"required": false,
"schema": {
- "anyOf": [{ "type": "string" }, { "type": "null" }],
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
"description": "The most recent message, used to fetch semantically relevant observations",
"title": "Last Message"
},
@@ -1909,7 +2307,14 @@
"in": "query",
"required": false,
"schema": {
- "anyOf": [{ "type": "string" }, { "type": "null" }],
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
"description": "The target of the perspective. If given without `peer_perspective`, will get the Honcho-level representation and peer card for this peer. If given with `peer_perspective`, will get the representation and card for this peer *from the perspective of that peer*.",
"title": "Peer Target"
},
@@ -1920,7 +2325,14 @@
"in": "query",
"required": false,
"schema": {
- "anyOf": [{ "type": "string" }, { "type": "null" }],
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
"description": "A peer to get context for. If given, response will attempt to include representation and card from the perspective of that peer. Must be provided with `peer_target`.",
"title": "Peer Perspective"
},
@@ -1944,8 +2356,14 @@
"required": false,
"schema": {
"anyOf": [
- { "type": "integer", "maximum": 100, "minimum": 1 },
- { "type": "null" }
+ {
+ "type": "integer",
+ "maximum": 100,
+ "minimum": 1
+ },
+ {
+ "type": "null"
+ }
],
"description": "Only used if `last_message` is provided. The number of semantic-search-retrieved observations to include in the representation",
"title": "Search Top K"
@@ -1958,8 +2376,14 @@
"required": false,
"schema": {
"anyOf": [
- { "type": "number", "maximum": 1.0, "minimum": 0.0 },
- { "type": "null" }
+ {
+ "type": "number",
+ "maximum": 1.0,
+ "minimum": 0.0
+ },
+ {
+ "type": "null"
+ }
],
"description": "Only used if `last_message` is provided. The maximum distance to search for semantically relevant observations",
"title": "Search Max Distance"
@@ -1984,8 +2408,14 @@
"required": false,
"schema": {
"anyOf": [
- { "type": "integer", "maximum": 100, "minimum": 1 },
- { "type": "null" }
+ {
+ "type": "integer",
+ "maximum": 100,
+ "minimum": 1
+ },
+ {
+ "type": "null"
+ }
],
"description": "Only used if `last_message` is provided. The maximum number of observations to include in the representation",
"title": "Max Observations"
@@ -1998,7 +2428,9 @@
"description": "Successful Response",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/SessionContext" }
+ "schema": {
+ "$ref": "#/components/schemas/SessionContext"
+ }
}
}
},
@@ -2006,7 +2438,9 @@
"description": "Validation Error",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
}
}
}
@@ -2015,11 +2449,17 @@
},
"/v2/workspaces/{workspace_id}/sessions/{session_id}/summaries": {
"get": {
- "tags": ["sessions"],
+ "tags": [
+ "sessions"
+ ],
"summary": "Get Session Summaries",
"description": "Get available summaries for a session.\n\nReturns both short and long summaries if available, including metadata like\nthe message ID they cover up to, creation timestamp, and token count.",
"operationId": "get_session_summaries_v2_workspaces__workspace_id__sessions__session_id__summaries_get",
- "security": [{ "HTTPBearer": [] }],
+ "security": [
+ {
+ "HTTPBearer": []
+ }
+ ],
"parameters": [
{
"name": "workspace_id",
@@ -2049,7 +2489,9 @@
"description": "Successful Response",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/SessionSummaries" }
+ "schema": {
+ "$ref": "#/components/schemas/SessionSummaries"
+ }
}
}
},
@@ -2057,7 +2499,9 @@
"description": "Validation Error",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
}
}
}
@@ -2066,11 +2510,17 @@
},
"/v2/workspaces/{workspace_id}/sessions/{session_id}/search": {
"post": {
- "tags": ["sessions"],
+ "tags": [
+ "sessions"
+ ],
"summary": "Search Session",
"description": "Search a Session",
"operationId": "search_session_v2_workspaces__workspace_id__sessions__session_id__search_post",
- "security": [{ "HTTPBearer": [] }],
+ "security": [
+ {
+ "HTTPBearer": []
+ }
+ ],
"parameters": [
{
"name": "workspace_id",
@@ -2113,7 +2563,9 @@
"application/json": {
"schema": {
"type": "array",
- "items": { "$ref": "#/components/schemas/Message" },
+ "items": {
+ "$ref": "#/components/schemas/Message"
+ },
"title": "Response Search Session V2 Workspaces Workspace Id Sessions Session Id Search Post"
}
}
@@ -2123,7 +2575,9 @@
"description": "Validation Error",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
}
}
}
@@ -2132,30 +2586,44 @@
},
"/v2/workspaces/{workspace_id}/sessions/{session_id}/messages/": {
"post": {
- "tags": ["messages"],
+ "tags": [
+ "messages"
+ ],
"summary": "Create Messages For Session",
"description": "Add new message(s) to a session.",
"operationId": "create_messages_for_session_v2_workspaces__workspace_id__sessions__session_id__messages__post",
- "security": [{ "HTTPBearer": [] }],
+ "security": [
+ {
+ "HTTPBearer": []
+ }
+ ],
"parameters": [
{
"name": "workspace_id",
"in": "path",
"required": true,
- "schema": { "type": "string", "title": "Workspace Id" }
+ "schema": {
+ "type": "string",
+ "title": "Workspace Id"
+ }
},
{
"name": "session_id",
"in": "path",
"required": true,
- "schema": { "type": "string", "title": "Session Id" }
+ "schema": {
+ "type": "string",
+ "title": "Session Id"
+ }
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/MessageBatchCreate" }
+ "schema": {
+ "$ref": "#/components/schemas/MessageBatchCreate"
+ }
}
}
},
@@ -2166,7 +2634,9 @@
"application/json": {
"schema": {
"type": "array",
- "items": { "$ref": "#/components/schemas/Message" },
+ "items": {
+ "$ref": "#/components/schemas/Message"
+ },
"title": "Response Create Messages For Session V2 Workspaces Workspace Id Sessions Session Id Messages Post"
}
}
@@ -2176,7 +2646,9 @@
"description": "Validation Error",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
}
}
}
@@ -2185,23 +2657,35 @@
},
"/v2/workspaces/{workspace_id}/sessions/{session_id}/messages/upload": {
"post": {
- "tags": ["messages"],
+ "tags": [
+ "messages"
+ ],
"summary": "Create Messages With File",
"description": "Create messages from uploaded files. Files are converted to text and split into multiple messages.",
"operationId": "create_messages_with_file_v2_workspaces__workspace_id__sessions__session_id__messages_upload_post",
- "security": [{ "HTTPBearer": [] }],
+ "security": [
+ {
+ "HTTPBearer": []
+ }
+ ],
"parameters": [
{
"name": "workspace_id",
"in": "path",
"required": true,
- "schema": { "type": "string", "title": "Workspace Id" }
+ "schema": {
+ "type": "string",
+ "title": "Workspace Id"
+ }
},
{
"name": "session_id",
"in": "path",
"required": true,
- "schema": { "type": "string", "title": "Session Id" }
+ "schema": {
+ "type": "string",
+ "title": "Session Id"
+ }
}
],
"requestBody": {
@@ -2221,7 +2705,9 @@
"application/json": {
"schema": {
"type": "array",
- "items": { "$ref": "#/components/schemas/Message" },
+ "items": {
+ "$ref": "#/components/schemas/Message"
+ },
"title": "Response Create Messages With File V2 Workspaces Workspace Id Sessions Session Id Messages Upload Post"
}
}
@@ -2231,7 +2717,9 @@
"description": "Validation Error",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
}
}
}
@@ -2240,11 +2728,17 @@
},
"/v2/workspaces/{workspace_id}/sessions/{session_id}/messages/list": {
"post": {
- "tags": ["messages"],
+ "tags": [
+ "messages"
+ ],
"summary": "Get Messages",
"description": "Get all messages for a session",
"operationId": "get_messages_v2_workspaces__workspace_id__sessions__session_id__messages_list_post",
- "security": [{ "HTTPBearer": [] }],
+ "security": [
+ {
+ "HTTPBearer": []
+ }
+ ],
"parameters": [
{
"name": "workspace_id",
@@ -2273,7 +2767,14 @@
"in": "query",
"required": false,
"schema": {
- "anyOf": [{ "type": "boolean" }, { "type": "null" }],
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
"description": "Whether to reverse the order of results",
"default": false,
"title": "Reverse"
@@ -2313,8 +2814,12 @@
"application/json": {
"schema": {
"anyOf": [
- { "$ref": "#/components/schemas/MessageGet" },
- { "type": "null" }
+ {
+ "$ref": "#/components/schemas/MessageGet"
+ },
+ {
+ "type": "null"
+ }
],
"description": "Filtering options for the messages list",
"title": "Options"
@@ -2327,7 +2832,9 @@
"description": "Successful Response",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/Page_Message_" }
+ "schema": {
+ "$ref": "#/components/schemas/Page_Message_"
+ }
}
}
},
@@ -2335,7 +2842,9 @@
"description": "Validation Error",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
}
}
}
@@ -2344,11 +2853,17 @@
},
"/v2/workspaces/{workspace_id}/sessions/{session_id}/messages/{message_id}": {
"get": {
- "tags": ["messages"],
+ "tags": [
+ "messages"
+ ],
"summary": "Get Message",
"description": "Get a Message by ID",
"operationId": "get_message_v2_workspaces__workspace_id__sessions__session_id__messages__message_id__get",
- "security": [{ "HTTPBearer": [] }],
+ "security": [
+ {
+ "HTTPBearer": []
+ }
+ ],
"parameters": [
{
"name": "workspace_id",
@@ -2389,7 +2904,9 @@
"description": "Successful Response",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/Message" }
+ "schema": {
+ "$ref": "#/components/schemas/Message"
+ }
}
}
},
@@ -2397,18 +2914,26 @@
"description": "Validation Error",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
}
}
}
}
},
"put": {
- "tags": ["messages"],
+ "tags": [
+ "messages"
+ ],
"summary": "Update Message",
"description": "Update the metadata of a Message",
"operationId": "update_message_v2_workspaces__workspace_id__sessions__session_id__messages__message_id__put",
- "security": [{ "HTTPBearer": [] }],
+ "security": [
+ {
+ "HTTPBearer": []
+ }
+ ],
"parameters": [
{
"name": "workspace_id",
@@ -2460,7 +2985,9 @@
"description": "Successful Response",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/Message" }
+ "schema": {
+ "$ref": "#/components/schemas/Message"
+ }
}
}
},
@@ -2468,7 +2995,9 @@
"description": "Validation Error",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
}
}
}
@@ -2477,11 +3006,17 @@
},
"/v2/workspaces/{workspace_id}/observations": {
"post": {
- "tags": ["observations"],
+ "tags": [
+ "observations"
+ ],
"summary": "Create Observations",
"description": "Create one or more observations.\n\nCreates observations (theory-of-mind facts) for the specified observer/observed peer pairs.\nEach observation must reference existing peers and a session within the workspace.\nEmbeddings are automatically generated for semantic search.\n\nMaximum of 100 observations per request.",
"operationId": "create_observations_v2_workspaces__workspace_id__observations_post",
- "security": [{ "HTTPBearer": [] }],
+ "security": [
+ {
+ "HTTPBearer": []
+ }
+ ],
"parameters": [
{
"name": "workspace_id",
@@ -2513,7 +3048,9 @@
"application/json": {
"schema": {
"type": "array",
- "items": { "$ref": "#/components/schemas/Observation" },
+ "items": {
+ "$ref": "#/components/schemas/Observation"
+ },
"title": "Response Create Observations V2 Workspaces Workspace Id Observations Post"
}
}
@@ -2523,7 +3060,9 @@
"description": "Validation Error",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
}
}
}
@@ -2532,11 +3071,17 @@
},
"/v2/workspaces/{workspace_id}/observations/list": {
"post": {
- "tags": ["observations"],
+ "tags": [
+ "observations"
+ ],
"summary": "List Observations",
"description": "List all observations using custom filters. Observations are listed by recency unless `reverse` is set to `true`.\n\nObservations can be filtered by session_id, observer_id and observed_id using the filters parameter.",
"operationId": "list_observations_v2_workspaces__workspace_id__observations_list_post",
- "security": [{ "HTTPBearer": [] }],
+ "security": [
+ {
+ "HTTPBearer": []
+ }
+ ],
"parameters": [
{
"name": "workspace_id",
@@ -2554,7 +3099,14 @@
"in": "query",
"required": false,
"schema": {
- "anyOf": [{ "type": "boolean" }, { "type": "null" }],
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
"description": "Whether to reverse the order of results",
"default": false,
"title": "Reverse"
@@ -2594,8 +3146,12 @@
"application/json": {
"schema": {
"anyOf": [
- { "$ref": "#/components/schemas/ObservationGet" },
- { "type": "null" }
+ {
+ "$ref": "#/components/schemas/ObservationGet"
+ },
+ {
+ "type": "null"
+ }
],
"description": "Filtering options for the observations list",
"title": "Options"
@@ -2608,7 +3164,9 @@
"description": "Successful Response",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/Page_Observation_" }
+ "schema": {
+ "$ref": "#/components/schemas/Page_Observation_"
+ }
}
}
},
@@ -2616,7 +3174,9 @@
"description": "Validation Error",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
}
}
}
@@ -2625,11 +3185,17 @@
},
"/v2/workspaces/{workspace_id}/observations/query": {
"post": {
- "tags": ["observations"],
+ "tags": [
+ "observations"
+ ],
"summary": "Query Observations",
"description": "Query observations using semantic search.\n\nPerforms vector similarity search on observations to find semantically relevant results.\nObserver and observed are required for semantic search and must be provided in filters.",
"operationId": "query_observations_v2_workspaces__workspace_id__observations_query_post",
- "security": [{ "HTTPBearer": [] }],
+ "security": [
+ {
+ "HTTPBearer": []
+ }
+ ],
"parameters": [
{
"name": "workspace_id",
@@ -2661,7 +3227,9 @@
"application/json": {
"schema": {
"type": "array",
- "items": { "$ref": "#/components/schemas/Observation" },
+ "items": {
+ "$ref": "#/components/schemas/Observation"
+ },
"title": "Response Query Observations V2 Workspaces Workspace Id Observations Query Post"
}
}
@@ -2671,7 +3239,9 @@
"description": "Validation Error",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
}
}
}
@@ -2680,11 +3250,17 @@
},
"/v2/workspaces/{workspace_id}/observations/{observation_id}": {
"delete": {
- "tags": ["observations"],
+ "tags": [
+ "observations"
+ ],
"summary": "Delete Observation",
"description": "Delete a specific observation.\n\nThis permanently deletes the observation (document) from the theory-of-mind system.\nThis action cannot be undone.",
"operationId": "delete_observation_v2_workspaces__workspace_id__observations__observation_id__delete",
- "security": [{ "HTTPBearer": [] }],
+ "security": [
+ {
+ "HTTPBearer": []
+ }
+ ],
"parameters": [
{
"name": "workspace_id",
@@ -2712,13 +3288,19 @@
"responses": {
"200": {
"description": "Successful Response",
- "content": { "application/json": { "schema": {} } }
+ "content": {
+ "application/json": {
+ "schema": {}
+ }
+ }
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
}
}
}
@@ -2727,18 +3309,31 @@
},
"/v2/keys": {
"post": {
- "tags": ["keys"],
+ "tags": [
+ "keys"
+ ],
"summary": "Create Key",
"description": "Create a new Key",
"operationId": "create_key_v2_keys_post",
- "security": [{ "HTTPBearer": [] }],
+ "security": [
+ {
+ "HTTPBearer": []
+ }
+ ],
"parameters": [
{
"name": "workspace_id",
"in": "query",
"required": false,
"schema": {
- "anyOf": [{ "type": "string" }, { "type": "null" }],
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
"description": "ID of the workspace to scope the key to",
"title": "Workspace Id"
},
@@ -2749,7 +3344,14 @@
"in": "query",
"required": false,
"schema": {
- "anyOf": [{ "type": "string" }, { "type": "null" }],
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
"description": "ID of the peer to scope the key to",
"title": "Peer Id"
},
@@ -2760,7 +3362,14 @@
"in": "query",
"required": false,
"schema": {
- "anyOf": [{ "type": "string" }, { "type": "null" }],
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
"description": "ID of the session to scope the key to",
"title": "Session Id"
},
@@ -2772,8 +3381,13 @@
"required": false,
"schema": {
"anyOf": [
- { "type": "string", "format": "date-time" },
- { "type": "null" }
+ {
+ "type": "string",
+ "format": "date-time"
+ },
+ {
+ "type": "null"
+ }
],
"title": "Expires At"
}
@@ -2782,13 +3396,19 @@
"responses": {
"200": {
"description": "Successful Response",
- "content": { "application/json": { "schema": {} } }
+ "content": {
+ "application/json": {
+ "schema": {}
+ }
+ }
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
}
}
}
@@ -2797,11 +3417,17 @@
},
"/v2/workspaces/{workspace_id}/webhooks": {
"post": {
- "tags": ["webhooks"],
+ "tags": [
+ "webhooks"
+ ],
"summary": "Get Or Create Webhook Endpoint",
"description": "Get or create a webhook endpoint URL.",
"operationId": "get_or_create_webhook_endpoint_v2_workspaces__workspace_id__webhooks_post",
- "security": [{ "HTTPBearer": [] }],
+ "security": [
+ {
+ "HTTPBearer": []
+ }
+ ],
"parameters": [
{
"name": "workspace_id",
@@ -2831,7 +3457,9 @@
"description": "Successful Response",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/WebhookEndpoint" }
+ "schema": {
+ "$ref": "#/components/schemas/WebhookEndpoint"
+ }
}
}
},
@@ -2839,18 +3467,26 @@
"description": "Validation Error",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
}
}
}
}
},
"get": {
- "tags": ["webhooks"],
+ "tags": [
+ "webhooks"
+ ],
"summary": "List Webhook Endpoints",
"description": "List all webhook endpoints, optionally filtered by workspace.",
"operationId": "list_webhook_endpoints_v2_workspaces__workspace_id__webhooks_get",
- "security": [{ "HTTPBearer": [] }],
+ "security": [
+ {
+ "HTTPBearer": []
+ }
+ ],
"parameters": [
{
"name": "workspace_id",
@@ -2906,7 +3542,9 @@
"description": "Validation Error",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
}
}
}
@@ -2915,11 +3553,17 @@
},
"/v2/workspaces/{workspace_id}/webhooks/{endpoint_id}": {
"delete": {
- "tags": ["webhooks"],
+ "tags": [
+ "webhooks"
+ ],
"summary": "Delete Webhook Endpoint",
"description": "Delete a specific webhook endpoint.",
"operationId": "delete_webhook_endpoint_v2_workspaces__workspace_id__webhooks__endpoint_id__delete",
- "security": [{ "HTTPBearer": [] }],
+ "security": [
+ {
+ "HTTPBearer": []
+ }
+ ],
"parameters": [
{
"name": "workspace_id",
@@ -2947,13 +3591,19 @@
"responses": {
"200": {
"description": "Successful Response",
- "content": { "application/json": { "schema": {} } }
+ "content": {
+ "application/json": {
+ "schema": {}
+ }
+ }
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
}
}
}
@@ -2962,11 +3612,17 @@
},
"/v2/workspaces/{workspace_id}/webhooks/test": {
"get": {
- "tags": ["webhooks"],
+ "tags": [
+ "webhooks"
+ ],
"summary": "Test Emit",
"description": "Test publishing a webhook event.",
"operationId": "test_emit_v2_workspaces__workspace_id__webhooks_test_get",
- "security": [{ "HTTPBearer": [] }],
+ "security": [
+ {
+ "HTTPBearer": []
+ }
+ ],
"parameters": [
{
"name": "workspace_id",
@@ -2983,13 +3639,19 @@
"responses": {
"200": {
"description": "Successful Response",
- "content": { "application/json": { "schema": {} } }
+ "content": {
+ "application/json": {
+ "schema": {}
+ }
+ }
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
- "schema": { "$ref": "#/components/schemas/HTTPValidationError" }
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
}
}
}
@@ -3004,7 +3666,11 @@
"responses": {
"200": {
"description": "Successful Response",
- "content": { "application/json": { "schema": {} } }
+ "content": {
+ "application/json": {
+ "schema": {}
+ }
+ }
}
}
}
@@ -3014,23 +3680,54 @@
"schemas": {
"Body_create_messages_with_file_v2_workspaces__workspace_id__sessions__session_id__messages_upload_post": {
"properties": {
- "file": { "type": "string", "format": "binary", "title": "File" },
- "peer_id": { "type": "string", "title": "Peer Id" },
+ "file": {
+ "type": "string",
+ "format": "binary",
+ "title": "File"
+ },
+ "peer_id": {
+ "type": "string",
+ "title": "Peer Id"
+ },
"metadata": {
- "anyOf": [{ "type": "string" }, { "type": "null" }],
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
"title": "Metadata"
},
"configuration": {
- "anyOf": [{ "type": "string" }, { "type": "null" }],
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
"title": "Configuration"
},
"created_at": {
- "anyOf": [{ "type": "string" }, { "type": "null" }],
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
"title": "Created At"
}
},
"type": "object",
- "required": ["file", "peer_id"],
+ "required": [
+ "file",
+ "peer_id"
+ ],
"title": "Body_create_messages_with_file_v2_workspaces__workspace_id__sessions__session_id__messages_upload_post"
},
"DeductiveObservation": {
@@ -3041,13 +3738,20 @@
"title": "Created At"
},
"message_ids": {
- "items": { "type": "integer" },
+ "items": {
+ "type": "integer"
+ },
"type": "array",
"title": "Message Ids"
},
- "session_name": { "type": "string", "title": "Session Name" },
+ "session_name": {
+ "type": "string",
+ "title": "Session Name"
+ },
"premises": {
- "items": { "type": "string" },
+ "items": {
+ "type": "string"
+ },
"type": "array",
"title": "Premises",
"description": "Supporting premises or evidence for this conclusion"
@@ -3059,19 +3763,38 @@
}
},
"type": "object",
- "required": ["created_at", "message_ids", "session_name", "conclusion"],
+ "required": [
+ "created_at",
+ "message_ids",
+ "session_name",
+ "conclusion"
+ ],
"title": "DeductiveObservation",
"description": "Deductive observation with multiple premises and one conclusion, plus metadata."
},
"DeriverConfiguration": {
"properties": {
"enabled": {
- "anyOf": [{ "type": "boolean" }, { "type": "null" }],
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
"title": "Enabled",
"description": "Whether to enable deriver functionality."
},
"custom_instructions": {
- "anyOf": [{ "type": "string" }, { "type": "null" }],
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
"title": "Custom Instructions",
"description": "TODO: currently unused. Custom instructions to use for the deriver on this workspace/session/message."
}
@@ -3109,7 +3832,9 @@
},
"type": "object"
},
- { "type": "null" }
+ {
+ "type": "null"
+ }
],
"title": "Sessions",
"description": "Per-session status when not filtered by session"
@@ -3127,12 +3852,26 @@
"DialecticOptions": {
"properties": {
"session_id": {
- "anyOf": [{ "type": "string" }, { "type": "null" }],
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
"title": "Session Id",
"description": "ID of the session to scope the representation to"
},
"target": {
- "anyOf": [{ "type": "string" }, { "type": "null" }],
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
"title": "Target",
"description": "Optional peer to get the representation for, from the perspective of this peer"
},
@@ -3143,16 +3882,29 @@
"title": "Query",
"description": "Dialectic API Prompt"
},
- "stream": { "type": "boolean", "title": "Stream", "default": false }
+ "stream": {
+ "type": "boolean",
+ "title": "Stream",
+ "default": false
+ }
},
"type": "object",
- "required": ["query"],
+ "required": [
+ "query"
+ ],
"title": "DialecticOptions"
},
"DreamConfiguration": {
"properties": {
"enabled": {
- "anyOf": [{ "type": "boolean" }, { "type": "null" }],
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
"title": "Enabled",
"description": "Whether to enable dream functionality. If deriver is disabled, dreams will also be disabled and this setting will be ignored."
}
@@ -3162,7 +3914,10 @@
},
"DreamType": {
"type": "string",
- "enum": ["consolidate", "agent"],
+ "enum": [
+ "consolidate",
+ "agent"
+ ],
"title": "DreamType",
"description": "Types of dreams that can be triggered."
},
@@ -3174,11 +3929,16 @@
"title": "Created At"
},
"message_ids": {
- "items": { "type": "integer" },
+ "items": {
+ "type": "integer"
+ },
"type": "array",
"title": "Message Ids"
},
- "session_name": { "type": "string", "title": "Session Name" },
+ "session_name": {
+ "type": "string",
+ "title": "Session Name"
+ },
"content": {
"type": "string",
"title": "Content",
@@ -3186,14 +3946,21 @@
}
},
"type": "object",
- "required": ["created_at", "message_ids", "session_name", "content"],
+ "required": [
+ "created_at",
+ "message_ids",
+ "session_name",
+ "content"
+ ],
"title": "ExplicitObservation",
"description": "Explicit observation with content and metadata."
},
"HTTPValidationError": {
"properties": {
"detail": {
- "items": { "$ref": "#/components/schemas/ValidationError" },
+ "items": {
+ "$ref": "#/components/schemas/ValidationError"
+ },
"type": "array",
"title": "Detail"
}
@@ -3203,10 +3970,22 @@
},
"Message": {
"properties": {
- "id": { "type": "string", "title": "Id" },
- "content": { "type": "string", "title": "Content" },
- "peer_id": { "type": "string", "title": "Peer Id" },
- "session_id": { "type": "string", "title": "Session Id" },
+ "id": {
+ "type": "string",
+ "title": "Id"
+ },
+ "content": {
+ "type": "string",
+ "title": "Content"
+ },
+ "peer_id": {
+ "type": "string",
+ "title": "Peer Id"
+ },
+ "session_id": {
+ "type": "string",
+ "title": "Session Id"
+ },
"metadata": {
"additionalProperties": true,
"type": "object",
@@ -3217,8 +3996,14 @@
"format": "date-time",
"title": "Created At"
},
- "workspace_id": { "type": "string", "title": "Workspace Id" },
- "token_count": { "type": "integer", "title": "Token Count" }
+ "workspace_id": {
+ "type": "string",
+ "title": "Workspace Id"
+ },
+ "token_count": {
+ "type": "integer",
+ "title": "Token Count"
+ }
},
"type": "object",
"required": [
@@ -3235,7 +4020,9 @@
"MessageBatchCreate": {
"properties": {
"messages": {
- "items": { "$ref": "#/components/schemas/MessageCreate" },
+ "items": {
+ "$ref": "#/components/schemas/MessageCreate"
+ },
"type": "array",
"maxItems": 100,
"minItems": 1,
@@ -3243,7 +4030,9 @@
}
},
"type": "object",
- "required": ["messages"],
+ "required": [
+ "messages"
+ ],
"title": "MessageBatchCreate",
"description": "Schema for batch message creation with a max of 100 messages"
},
@@ -3251,15 +4040,23 @@
"properties": {
"deriver": {
"anyOf": [
- { "$ref": "#/components/schemas/DeriverConfiguration" },
- { "type": "null" }
+ {
+ "$ref": "#/components/schemas/DeriverConfiguration"
+ },
+ {
+ "type": "null"
+ }
],
"description": "Configuration for deriver functionality."
},
"peer_card": {
"anyOf": [
- { "$ref": "#/components/schemas/PeerCardConfiguration" },
- { "type": "null" }
+ {
+ "$ref": "#/components/schemas/PeerCardConfiguration"
+ },
+ {
+ "type": "null"
+ }
],
"description": "Configuration for peer card functionality. If deriver is disabled, peer cards will also be disabled and these settings will be ignored."
}
@@ -3276,38 +4073,63 @@
"minLength": 0,
"title": "Content"
},
- "peer_id": { "type": "string", "title": "Peer Id" },
+ "peer_id": {
+ "type": "string",
+ "title": "Peer Id"
+ },
"metadata": {
"anyOf": [
- { "additionalProperties": true, "type": "object" },
- { "type": "null" }
+ {
+ "additionalProperties": true,
+ "type": "object"
+ },
+ {
+ "type": "null"
+ }
],
"title": "Metadata"
},
"configuration": {
"anyOf": [
- { "$ref": "#/components/schemas/MessageConfiguration" },
- { "type": "null" }
+ {
+ "$ref": "#/components/schemas/MessageConfiguration"
+ },
+ {
+ "type": "null"
+ }
]
},
"created_at": {
"anyOf": [
- { "type": "string", "format": "date-time" },
- { "type": "null" }
+ {
+ "type": "string",
+ "format": "date-time"
+ },
+ {
+ "type": "null"
+ }
],
"title": "Created At"
}
},
"type": "object",
- "required": ["content", "peer_id"],
+ "required": [
+ "content",
+ "peer_id"
+ ],
"title": "MessageCreate"
},
"MessageGet": {
"properties": {
"filters": {
"anyOf": [
- { "additionalProperties": true, "type": "object" },
- { "type": "null" }
+ {
+ "additionalProperties": true,
+ "type": "object"
+ },
+ {
+ "type": "null"
+ }
],
"title": "Filters"
}
@@ -3324,8 +4146,13 @@
},
"filters": {
"anyOf": [
- { "additionalProperties": true, "type": "object" },
- { "type": "null" }
+ {
+ "additionalProperties": true,
+ "type": "object"
+ },
+ {
+ "type": "null"
+ }
],
"title": "Filters",
"description": "Filters to scope the search"
@@ -3340,15 +4167,22 @@
}
},
"type": "object",
- "required": ["query"],
+ "required": [
+ "query"
+ ],
"title": "MessageSearchOptions"
},
"MessageUpdate": {
"properties": {
"metadata": {
"anyOf": [
- { "additionalProperties": true, "type": "object" },
- { "type": "null" }
+ {
+ "additionalProperties": true,
+ "type": "object"
+ },
+ {
+ "type": "null"
+ }
],
"title": "Metadata"
}
@@ -3358,8 +4192,14 @@
},
"Observation": {
"properties": {
- "id": { "type": "string", "title": "Id" },
- "content": { "type": "string", "title": "Content" },
+ "id": {
+ "type": "string",
+ "title": "Id"
+ },
+ "content": {
+ "type": "string",
+ "title": "Content"
+ },
"observer_id": {
"type": "string",
"title": "Observer Id",
@@ -3370,7 +4210,10 @@
"title": "Observed Id",
"description": "The peer being observed"
},
- "session_id": { "type": "string", "title": "Session Id" },
+ "session_id": {
+ "type": "string",
+ "title": "Session Id"
+ },
"created_at": {
"type": "string",
"format": "date-time",
@@ -3392,7 +4235,9 @@
"ObservationBatchCreate": {
"properties": {
"observations": {
- "items": { "$ref": "#/components/schemas/ObservationCreate" },
+ "items": {
+ "$ref": "#/components/schemas/ObservationCreate"
+ },
"type": "array",
"maxItems": 100,
"minItems": 1,
@@ -3400,7 +4245,9 @@
}
},
"type": "object",
- "required": ["observations"],
+ "required": [
+ "observations"
+ ],
"title": "ObservationBatchCreate",
"description": "Schema for batch observation creation with a max of 100 observations"
},
@@ -3429,7 +4276,12 @@
}
},
"type": "object",
- "required": ["content", "observer_id", "observed_id", "session_id"],
+ "required": [
+ "content",
+ "observer_id",
+ "observed_id",
+ "session_id"
+ ],
"title": "ObservationCreate",
"description": "Schema for creating a single observation"
},
@@ -3437,8 +4289,13 @@
"properties": {
"filters": {
"anyOf": [
- { "additionalProperties": true, "type": "object" },
- { "type": "null" }
+ {
+ "additionalProperties": true,
+ "type": "object"
+ },
+ {
+ "type": "null"
+ }
],
"title": "Filters"
}
@@ -3464,270 +4321,445 @@
},
"distance": {
"anyOf": [
- { "type": "number", "maximum": 1.0, "minimum": 0.0 },
- { "type": "null" }
+ {
+ "type": "number",
+ "maximum": 1.0,
+ "minimum": 0.0
+ },
+ {
+ "type": "null"
+ }
],
"title": "Distance",
"description": "Maximum cosine distance threshold for results"
},
"filters": {
"anyOf": [
- { "additionalProperties": true, "type": "object" },
- { "type": "null" }
+ {
+ "additionalProperties": true,
+ "type": "object"
+ },
+ {
+ "type": "null"
+ }
],
"title": "Filters",
"description": "Additional filters to apply"
}
},
"type": "object",
- "required": ["query"],
+ "required": [
+ "query"
+ ],
"title": "ObservationQuery",
"description": "Query parameters for semantic search of observations"
},
"Page_Message_": {
"properties": {
"items": {
- "items": { "$ref": "#/components/schemas/Message" },
+ "items": {
+ "$ref": "#/components/schemas/Message"
+ },
"type": "array",
"title": "Items"
},
"total": {
"anyOf": [
- { "type": "integer", "minimum": 0.0 },
- { "type": "null" }
+ {
+ "type": "integer",
+ "minimum": 0.0
+ },
+ {
+ "type": "null"
+ }
],
"title": "Total"
},
"page": {
"anyOf": [
- { "type": "integer", "minimum": 1.0 },
- { "type": "null" }
+ {
+ "type": "integer",
+ "minimum": 1.0
+ },
+ {
+ "type": "null"
+ }
],
"title": "Page"
},
"size": {
"anyOf": [
- { "type": "integer", "minimum": 1.0 },
- { "type": "null" }
+ {
+ "type": "integer",
+ "minimum": 1.0
+ },
+ {
+ "type": "null"
+ }
],
"title": "Size"
},
"pages": {
"anyOf": [
- { "type": "integer", "minimum": 0.0 },
- { "type": "null" }
+ {
+ "type": "integer",
+ "minimum": 0.0
+ },
+ {
+ "type": "null"
+ }
],
"title": "Pages"
}
},
"type": "object",
- "required": ["items", "page", "size"],
+ "required": [
+ "items",
+ "page",
+ "size"
+ ],
"title": "Page[Message]"
},
"Page_Observation_": {
"properties": {
"items": {
- "items": { "$ref": "#/components/schemas/Observation" },
+ "items": {
+ "$ref": "#/components/schemas/Observation"
+ },
"type": "array",
"title": "Items"
},
"total": {
"anyOf": [
- { "type": "integer", "minimum": 0.0 },
- { "type": "null" }
+ {
+ "type": "integer",
+ "minimum": 0.0
+ },
+ {
+ "type": "null"
+ }
],
"title": "Total"
},
"page": {
"anyOf": [
- { "type": "integer", "minimum": 1.0 },
- { "type": "null" }
+ {
+ "type": "integer",
+ "minimum": 1.0
+ },
+ {
+ "type": "null"
+ }
],
"title": "Page"
},
"size": {
"anyOf": [
- { "type": "integer", "minimum": 1.0 },
- { "type": "null" }
+ {
+ "type": "integer",
+ "minimum": 1.0
+ },
+ {
+ "type": "null"
+ }
],
"title": "Size"
},
"pages": {
"anyOf": [
- { "type": "integer", "minimum": 0.0 },
- { "type": "null" }
+ {
+ "type": "integer",
+ "minimum": 0.0
+ },
+ {
+ "type": "null"
+ }
],
"title": "Pages"
}
},
"type": "object",
- "required": ["items", "page", "size"],
+ "required": [
+ "items",
+ "page",
+ "size"
+ ],
"title": "Page[Observation]"
},
"Page_Peer_": {
"properties": {
"items": {
- "items": { "$ref": "#/components/schemas/Peer" },
+ "items": {
+ "$ref": "#/components/schemas/Peer"
+ },
"type": "array",
"title": "Items"
},
"total": {
"anyOf": [
- { "type": "integer", "minimum": 0.0 },
- { "type": "null" }
+ {
+ "type": "integer",
+ "minimum": 0.0
+ },
+ {
+ "type": "null"
+ }
],
"title": "Total"
},
"page": {
"anyOf": [
- { "type": "integer", "minimum": 1.0 },
- { "type": "null" }
+ {
+ "type": "integer",
+ "minimum": 1.0
+ },
+ {
+ "type": "null"
+ }
],
"title": "Page"
},
"size": {
"anyOf": [
- { "type": "integer", "minimum": 1.0 },
- { "type": "null" }
+ {
+ "type": "integer",
+ "minimum": 1.0
+ },
+ {
+ "type": "null"
+ }
],
"title": "Size"
},
"pages": {
"anyOf": [
- { "type": "integer", "minimum": 0.0 },
- { "type": "null" }
+ {
+ "type": "integer",
+ "minimum": 0.0
+ },
+ {
+ "type": "null"
+ }
],
"title": "Pages"
}
},
"type": "object",
- "required": ["items", "page", "size"],
+ "required": [
+ "items",
+ "page",
+ "size"
+ ],
"title": "Page[Peer]"
},
"Page_Session_": {
"properties": {
"items": {
- "items": { "$ref": "#/components/schemas/Session" },
+ "items": {
+ "$ref": "#/components/schemas/Session"
+ },
"type": "array",
"title": "Items"
},
"total": {
"anyOf": [
- { "type": "integer", "minimum": 0.0 },
- { "type": "null" }
+ {
+ "type": "integer",
+ "minimum": 0.0
+ },
+ {
+ "type": "null"
+ }
],
"title": "Total"
},
"page": {
"anyOf": [
- { "type": "integer", "minimum": 1.0 },
- { "type": "null" }
+ {
+ "type": "integer",
+ "minimum": 1.0
+ },
+ {
+ "type": "null"
+ }
],
"title": "Page"
},
"size": {
"anyOf": [
- { "type": "integer", "minimum": 1.0 },
- { "type": "null" }
+ {
+ "type": "integer",
+ "minimum": 1.0
+ },
+ {
+ "type": "null"
+ }
],
"title": "Size"
},
"pages": {
"anyOf": [
- { "type": "integer", "minimum": 0.0 },
- { "type": "null" }
+ {
+ "type": "integer",
+ "minimum": 0.0
+ },
+ {
+ "type": "null"
+ }
],
"title": "Pages"
}
},
"type": "object",
- "required": ["items", "page", "size"],
+ "required": [
+ "items",
+ "page",
+ "size"
+ ],
"title": "Page[Session]"
},
"Page_WebhookEndpoint_": {
"properties": {
"items": {
- "items": { "$ref": "#/components/schemas/WebhookEndpoint" },
+ "items": {
+ "$ref": "#/components/schemas/WebhookEndpoint"
+ },
"type": "array",
"title": "Items"
},
"total": {
"anyOf": [
- { "type": "integer", "minimum": 0.0 },
- { "type": "null" }
+ {
+ "type": "integer",
+ "minimum": 0.0
+ },
+ {
+ "type": "null"
+ }
],
"title": "Total"
},
"page": {
"anyOf": [
- { "type": "integer", "minimum": 1.0 },
- { "type": "null" }
+ {
+ "type": "integer",
+ "minimum": 1.0
+ },
+ {
+ "type": "null"
+ }
],
"title": "Page"
},
"size": {
"anyOf": [
- { "type": "integer", "minimum": 1.0 },
- { "type": "null" }
+ {
+ "type": "integer",
+ "minimum": 1.0
+ },
+ {
+ "type": "null"
+ }
],
"title": "Size"
},
"pages": {
"anyOf": [
- { "type": "integer", "minimum": 0.0 },
- { "type": "null" }
+ {
+ "type": "integer",
+ "minimum": 0.0
+ },
+ {
+ "type": "null"
+ }
],
"title": "Pages"
}
},
"type": "object",
- "required": ["items", "page", "size"],
+ "required": [
+ "items",
+ "page",
+ "size"
+ ],
"title": "Page[WebhookEndpoint]"
},
"Page_Workspace_": {
"properties": {
"items": {
- "items": { "$ref": "#/components/schemas/Workspace" },
+ "items": {
+ "$ref": "#/components/schemas/Workspace"
+ },
"type": "array",
"title": "Items"
},
"total": {
"anyOf": [
- { "type": "integer", "minimum": 0.0 },
- { "type": "null" }
+ {
+ "type": "integer",
+ "minimum": 0.0
+ },
+ {
+ "type": "null"
+ }
],
"title": "Total"
},
"page": {
"anyOf": [
- { "type": "integer", "minimum": 1.0 },
- { "type": "null" }
+ {
+ "type": "integer",
+ "minimum": 1.0
+ },
+ {
+ "type": "null"
+ }
],
"title": "Page"
},
"size": {
"anyOf": [
- { "type": "integer", "minimum": 1.0 },
- { "type": "null" }
+ {
+ "type": "integer",
+ "minimum": 1.0
+ },
+ {
+ "type": "null"
+ }
],
"title": "Size"
},
"pages": {
"anyOf": [
- { "type": "integer", "minimum": 0.0 },
- { "type": "null" }
+ {
+ "type": "integer",
+ "minimum": 0.0
+ },
+ {
+ "type": "null"
+ }
],
"title": "Pages"
}
},
"type": "object",
- "required": ["items", "page", "size"],
+ "required": [
+ "items",
+ "page",
+ "size"
+ ],
"title": "Page[Workspace]"
},
"Peer": {
"properties": {
- "id": { "type": "string", "title": "Id" },
- "workspace_id": { "type": "string", "title": "Workspace Id" },
+ "id": {
+ "type": "string",
+ "title": "Id"
+ },
+ "workspace_id": {
+ "type": "string",
+ "title": "Workspace Id"
+ },
"created_at": {
"type": "string",
"format": "date-time",
@@ -3745,18 +4777,36 @@
}
},
"type": "object",
- "required": ["id", "workspace_id", "created_at"],
+ "required": [
+ "id",
+ "workspace_id",
+ "created_at"
+ ],
"title": "Peer"
},
"PeerCardConfiguration": {
"properties": {
"use": {
- "anyOf": [{ "type": "boolean" }, { "type": "null" }],
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
"title": "Use",
"description": "Whether to use peer card related to this peer during deriver process."
},
"create": {
- "anyOf": [{ "type": "boolean" }, { "type": "null" }],
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
"title": "Create",
"description": "Whether to generate peer card based on content."
}
@@ -3768,8 +4818,15 @@
"properties": {
"peer_card": {
"anyOf": [
- { "items": { "type": "string" }, "type": "array" },
- { "type": "null" }
+ {
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ {
+ "type": "null"
+ }
],
"title": "Peer Card",
"description": "The peer card content, or None if not found"
@@ -3781,14 +4838,18 @@
"PeerCardSet": {
"properties": {
"peer_card": {
- "items": { "type": "string" },
+ "items": {
+ "type": "string"
+ },
"type": "array",
"title": "Peer Card",
"description": "The peer card content to set"
}
},
"type": "object",
- "required": ["peer_card"],
+ "required": [
+ "peer_card"
+ ],
"title": "PeerCardSet"
},
"PeerContext": {
@@ -3805,22 +4866,36 @@
},
"representation": {
"anyOf": [
- { "$ref": "#/components/schemas/Representation" },
- { "type": "null" }
+ {
+ "$ref": "#/components/schemas/Representation"
+ },
+ {
+ "type": "null"
+ }
],
"description": "The working representation of the target peer from the observer's perspective"
},
"peer_card": {
"anyOf": [
- { "items": { "type": "string" }, "type": "array" },
- { "type": "null" }
+ {
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ {
+ "type": "null"
+ }
],
"title": "Peer Card",
"description": "The peer card for the target peer from the observer's perspective"
}
},
"type": "object",
- "required": ["peer_id", "target_id"],
+ "required": [
+ "peer_id",
+ "target_id"
+ ],
"title": "PeerContext",
"description": "Context for a peer, including representation and peer card."
},
@@ -3835,29 +4910,46 @@
},
"metadata": {
"anyOf": [
- { "additionalProperties": true, "type": "object" },
- { "type": "null" }
+ {
+ "additionalProperties": true,
+ "type": "object"
+ },
+ {
+ "type": "null"
+ }
],
"title": "Metadata"
},
"configuration": {
"anyOf": [
- { "additionalProperties": true, "type": "object" },
- { "type": "null" }
+ {
+ "additionalProperties": true,
+ "type": "object"
+ },
+ {
+ "type": "null"
+ }
],
"title": "Configuration"
}
},
"type": "object",
- "required": ["id"],
+ "required": [
+ "id"
+ ],
"title": "PeerCreate"
},
"PeerGet": {
"properties": {
"filters": {
"anyOf": [
- { "additionalProperties": true, "type": "object" },
- { "type": "null" }
+ {
+ "additionalProperties": true,
+ "type": "object"
+ },
+ {
+ "type": "null"
+ }
],
"title": "Filters"
}
@@ -3868,45 +4960,91 @@
"PeerRepresentationGet": {
"properties": {
"session_id": {
- "anyOf": [{ "type": "string" }, { "type": "null" }],
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
"title": "Session Id",
"description": "Get the working representation within this session"
},
"target": {
- "anyOf": [{ "type": "string" }, { "type": "null" }],
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
"title": "Target",
"description": "Optional peer ID to get the representation for, from the perspective of this peer"
},
"search_query": {
- "anyOf": [{ "type": "string" }, { "type": "null" }],
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
"title": "Search Query",
"description": "Optional input to curate the representation around semantic search results"
},
"search_top_k": {
"anyOf": [
- { "type": "integer", "maximum": 100.0, "minimum": 1.0 },
- { "type": "null" }
+ {
+ "type": "integer",
+ "maximum": 100.0,
+ "minimum": 1.0
+ },
+ {
+ "type": "null"
+ }
],
"title": "Search Top K",
"description": "Only used if `search_query` is provided. Number of semantic-search-retrieved observations to include in the representation"
},
"search_max_distance": {
"anyOf": [
- { "type": "number", "maximum": 1.0, "minimum": 0.0 },
- { "type": "null" }
+ {
+ "type": "number",
+ "maximum": 1.0,
+ "minimum": 0.0
+ },
+ {
+ "type": "null"
+ }
],
"title": "Search Max Distance",
"description": "Only used if `search_query` is provided. Maximum distance to search for semantically relevant observations"
},
"include_most_derived": {
- "anyOf": [{ "type": "boolean" }, { "type": "null" }],
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
"title": "Include Most Derived",
"description": "Only used if `search_query` is provided. Whether to include the most derived observations in the representation"
},
"max_observations": {
"anyOf": [
- { "type": "integer", "maximum": 100.0, "minimum": 1.0 },
- { "type": "null" }
+ {
+ "type": "integer",
+ "maximum": 100.0,
+ "minimum": 1.0
+ },
+ {
+ "type": "null"
+ }
],
"title": "Max Observations",
"description": "Only used if `search_query` is provided. Maximum number of observations to include in the representation",
@@ -3920,15 +5058,25 @@
"properties": {
"metadata": {
"anyOf": [
- { "additionalProperties": true, "type": "object" },
- { "type": "null" }
+ {
+ "additionalProperties": true,
+ "type": "object"
+ },
+ {
+ "type": "null"
+ }
],
"title": "Metadata"
},
"configuration": {
"anyOf": [
- { "additionalProperties": true, "type": "object" },
- { "type": "null" }
+ {
+ "additionalProperties": true,
+ "type": "object"
+ },
+ {
+ "type": "null"
+ }
],
"title": "Configuration"
}
@@ -3939,13 +5087,17 @@
"Representation": {
"properties": {
"explicit": {
- "items": { "$ref": "#/components/schemas/ExplicitObservation" },
+ "items": {
+ "$ref": "#/components/schemas/ExplicitObservation"
+ },
"type": "array",
"title": "Explicit",
"description": "Facts LITERALLY stated by the user - direct quotes or clear paraphrases only, no interpretation or inference. Example: ['The user is 25 years old', 'The user has a dog']"
},
"deductive": {
- "items": { "$ref": "#/components/schemas/DeductiveObservation" },
+ "items": {
+ "$ref": "#/components/schemas/DeductiveObservation"
+ },
"type": "array",
"title": "Deductive",
"description": "Conclusions that MUST be true given explicit facts and premises - strict logical necessities. Each deduction should have premises and a single conclusion."
@@ -3957,9 +5109,18 @@
},
"Session": {
"properties": {
- "id": { "type": "string", "title": "Id" },
- "is_active": { "type": "boolean", "title": "Is Active" },
- "workspace_id": { "type": "string", "title": "Workspace Id" },
+ "id": {
+ "type": "string",
+ "title": "Id"
+ },
+ "is_active": {
+ "type": "boolean",
+ "title": "Is Active"
+ },
+ "workspace_id": {
+ "type": "string",
+ "title": "Workspace Id"
+ },
"metadata": {
"additionalProperties": true,
"type": "object",
@@ -3977,36 +5138,57 @@
}
},
"type": "object",
- "required": ["id", "is_active", "workspace_id", "created_at"],
+ "required": [
+ "id",
+ "is_active",
+ "workspace_id",
+ "created_at"
+ ],
"title": "Session"
},
"SessionConfiguration": {
"properties": {
"deriver": {
"anyOf": [
- { "$ref": "#/components/schemas/DeriverConfiguration" },
- { "type": "null" }
+ {
+ "$ref": "#/components/schemas/DeriverConfiguration"
+ },
+ {
+ "type": "null"
+ }
],
"description": "Configuration for deriver functionality."
},
"peer_card": {
"anyOf": [
- { "$ref": "#/components/schemas/PeerCardConfiguration" },
- { "type": "null" }
+ {
+ "$ref": "#/components/schemas/PeerCardConfiguration"
+ },
+ {
+ "type": "null"
+ }
],
"description": "Configuration for peer card functionality. If deriver is disabled, peer cards will also be disabled and these settings will be ignored."
},
"summary": {
"anyOf": [
- { "$ref": "#/components/schemas/SummaryConfiguration" },
- { "type": "null" }
+ {
+ "$ref": "#/components/schemas/SummaryConfiguration"
+ },
+ {
+ "type": "null"
+ }
],
"description": "Configuration for summary functionality."
},
"dream": {
"anyOf": [
- { "$ref": "#/components/schemas/DreamConfiguration" },
- { "type": "null" }
+ {
+ "$ref": "#/components/schemas/DreamConfiguration"
+ },
+ {
+ "type": "null"
+ }
],
"description": "Configuration for dream functionality. If deriver is disabled, dreams will also be disabled and these settings will be ignored."
}
@@ -4018,37 +5200,60 @@
},
"SessionContext": {
"properties": {
- "id": { "type": "string", "title": "Id" },
+ "id": {
+ "type": "string",
+ "title": "Id"
+ },
"messages": {
- "items": { "$ref": "#/components/schemas/Message" },
+ "items": {
+ "$ref": "#/components/schemas/Message"
+ },
"type": "array",
"title": "Messages"
},
"summary": {
"anyOf": [
- { "$ref": "#/components/schemas/Summary" },
- { "type": "null" }
+ {
+ "$ref": "#/components/schemas/Summary"
+ },
+ {
+ "type": "null"
+ }
],
"description": "The summary if available"
},
"peer_representation": {
"anyOf": [
- { "$ref": "#/components/schemas/Representation" },
- { "type": "null" }
+ {
+ "$ref": "#/components/schemas/Representation"
+ },
+ {
+ "type": "null"
+ }
],
"description": "The peer representation, if context is requested from a specific perspective"
},
"peer_card": {
"anyOf": [
- { "items": { "type": "string" }, "type": "array" },
- { "type": "null" }
+ {
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ },
+ {
+ "type": "null"
+ }
],
"title": "Peer Card",
"description": "The peer card, if context is requested from a specific perspective"
}
},
"type": "object",
- "required": ["id", "messages"],
+ "required": [
+ "id",
+ "messages"
+ ],
"title": "SessionContext"
},
"SessionCreate": {
@@ -4062,8 +5267,13 @@
},
"metadata": {
"anyOf": [
- { "additionalProperties": true, "type": "object" },
- { "type": "null" }
+ {
+ "additionalProperties": true,
+ "type": "object"
+ },
+ {
+ "type": "null"
+ }
],
"title": "Metadata"
},
@@ -4075,25 +5285,40 @@
},
"type": "object"
},
- { "type": "null" }
+ {
+ "type": "null"
+ }
],
"title": "Peers"
},
"configuration": {
"anyOf": [
- { "$ref": "#/components/schemas/SessionConfiguration" },
- { "type": "null" }
+ {
+ "$ref": "#/components/schemas/SessionConfiguration"
+ },
+ {
+ "type": "null"
+ }
]
}
},
"type": "object",
- "required": ["id"],
+ "required": [
+ "id"
+ ],
"title": "SessionCreate"
},
"SessionDeriverStatus": {
"properties": {
"session_id": {
- "anyOf": [{ "type": "string" }, { "type": "null" }],
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
"title": "Session Id",
"description": "Session ID if filtered by session"
},
@@ -4131,8 +5356,13 @@
"properties": {
"filters": {
"anyOf": [
- { "additionalProperties": true, "type": "object" },
- { "type": "null" }
+ {
+ "additionalProperties": true,
+ "type": "object"
+ },
+ {
+ "type": "null"
+ }
],
"title": "Filters"
}
@@ -4143,12 +5373,26 @@
"SessionPeerConfig": {
"properties": {
"observe_me": {
- "anyOf": [{ "type": "boolean" }, { "type": "null" }],
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
"title": "Observe Me",
"description": "Whether honcho should form a global theory-of-mind representation of this peer"
},
"observe_others": {
- "anyOf": [{ "type": "boolean" }, { "type": "null" }],
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
"title": "Observe Others",
"description": "Whether this peer should form a session-level theory-of-mind representation of other peers in the session"
}
@@ -4158,39 +5402,61 @@
},
"SessionSummaries": {
"properties": {
- "id": { "type": "string", "title": "Id" },
+ "id": {
+ "type": "string",
+ "title": "Id"
+ },
"short_summary": {
"anyOf": [
- { "$ref": "#/components/schemas/Summary" },
- { "type": "null" }
+ {
+ "$ref": "#/components/schemas/Summary"
+ },
+ {
+ "type": "null"
+ }
],
"description": "The short summary if available"
},
"long_summary": {
"anyOf": [
- { "$ref": "#/components/schemas/Summary" },
- { "type": "null" }
+ {
+ "$ref": "#/components/schemas/Summary"
+ },
+ {
+ "type": "null"
+ }
],
"description": "The long summary if available"
}
},
"type": "object",
- "required": ["id"],
+ "required": [
+ "id"
+ ],
"title": "SessionSummaries"
},
"SessionUpdate": {
"properties": {
"metadata": {
"anyOf": [
- { "additionalProperties": true, "type": "object" },
- { "type": "null" }
+ {
+ "additionalProperties": true,
+ "type": "object"
+ },
+ {
+ "type": "null"
+ }
],
"title": "Metadata"
},
"configuration": {
"anyOf": [
- { "$ref": "#/components/schemas/SessionConfiguration" },
- { "type": "null" }
+ {
+ "$ref": "#/components/schemas/SessionConfiguration"
+ },
+ {
+ "type": "null"
+ }
]
}
},
@@ -4238,22 +5504,39 @@
"SummaryConfiguration": {
"properties": {
"enabled": {
- "anyOf": [{ "type": "boolean" }, { "type": "null" }],
+ "anyOf": [
+ {
+ "type": "boolean"
+ },
+ {
+ "type": "null"
+ }
+ ],
"title": "Enabled",
"description": "Whether to enable summary functionality."
},
"messages_per_short_summary": {
"anyOf": [
- { "type": "integer", "minimum": 10.0 },
- { "type": "null" }
+ {
+ "type": "integer",
+ "minimum": 10.0
+ },
+ {
+ "type": "null"
+ }
],
"title": "Messages Per Short Summary",
"description": "Number of messages per short summary. Must be positive, greater than or equal to 10, and less than messages_per_long_summary."
},
"messages_per_long_summary": {
"anyOf": [
- { "type": "integer", "minimum": 20.0 },
- { "type": "null" }
+ {
+ "type": "integer",
+ "minimum": 20.0
+ },
+ {
+ "type": "null"
+ }
],
"title": "Messages Per Long Summary",
"description": "Number of messages per long summary. Must be positive, greater than or equal to 20, and greater than messages_per_short_summary."
@@ -4270,7 +5553,14 @@
"description": "Observer peer name"
},
"observed": {
- "anyOf": [{ "type": "string" }, { "type": "null" }],
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
"title": "Observed",
"description": "Observed peer name (defaults to observer if not specified)"
},
@@ -4280,31 +5570,66 @@
}
},
"type": "object",
- "required": ["observer", "dream_type"],
+ "required": [
+ "observer",
+ "dream_type"
+ ],
"title": "TriggerDreamRequest"
},
"ValidationError": {
"properties": {
"loc": {
- "items": { "anyOf": [{ "type": "string" }, { "type": "integer" }] },
+ "items": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "integer"
+ }
+ ]
+ },
"type": "array",
"title": "Location"
},
- "msg": { "type": "string", "title": "Message" },
- "type": { "type": "string", "title": "Error Type" }
+ "msg": {
+ "type": "string",
+ "title": "Message"
+ },
+ "type": {
+ "type": "string",
+ "title": "Error Type"
+ }
},
"type": "object",
- "required": ["loc", "msg", "type"],
+ "required": [
+ "loc",
+ "msg",
+ "type"
+ ],
"title": "ValidationError"
},
"WebhookEndpoint": {
"properties": {
- "id": { "type": "string", "title": "Id" },
+ "id": {
+ "type": "string",
+ "title": "Id"
+ },
"workspace_id": {
- "anyOf": [{ "type": "string" }, { "type": "null" }],
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
"title": "Workspace Id"
},
- "url": { "type": "string", "title": "Url" },
+ "url": {
+ "type": "string",
+ "title": "Url"
+ },
"created_at": {
"type": "string",
"format": "date-time",
@@ -4312,18 +5637,33 @@
}
},
"type": "object",
- "required": ["id", "workspace_id", "url", "created_at"],
+ "required": [
+ "id",
+ "workspace_id",
+ "url",
+ "created_at"
+ ],
"title": "WebhookEndpoint"
},
"WebhookEndpointCreate": {
- "properties": { "url": { "type": "string", "title": "Url" } },
+ "properties": {
+ "url": {
+ "type": "string",
+ "title": "Url"
+ }
+ },
"type": "object",
- "required": ["url"],
+ "required": [
+ "url"
+ ],
"title": "WebhookEndpointCreate"
},
"Workspace": {
"properties": {
- "id": { "type": "string", "title": "Id" },
+ "id": {
+ "type": "string",
+ "title": "Id"
+ },
"metadata": {
"additionalProperties": true,
"type": "object",
@@ -4341,36 +5681,55 @@
}
},
"type": "object",
- "required": ["id", "created_at"],
+ "required": [
+ "id",
+ "created_at"
+ ],
"title": "Workspace"
},
"WorkspaceConfiguration": {
"properties": {
"deriver": {
"anyOf": [
- { "$ref": "#/components/schemas/DeriverConfiguration" },
- { "type": "null" }
+ {
+ "$ref": "#/components/schemas/DeriverConfiguration"
+ },
+ {
+ "type": "null"
+ }
],
"description": "Configuration for deriver functionality."
},
"peer_card": {
"anyOf": [
- { "$ref": "#/components/schemas/PeerCardConfiguration" },
- { "type": "null" }
+ {
+ "$ref": "#/components/schemas/PeerCardConfiguration"
+ },
+ {
+ "type": "null"
+ }
],
"description": "Configuration for peer card functionality. If deriver is disabled, peer cards will also be disabled and these settings will be ignored."
},
"summary": {
"anyOf": [
- { "$ref": "#/components/schemas/SummaryConfiguration" },
- { "type": "null" }
+ {
+ "$ref": "#/components/schemas/SummaryConfiguration"
+ },
+ {
+ "type": "null"
+ }
],
"description": "Configuration for summary functionality."
},
"dream": {
"anyOf": [
- { "$ref": "#/components/schemas/DreamConfiguration" },
- { "type": "null" }
+ {
+ "$ref": "#/components/schemas/DreamConfiguration"
+ },
+ {
+ "type": "null"
+ }
],
"description": "Configuration for dream functionality. If deriver is disabled, dreams will also be disabled and these settings will be ignored."
}
@@ -4400,15 +5759,22 @@
}
},
"type": "object",
- "required": ["id"],
+ "required": [
+ "id"
+ ],
"title": "WorkspaceCreate"
},
"WorkspaceGet": {
"properties": {
"filters": {
"anyOf": [
- { "additionalProperties": true, "type": "object" },
- { "type": "null" }
+ {
+ "additionalProperties": true,
+ "type": "object"
+ },
+ {
+ "type": "null"
+ }
],
"title": "Filters"
}
@@ -4420,15 +5786,24 @@
"properties": {
"metadata": {
"anyOf": [
- { "additionalProperties": true, "type": "object" },
- { "type": "null" }
+ {
+ "additionalProperties": true,
+ "type": "object"
+ },
+ {
+ "type": "null"
+ }
],
"title": "Metadata"
},
"configuration": {
"anyOf": [
- { "$ref": "#/components/schemas/WorkspaceConfiguration" },
- { "type": "null" }
+ {
+ "$ref": "#/components/schemas/WorkspaceConfiguration"
+ },
+ {
+ "type": "null"
+ }
]
}
},
@@ -4436,6 +5811,11 @@
"title": "WorkspaceUpdate"
}
},
- "securitySchemes": { "HTTPBearer": { "type": "http", "scheme": "bearer" } }
+ "securitySchemes": {
+ "HTTPBearer": {
+ "type": "http",
+ "scheme": "bearer"
+ }
+ }
}
}
diff --git a/mcp/bun.lock b/mcp/bun.lock
index 61644df3..26363de9 100644
--- a/mcp/bun.lock
+++ b/mcp/bun.lock
@@ -4,11 +4,10 @@
"": {
"name": "honcho-mcp-proxy",
"dependencies": {
- "@honcho-ai/sdk": "^1.2.1",
+ "@honcho-ai/sdk": "^1.6.0",
},
"devDependencies": {
"@cloudflare/workers-types": "^4.20241002.0",
- "only-allow": "^1.2.1",
"typescript": "^5.3.3",
"wrangler": "^4.24.3",
},
@@ -85,9 +84,9 @@
"@esbuild/win32-x64": ["@esbuild/win32-x64@0.25.4", "", { "os": "win32", "cpu": "x64" }, "sha512-nOT2vZNw6hJ+z43oP1SPea/G/6AbN6X+bGNhNuq8NtRHy4wsMhw765IKLNmnjek7GvjWBYQ8Q5VBoYTFg9y1UQ=="],
- "@honcho-ai/core": ["@honcho-ai/core@1.2.0", "", { "dependencies": { "@types/node": "^18.11.18", "@types/node-fetch": "^2.6.4", "abort-controller": "^3.0.0", "agentkeepalive": "^4.2.1", "form-data-encoder": "1.7.2", "formdata-node": "^4.3.2", "node-fetch": "^2.6.7" } }, "sha512-VPHCFIGfC00GeE4P83DDIT7hkuMnMVkWlMTmMd2tw4HSEUciqLBh09AX/6aMKfJAzprg1diub6pJJ6LJP6eJ+g=="],
+ "@honcho-ai/core": ["@honcho-ai/core@1.8.0", "", { "dependencies": { "@types/node": "^18.11.18", "@types/node-fetch": "^2.6.4", "abort-controller": "^3.0.0", "agentkeepalive": "^4.2.1", "form-data-encoder": "1.7.2", "formdata-node": "^4.3.2", "node-fetch": "^2.6.7" } }, "sha512-qxBNoXLezH8yx4iBoz4Bsxkm9zp4Gm1fNwuP8gHRdSelxhR0dXpvLffx8B5V0XFWsx+SfPaJFyaKw0X2sYMwLA=="],
- "@honcho-ai/sdk": ["@honcho-ai/sdk@1.2.1", "", { "dependencies": { "@honcho-ai/core": "1.2.0", "@types/node": "^24.0.1" } }, "sha512-/RFHq9R9XsD1uj3KPZkZ4aGMuyan6gmIXu3HFND7Aipe3PGFeMEmteFmcMVGi3FO3F5S+NJsfqppV9Z3dNfeyQ=="],
+ "@honcho-ai/sdk": ["@honcho-ai/sdk@1.6.0", "", { "dependencies": { "@honcho-ai/core": "^1.6.1", "@types/node": "^24.0.1", "zod": "4.0.0" } }, "sha512-6HSjTidVwchEWw18p5Gqp4e2/I1Um0EppTZYZ22+hG1UemKRcJX+VDRvlu5ja8inD/WWYTEOJ/HBSdT8OC9biw=="],
"@img/sharp-darwin-arm64": ["@img/sharp-darwin-arm64@0.33.5", "", { "optionalDependencies": { "@img/sharp-libvips-darwin-arm64": "1.0.4" }, "os": "darwin", "cpu": "arm64" }, "sha512-UT4p+iz/2H4twwAoLCqfA9UH5pI6DggwKEGuaPy7nCVQ8ZsiY5PIcrRvD1DzuY3qYL07NtIQcWnBSY/heikIFQ=="],
@@ -247,8 +246,6 @@
"ohash": ["ohash@2.0.11", "", {}, "sha512-RdR9FQrFwNBNXAr4GixM8YaRZRJ5PUWbKYbE5eOsrwAjJW0q2REGcf79oYPsLyskQCZG1PLN+S/K1V00joZAoQ=="],
- "only-allow": ["only-allow@1.2.1", "", { "dependencies": { "which-pm-runs": "^1.1.0" }, "bin": { "only-allow": "bin.js" } }, "sha512-M7CJbmv7UCopc0neRKdzfoGWaVZC+xC1925GitKH9EAqYFzX9//25Q7oX4+jw0tiCCj+t5l6VZh8UPH23NZkMA=="],
-
"path-to-regexp": ["path-to-regexp@6.3.0", "", {}, "sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ=="],
"pathe": ["pathe@2.0.3", "", {}, "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w=="],
@@ -283,8 +280,6 @@
"whatwg-url": ["whatwg-url@5.0.0", "", { "dependencies": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" } }, "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw=="],
- "which-pm-runs": ["which-pm-runs@1.1.0", "", {}, "sha512-n1brCuqClxfFfq/Rb0ICg9giSZqCS+pLtccdag6C2HyufBrh3fBOiy9nb6ggRMvWOVH5GrdJskj5iGTZNxd7SA=="],
-
"workerd": ["workerd@1.20250712.0", "", { "optionalDependencies": { "@cloudflare/workerd-darwin-64": "1.20250712.0", "@cloudflare/workerd-darwin-arm64": "1.20250712.0", "@cloudflare/workerd-linux-64": "1.20250712.0", "@cloudflare/workerd-linux-arm64": "1.20250712.0", "@cloudflare/workerd-windows-64": "1.20250712.0" }, "bin": { "workerd": "bin/workerd" } }, "sha512-7h+k1OxREpiZW0849g0uQNexRWMcs5i5gUGhJzCY8nIx6Tv4D/ndlXJ47lEFj7/LQdp165IL9dM2D5uDiedZrg=="],
"wrangler": ["wrangler@4.26.0", "", { "dependencies": { "@cloudflare/kv-asset-handler": "0.4.0", "@cloudflare/unenv-preset": "2.4.1", "blake3-wasm": "2.1.5", "esbuild": "0.25.4", "miniflare": "4.20250712.2", "path-to-regexp": "6.3.0", "unenv": "2.0.0-rc.17", "workerd": "1.20250712.0" }, "optionalDependencies": { "fsevents": "~2.3.2" }, "peerDependencies": { "@cloudflare/workers-types": "^4.20250712.0" }, "optionalPeers": ["@cloudflare/workers-types"], "bin": { "wrangler": "bin/wrangler.js", "wrangler2": "bin/wrangler.js" } }, "sha512-EXuwyWlgYQZv6GJlyE0lVGk9hHqASssuECECT1XC5aIijTwNLQhsj/TOZ0hKSFlMbVr1E+OAdevAxd0kaF4ovA=="],
@@ -295,10 +290,12 @@
"youch-core": ["youch-core@0.3.3", "", { "dependencies": { "@poppinss/exception": "^1.2.2", "error-stack-parser-es": "^1.0.5" } }, "sha512-ho7XuGjLaJ2hWHoK8yFnsUGy2Y5uDpqSTq1FkHLK4/oqKtyUU1AFbOOxY4IpC9f0fTLjwYbslUz0Po5BpD1wrA=="],
- "zod": ["zod@3.22.3", "", {}, "sha512-EjIevzuJRiRPbVH4mGc8nApb/lVLKVpmUhAaR5R5doKGfAnGJ6Gr3CViAVjP+4FWSxCsybeWQdcgCtbX+7oZug=="],
+ "zod": ["zod@4.0.0", "", {}, "sha512-9diLdTPc/L7w/5jI4C3gHYNiGHDV9IZYxo1e5LSD8cabi65WVTWWb+g2BGPEpUUCOxR4D+6O5B0AzyMdUAXwrw=="],
"@honcho-ai/core/@types/node": ["@types/node@18.19.120", "", { "dependencies": { "undici-types": "~5.26.4" } }, "sha512-WtCGHFXnVI8WHLxDAt5TbnCM4eSE+nI0QN2NJtwzcgMhht2eNz6V9evJrk+lwC8bCY8OWV5Ym8Jz7ZEyGnKnMA=="],
+ "miniflare/zod": ["zod@3.22.3", "", {}, "sha512-EjIevzuJRiRPbVH4mGc8nApb/lVLKVpmUhAaR5R5doKGfAnGJ6Gr3CViAVjP+4FWSxCsybeWQdcgCtbX+7oZug=="],
+
"@honcho-ai/core/@types/node/undici-types": ["undici-types@5.26.5", "", {}, "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA=="],
}
}
diff --git a/mcp/package.json b/mcp/package.json
index c77cd31e..c13b93ba 100644
--- a/mcp/package.json
+++ b/mcp/package.json
@@ -9,13 +9,13 @@
"bun": ">=1.2.0"
},
"scripts": {
- "preinstall": "node -e \"if(process.env.npm_config_user_agent?.includes('npm')){console.error('❌ Please use bun instead of npm!\\n📦 Run: bun install\\n🌐 Install bun: https://bun.sh/');process.exit(1)}\"",
+ "preinstall": "node -e \"const ua=process.env.npm_config_user_agent||'';if(ua.includes('npm')&&!ua.includes('bun')){console.error('❌ Please use bun instead of npm!\\n📦 Run: bun install\\n🌐 Install bun: https://bun.sh/');process.exit(1)}\"",
"dev": "wrangler dev",
"deploy": "wrangler deploy",
"deploy:staging": "wrangler deploy --env staging"
},
"dependencies": {
- "@honcho-ai/sdk": "^1.2.1"
+ "@honcho-ai/sdk": "^1.6.0"
},
"devDependencies": {
"@cloudflare/workers-types": "^4.20241002.0",
diff --git a/mcp/worker.ts b/mcp/worker.ts
index 74dcc5bd..2b558852 100644
--- a/mcp/worker.ts
+++ b/mcp/worker.ts
@@ -1,515 +1,598 @@
-import { Honcho } from '@honcho-ai/sdk';
+import { Honcho } from "@honcho-ai/sdk";
interface HonchoConfig {
- apiKey: string;
- userName: string;
- baseUrl?: string;
- workspaceId?: string;
- assistantName?: string;
+ apiKey: string;
+ userName: string;
+ baseUrl?: string;
+ workspaceId?: string;
+ assistantName?: string;
}
interface Message {
- role: 'user' | 'assistant';
- content: string;
- metadata?: Record;
+ role: "user" | "assistant";
+ content: string;
+ metadata?: Record;
}
/**
* JSON-RPC 2.0 request interface
*/
interface JsonRpcRequest {
- jsonrpc: '2.0';
- method: string;
- params?: any;
- id?: string | number;
+ jsonrpc: "2.0";
+ method: string;
+ params?: any;
+ id?: string | number;
}
/**
* JSON-RPC 2.0 response interface
*/
interface JsonRpcResponse {
- jsonrpc: '2.0';
- id?: string | number | null;
- result?: any;
- error?: {
- code: number;
- message: string;
- data?: any;
- };
+ jsonrpc: "2.0";
+ id?: string | number | null;
+ result?: any;
+ error?: {
+ code: number;
+ message: string;
+ data?: any;
+ };
}
// MCP Tool definitions
interface Tool {
- name: string;
- description: string;
- inputSchema: {
- type: 'object';
- properties: Record;
- required?: string[];
- };
+ name: string;
+ description: string;
+ inputSchema: {
+ type: "object";
+ properties: Record;
+ required?: string[];
+ };
}
/**
* Helper function to validate required arguments and create error responses
*/
-function validateArguments(args: Record, required: string[], requestId: string | number | null): Response | null {
- for (const param of required) {
- if (!args[param]) {
- return createErrorResponse(requestId, -32602, `${param} is required`);
- }
+function validateArguments(
+ args: Record,
+ required: string[],
+ requestId: string | number | null,
+): Response | null {
+ for (const param of required) {
+ if (!args[param]) {
+ return createErrorResponse(requestId, -32602, `${param} is required`);
}
+ }
- // Special validation for arrays
- if (args.messages && !Array.isArray(args.messages)) {
- return createErrorResponse(requestId, -32602, 'messages must be an array');
- }
- if (args.peer_ids && !Array.isArray(args.peer_ids)) {
- return createErrorResponse(requestId, -32602, 'peer_ids must be an array');
- }
+ // Special validation for arrays
+ if (args.messages && !Array.isArray(args.messages)) {
+ return createErrorResponse(requestId, -32602, "messages must be an array");
+ }
+ if (args.peer_ids && !Array.isArray(args.peer_ids)) {
+ return createErrorResponse(requestId, -32602, "peer_ids must be an array");
+ }
- return null;
+ return null;
}
/**
* Helper function to create error responses
*/
-function createErrorResponse(id: string | number | null, code: number, message: string): Response {
- return new Response(JSON.stringify(createJsonRpcResponse(id, undefined, createJsonRpcError(code, message))), {
- status: code === -32602 ? 400 : (code === -32601 ? 404 : 500),
- headers: { 'Content-Type': 'application/json' },
- });
+function createErrorResponse(
+ id: string | number | null,
+ code: number,
+ message: string,
+): Response {
+ return new Response(
+ JSON.stringify(
+ createJsonRpcResponse(id, undefined, createJsonRpcError(code, message)),
+ ),
+ {
+ status: code === -32602 ? 400 : code === -32601 ? 404 : 500,
+ headers: { "Content-Type": "application/json" },
+ },
+ );
}
/**
* Helper function to format messages for async iteration
*/
async function formatMessages(messagesPage: any): Promise {
- const messages = [];
- for await (const message of messagesPage) {
- messages.push({
- id: message.id,
- content: message.content,
- peer_id: message.peer_id,
- session_id: message.session_id,
- metadata: message.metadata,
- created_at: message.created_at,
- });
- }
- return messages;
+ const messages = [];
+ for await (const message of messagesPage) {
+ messages.push({
+ id: message.id,
+ content: message.content,
+ peer_id: message.peer_id,
+ session_id: message.session_id,
+ metadata: message.metadata,
+ created_at: message.created_at,
+ });
+ }
+ return messages;
}
class HonchoWorker {
- private honcho: Honcho;
- private config: HonchoConfig;
+ private honcho: Honcho;
+ private config: HonchoConfig;
- constructor(config: HonchoConfig) {
- this.config = {
- baseUrl: 'https://api.honcho.dev',
- workspaceId: 'default',
- assistantName: 'Assistant',
- ...config,
- };
+ constructor(config: HonchoConfig) {
+ this.config = {
+ baseUrl: "https://api.honcho.dev",
+ workspaceId: "default",
+ assistantName: "Assistant",
+ ...config,
+ };
- this.honcho = new Honcho({
- apiKey: this.config.apiKey,
- baseURL: this.config.baseUrl,
- workspaceId: this.config.workspaceId,
- });
- }
+ this.honcho = new Honcho({
+ apiKey: this.config.apiKey,
+ baseURL: this.config.baseUrl,
+ workspaceId: this.config.workspaceId,
+ });
+ }
- ////////////////////////////////////////////////////////////////////////////////
- /// ///
- /// "Bespoke" tools: easy to use for user-assistant conversation paradigms ///
- /// ///
- ////////////////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////////////////
+ /// ///
+ /// "Bespoke" tools: easy to use for user-assistant conversation paradigms ///
+ /// ///
+ ////////////////////////////////////////////////////////////////////////////////
- /**
- * Start a new conversation with a user. Call this when a user starts a new conversation.
- * @returns A session ID for the conversation
- */
- async startConversation(): Promise {
- // Get/create the assistant peer with observe_me=false
- const assistant = this.honcho.peer(this.config.assistantName!, { config: { observe_me: false } });
+ /**
+ * Start a new conversation with a user. Call this when a user starts a new conversation.
+ * @returns A session ID for the conversation
+ */
+ async startConversation(): Promise {
+ // Get/create the peers first, before session creation
+ // This avoids a race condition where peer creation during session.addPeers
+ // could rollback the session if there's an IntegrityError
+ const userPeer = await this.honcho.peer(this.config.userName);
+ const assistantPeer = await this.honcho.peer(this.config.assistantName!, {
+ config: { observe_me: false },
+ });
- // Create a new session
- const sessionId = crypto.randomUUID();
- const session = this.honcho.session(sessionId);
+ // Create a new session - pass empty config to force API call
+ const sessionId = crypto.randomUUID();
+ const session = await this.honcho.session(sessionId, { config: {} });
- // Add the user and assistant peers to the session
- // @ts-expect-error - API accepts null for observe_me despite type definition
- await session.addPeers([this.config.userName, [assistant, { observe_me: null, observe_others: false }]]);
+ // Add the user and assistant peers to the session
+ await session.addPeers([
+ userPeer,
+ [assistantPeer, { observe_me: null, observe_others: false }],
+ ]);
- return sessionId;
- }
+ return sessionId;
+ }
- /**
- * Add a turn to a conversation. Call this after a user has sent a message and the assistant has responded.
- * @param sessionId - The ID of the session to add the turn to
- * @param messages - A list of messages to add to the session
- */
- async addTurn(sessionId: string, messages: Message[]): Promise {
- const session = this.honcho.session(sessionId);
- const userPeer = this.honcho.peer(this.config.userName);
- const assistantPeer = this.honcho.peer(this.config.assistantName!);
+ /**
+ * Add a turn to a conversation. Call this after a user has sent a message and the assistant has responded.
+ * @param sessionId - The ID of the session to add the turn to
+ * @param messages - A list of messages to add to the session
+ */
+ async addTurn(sessionId: string, messages: Message[]): Promise {
+ const session = await this.honcho.session(sessionId);
+ const userPeer = await this.honcho.peer(this.config.userName);
+ const assistantPeer = await this.honcho.peer(this.config.assistantName!);
- const sessionMessages = [];
+ const sessionMessages = [];
- for (let i = 0; i < messages.length; i++) {
- const message = messages[i];
+ for (let i = 0; i < messages.length; i++) {
+ const message = messages[i];
- // Validate required fields
- if (!message || typeof message !== 'object') {
- throw new Error(`Message at index ${i} must be a dictionary`);
- }
+ // Validate required fields
+ if (!message || typeof message !== "object") {
+ throw new Error(`Message at index ${i} must be a dictionary`);
+ }
- if (!message.role) {
- throw new Error(`Message at index ${i} is missing required field 'role'`);
- }
+ if (!message.role) {
+ throw new Error(
+ `Message at index ${i} is missing required field 'role'`,
+ );
+ }
- if (!message.content) {
- throw new Error(`Message at index ${i} is missing required field 'content'`);
- }
+ if (!message.content) {
+ throw new Error(
+ `Message at index ${i} is missing required field 'content'`,
+ );
+ }
- const { role, content, metadata } = message;
+ const { role, content, metadata } = message;
- // Create message with appropriate peer
- if (role === 'user') {
- if (metadata) {
- sessionMessages.push(userPeer.message(content, { metadata }));
- } else {
- sessionMessages.push(userPeer.message(content));
- }
- } else if (role === 'assistant') {
- if (metadata) {
- sessionMessages.push(assistantPeer.message(content, { metadata }));
- } else {
- sessionMessages.push(assistantPeer.message(content));
- }
- } else {
- throw new Error(`Invalid role '${role}' at message index ${i}. Role must be one of: 'user' or 'assistant'`);
- }
- }
-
- await session.addMessages(sessionMessages);
- }
-
- /**
- * Get personalization insights about the user, based on the query and the accumulated knowledge of the user across all conversations.
- * @param sessionId - The ID of the session for context
- * @param query - The question about the user's preferences, habits, etc.
- * @returns A string with the personalization insights
- */
- async getPersonalizationInsights(sessionId: string, query: string): Promise {
- const userPeer = this.honcho.peer(this.config.userName);
-
- // Get the personalization insights
- const personalizationInsights = await userPeer.chat(query, { sessionId });
-
- if (!personalizationInsights) {
- return "No personalization insights found.";
- }
-
- return personalizationInsights;
- }
-
- ////////////////////////////////////////////////////////////////////////////////
- /// ///
- /// General tools for using Honcho ///
- /// ///
- ////////////////////////////////////////////////////////////////////////////////
-
- //////////////////////////////////////////////////////
- /// ///
- /// Workspace operations ///
- /// ///
- //////////////////////////////////////////////////////
-
- /**
- * Search for messages across the entire workspace.
- * @param query - The search query to use
- * @returns A list of message dictionaries matching the search query
- */
- async searchWorkspace(query: string): Promise {
- const messagesPage = await this.honcho.search(query);
- return await formatMessages(messagesPage);
- }
-
- /**
- * Get metadata for the current workspace.
- * @returns A dictionary containing the workspace's metadata
- */
- async getWorkspaceMetadata(): Promise> {
- return await this.honcho.getMetadata();
- }
-
- /**
- * Set metadata for the current workspace.
- * @param metadata - A dictionary of metadata to associate with the workspace
- */
- async setWorkspaceMetadata(metadata: Record): Promise {
- await this.honcho.setMetadata(metadata);
- }
-
- //////////////////////////////////////////////////////
- /// ///
- /// Peer operations ///
- /// ///
- //////////////////////////////////////////////////////
-
- /**
- * Create or get a peer with the specified ID and optional configuration.
- * @param peerId - Unique identifier for the peer
- * @param config - Optional configuration dictionary for the peer
- * @returns A dictionary with the peer ID and confirmation of creation
- */
- async createPeer(peerId: string, config?: Record): Promise<{ peer_id: string; config?: Record }> {
- const peer = this.honcho.peer(peerId, { config });
- return {
- peer_id: peer.id,
- config,
- };
- }
-
- /**
- * Get metadata for a specific peer.
- * @param peerId - The ID of the peer to get metadata for
- * @returns A dictionary containing the peer's metadata
- */
- async getPeerMetadata(peerId: string): Promise> {
- const peer = this.honcho.peer(peerId);
- return await peer.getMetadata();
- }
-
- /**
- * Set metadata for a specific peer.
- * @param peerId - The ID of the peer to set metadata for
- * @param metadata - A dictionary of metadata to associate with the peer
- */
- async setPeerMetadata(peerId: string, metadata: Record): Promise {
- const peer = this.honcho.peer(peerId);
- await peer.setMetadata(metadata);
- }
-
- /**
- * Search for messages sent by a peer.
- * @param peerId - The ID of the peer to search messages for
- * @param query - The search query to use
- * @returns A list of message dictionaries matching the search query
- */
- async searchPeerMessages(peerId: string, query: string): Promise {
- const peer = this.honcho.peer(peerId);
- const messagesPage = await peer.search(query);
- return await formatMessages(messagesPage);
- }
-
- /**
- * Query a peer's representation with natural language questions.
- * @param peerId - The ID of the peer to query
- * @param query - The natural language question to ask
- * @param targetPeerId - Optional target peer ID for local representation queries
- * @param sessionId - Optional session ID to scope the query to a specific session
- * @returns Response string containing the answer to the query, or "None" if no relevant information
- */
- async chat(peerId: string, query: string, targetPeerId?: string, sessionId?: string): Promise {
- const peer = this.honcho.peer(peerId);
- let targetPeer;
- if (targetPeerId) {
- targetPeer = this.honcho.peer(targetPeerId);
- }
-
- const result = await peer.chat(query, { target: targetPeer, sessionId });
- return result || "None";
- }
-
- /**
- * Get all peers in the current workspace.
- * @returns A list of peer dictionaries with their IDs
- */
- async listPeers(): Promise<{ id: string }[]> {
- const peersPage = await this.honcho.getPeers();
- const peers = [];
-
- for await (const peer of peersPage) {
- peers.push({
- id: peer.id,
- });
- }
-
- return peers;
- }
-
- //////////////////////////////////////////////////////
- /// ///
- /// Session operations ///
- /// ///
- //////////////////////////////////////////////////////
-
- /**
- * Create or get a session with the specified ID and optional configuration.
- * @param sessionId - Unique identifier for the session
- * @param config - Optional configuration dictionary for the session
- * @returns A dictionary with the session ID and confirmation of creation
- */
- async createSession(sessionId: string, config?: Record): Promise<{ session_id: string; config?: Record }> {
- const session = this.honcho.session(sessionId, { config });
- return {
- session_id: session.id,
- config,
- };
- }
-
- /**
- * Get metadata for a specific session.
- * @param sessionId - The ID of the session to get metadata for
- * @returns A dictionary containing the session's metadata
- */
- async getSessionMetadata(sessionId: string): Promise> {
- const session = this.honcho.session(sessionId);
- return await session.getMetadata();
- }
-
- /**
- * Set metadata for a specific session.
- * @param sessionId - The ID of the session to set metadata for
- * @param metadata - A dictionary of metadata to associate with the session
- */
- async setSessionMetadata(sessionId: string, metadata: Record): Promise {
- const session = this.honcho.session(sessionId);
- await session.setMetadata(metadata);
- }
-
- /**
- * Add peers to a session.
- * @param sessionId - The ID of the session to add peers to
- * @param peerIds - List of peer IDs to add to the session
- */
- async addPeersToSession(sessionId: string, peerIds: string[]): Promise {
- const session = this.honcho.session(sessionId);
- await session.addPeers(peerIds);
- }
-
- /**
- * Remove peers from a session.
- * @param sessionId - The ID of the session to remove peers from
- * @param peerIds - List of peer IDs to remove from the session
- */
- async removePeersFromSession(sessionId: string, peerIds: string[]): Promise {
- const session = this.honcho.session(sessionId);
- await session.removePeers(peerIds);
- }
-
- /**
- * Get all peer IDs in a session.
- * @param sessionId - The ID of the session to get peers from
- * @returns A list of peer IDs that are members of the session
- */
- async getSessionPeers(sessionId: string): Promise {
- const session = this.honcho.session(sessionId);
- const peers = await session.getPeers();
- return peers.map(peer => peer.id);
- }
-
- /**
- * Add messages to a session.
- * @param sessionId - The ID of the session to add messages to
- * @param messages - List of message dictionaries
- */
- async addMessagesToSession(sessionId: string, messages: { peer_id: string; content: string; metadata?: Record }[]): Promise {
- const session = this.honcho.session(sessionId);
-
- const sessionMessages = [];
- for (const message of messages) {
- const peer = this.honcho.peer(message.peer_id);
- if (message.metadata) {
- sessionMessages.push(peer.message(message.content, { metadata: message.metadata }));
- } else {
- sessionMessages.push(peer.message(message.content));
- }
- }
-
- await session.addMessages(sessionMessages);
- }
-
- /**
- * Get messages from a session with optional filtering.
- * @param sessionId - The ID of the session to get messages from
- * @param filters - Optional dictionary of filter criteria
- * @returns A list of message dictionaries
- */
- async getSessionMessages(sessionId: string, filters?: Record): Promise {
- const session = this.honcho.session(sessionId);
- const messagesPage = await session.getMessages({ filter: filters });
- return await formatMessages(messagesPage);
- }
-
- /**
- * Get optimized context for a session within a token limit.
- * @param sessionId - The ID of the session to get context for
- * @param summary - Whether to include summary information
- * @param tokens - Maximum number of tokens to include in the context
- * @returns A dictionary containing the session context with messages and optional summary
- */
- async getSessionContext(sessionId: string, summary: boolean = true, tokens?: number): Promise {
- const session = this.honcho.session(sessionId);
- const context = await session.getContext({ summary, tokens });
-
- return {
- session_id: context.sessionId,
- summary: context.summary,
- messages: context.messages.map(msg => ({
- id: msg.id,
- content: msg.content,
- peer_id: msg.peer_id,
- metadata: msg.metadata,
- created_at: msg.created_at,
- })),
- };
- }
-
- /**
- * Search for messages in a specific session.
- * @param sessionId - The ID of the session to search messages in
- * @param query - The search query to use
- * @returns A list of message dictionaries matching the search query
- */
- async searchSessionMessages(sessionId: string, query: string): Promise {
- const session = this.honcho.session(sessionId);
- const messagesPage = await session.search(query);
- return await formatMessages(messagesPage);
- }
-
- /**
- * Get the current working representation of a peer in a session.
- * @param sessionId - The ID of the session
- * @param peerId - The ID of the peer to get the working representation of
- * @param targetPeerId - Optional target peer ID to get the representation of what peer_id knows about target_peer_id
- * @returns A dictionary containing information about the peer
- */
- async getWorkingRepresentation(sessionId: string, peerId: string, targetPeerId?: string): Promise> {
- const session = this.honcho.session(sessionId);
- if (targetPeerId) {
- return await session.workingRep(peerId, targetPeerId);
+ // Create message with appropriate peer
+ if (role === "user") {
+ if (metadata) {
+ sessionMessages.push(userPeer.message(content, { metadata }));
} else {
- return await session.workingRep(peerId);
+ sessionMessages.push(userPeer.message(content));
}
+ } else if (role === "assistant") {
+ if (metadata) {
+ sessionMessages.push(assistantPeer.message(content, { metadata }));
+ } else {
+ sessionMessages.push(assistantPeer.message(content));
+ }
+ } else {
+ throw new Error(
+ `Invalid role '${role}' at message index ${i}. Role must be one of: 'user' or 'assistant'`,
+ );
+ }
}
- /**
- * Get all sessions in the current workspace.
- * @returns A list of session dictionaries with their IDs
- */
- async listSessions(): Promise<{ id: string }[]> {
- const sessionsPage = await this.honcho.getSessions();
- const sessions = [];
+ await session.addMessages(sessionMessages);
+ }
- for await (const session of sessionsPage) {
- sessions.push({
- id: session.id,
- });
- }
+ /**
+ * Get personalization insights about the user, based on the query and the accumulated knowledge of the user across all conversations.
+ * @param sessionId - The ID of the session for context
+ * @param query - The question about the user's preferences, habits, etc.
+ * @returns A string with the personalization insights
+ */
+ async getPersonalizationInsights(
+ sessionId: string,
+ query: string,
+ ): Promise {
+ const userPeer = await this.honcho.peer(this.config.userName);
- return sessions;
+ // Get the personalization insights (non-streaming returns string | null)
+ const personalizationInsights = await userPeer.chat(query, {
+ session: sessionId,
+ });
+
+ if (!personalizationInsights || typeof personalizationInsights !== 'string') {
+ return "No personalization insights found.";
}
+
+ return personalizationInsights;
+ }
+
+ ////////////////////////////////////////////////////////////////////////////////
+ /// ///
+ /// General tools for using Honcho ///
+ /// ///
+ ////////////////////////////////////////////////////////////////////////////////
+
+ //////////////////////////////////////////////////////
+ /// ///
+ /// Workspace operations ///
+ /// ///
+ //////////////////////////////////////////////////////
+
+ /**
+ * Search for messages across the entire workspace.
+ * @param query - The search query to use
+ * @returns A list of message dictionaries matching the search query
+ */
+ async searchWorkspace(query: string): Promise {
+ const messagesPage = await this.honcho.search(query);
+ return await formatMessages(messagesPage);
+ }
+
+ /**
+ * Get metadata for the current workspace.
+ * @returns A dictionary containing the workspace's metadata
+ */
+ async getWorkspaceMetadata(): Promise> {
+ return await this.honcho.getMetadata();
+ }
+
+ /**
+ * Set metadata for the current workspace.
+ * @param metadata - A dictionary of metadata to associate with the workspace
+ */
+ async setWorkspaceMetadata(metadata: Record): Promise {
+ await this.honcho.setMetadata(metadata);
+ }
+
+ //////////////////////////////////////////////////////
+ /// ///
+ /// Peer operations ///
+ /// ///
+ //////////////////////////////////////////////////////
+
+ /**
+ * Create or get a peer with the specified ID and optional configuration.
+ * @param peerId - Unique identifier for the peer
+ * @param config - Optional configuration dictionary for the peer
+ * @returns A dictionary with the peer ID and confirmation of creation
+ */
+ async createPeer(
+ peerId: string,
+ config?: Record,
+ ): Promise<{ peer_id: string; config?: Record }> {
+ const peer = await this.honcho.peer(peerId, { config });
+ return {
+ peer_id: peer.id,
+ config,
+ };
+ }
+
+ /**
+ * Get metadata for a specific peer.
+ * @param peerId - The ID of the peer to get metadata for
+ * @returns A dictionary containing the peer's metadata
+ */
+ async getPeerMetadata(peerId: string): Promise> {
+ const peer = await this.honcho.peer(peerId);
+ return await peer.getMetadata();
+ }
+
+ /**
+ * Set metadata for a specific peer.
+ * @param peerId - The ID of the peer to set metadata for
+ * @param metadata - A dictionary of metadata to associate with the peer
+ */
+ async setPeerMetadata(
+ peerId: string,
+ metadata: Record,
+ ): Promise {
+ const peer = await this.honcho.peer(peerId);
+ await peer.setMetadata(metadata);
+ }
+
+ /**
+ * Search for messages sent by a peer.
+ * @param peerId - The ID of the peer to search messages for
+ * @param query - The search query to use
+ * @returns A list of message dictionaries matching the search query
+ */
+ async searchPeerMessages(peerId: string, query: string): Promise {
+ const peer = await this.honcho.peer(peerId);
+ const messagesPage = await peer.search(query);
+ return await formatMessages(messagesPage);
+ }
+
+ /**
+ * Query a peer's representation with natural language questions.
+ * @param peerId - The ID of the peer to query
+ * @param query - The natural language question to ask
+ * @param targetPeerId - Optional target peer ID for local representation queries
+ * @param sessionId - Optional session ID to scope the query to a specific session
+ * @returns Response string containing the answer to the query, or "None" if no relevant information
+ */
+ async chat(
+ peerId: string,
+ query: string,
+ targetPeerId?: string,
+ sessionId?: string,
+ ): Promise {
+ const peer = await this.honcho.peer(peerId);
+ let targetPeer;
+ if (targetPeerId) {
+ targetPeer = await this.honcho.peer(targetPeerId);
+ }
+
+ const result = await peer.chat(query, {
+ target: targetPeer,
+ session: sessionId,
+ });
+
+ if (!result || typeof result !== 'string') {
+ return "None";
+ }
+ return result;
+ }
+
+ /**
+ * Get all peers in the current workspace.
+ * @returns A list of peer dictionaries with their IDs
+ */
+ async listPeers(): Promise<{ id: string }[]> {
+ const peersPage = await this.honcho.getPeers();
+ const peers = [];
+
+ for await (const peer of peersPage) {
+ peers.push({
+ id: peer.id,
+ });
+ }
+
+ return peers;
+ }
+
+ //////////////////////////////////////////////////////
+ /// ///
+ /// Session operations ///
+ /// ///
+ //////////////////////////////////////////////////////
+
+ /**
+ * Create or get a session with the specified ID and optional configuration.
+ * @param sessionId - Unique identifier for the session
+ * @param config - Optional configuration dictionary for the session
+ * @returns A dictionary with the session ID and confirmation of creation
+ */
+ async createSession(
+ sessionId: string,
+ config?: Record,
+ ): Promise<{ session_id: string; config?: Record }> {
+ // Always pass config (even if empty) to force the API call to create the session
+ // Without this, the SDK just creates a local Session object without making an API call
+ const session = await this.honcho.session(sessionId, { config: config ?? {} });
+ return {
+ session_id: session.id,
+ config,
+ };
+ }
+
+ /**
+ * Get metadata for a specific session.
+ * @param sessionId - The ID of the session to get metadata for
+ * @returns A dictionary containing the session's metadata
+ */
+ async getSessionMetadata(sessionId: string): Promise> {
+ const session = await this.honcho.session(sessionId);
+ return await session.getMetadata();
+ }
+
+ /**
+ * Set metadata for a specific session.
+ * @param sessionId - The ID of the session to set metadata for
+ * @param metadata - A dictionary of metadata to associate with the session
+ */
+ async setSessionMetadata(
+ sessionId: string,
+ metadata: Record,
+ ): Promise {
+ const session = await this.honcho.session(sessionId);
+ await session.setMetadata(metadata);
+ }
+
+ /**
+ * Add peers to a session.
+ * @param sessionId - The ID of the session to add peers to
+ * @param peerIds - List of peer IDs to add to the session
+ */
+ async addPeersToSession(sessionId: string, peerIds: string[]): Promise {
+ const session = await this.honcho.session(sessionId);
+ await session.addPeers(peerIds);
+ }
+
+ /**
+ * Remove peers from a session.
+ * @param sessionId - The ID of the session to remove peers from
+ * @param peerIds - List of peer IDs to remove from the session
+ */
+ async removePeersFromSession(
+ sessionId: string,
+ peerIds: string[],
+ ): Promise {
+ const session = await this.honcho.session(sessionId);
+ await session.removePeers(peerIds);
+ }
+
+ /**
+ * Get all peer IDs in a session.
+ * @param sessionId - The ID of the session to get peers from
+ * @returns A list of peer IDs that are members of the session
+ */
+ async getSessionPeers(sessionId: string): Promise {
+ const session = await this.honcho.session(sessionId);
+ const peers = await session.getPeers();
+ return peers.map((peer) => peer.id);
+ }
+
+ /**
+ * Add messages to a session.
+ * @param sessionId - The ID of the session to add messages to
+ * @param messages - List of message dictionaries
+ */
+ async addMessagesToSession(
+ sessionId: string,
+ messages: {
+ peer_id: string;
+ content: string;
+ metadata?: Record;
+ }[],
+ ): Promise {
+ const session = await this.honcho.session(sessionId);
+
+ const sessionMessages = [];
+ for (const message of messages) {
+ const peer = await this.honcho.peer(message.peer_id);
+ if (message.metadata) {
+ sessionMessages.push(
+ peer.message(message.content, { metadata: message.metadata }),
+ );
+ } else {
+ sessionMessages.push(peer.message(message.content));
+ }
+ }
+
+ await session.addMessages(sessionMessages);
+ }
+
+ /**
+ * Get messages from a session with optional filtering.
+ * @param sessionId - The ID of the session to get messages from
+ * @param filters - Optional dictionary of filter criteria
+ * @returns A list of message dictionaries
+ */
+ async getSessionMessages(
+ sessionId: string,
+ filters?: Record,
+ ): Promise {
+ const session = await this.honcho.session(sessionId);
+ const messagesPage = await session.getMessages({ filter: filters });
+ return await formatMessages(messagesPage);
+ }
+
+ /**
+ * Get optimized context for a session within a token limit.
+ * @param sessionId - The ID of the session to get context for
+ * @param summary - Whether to include summary information
+ * @param tokens - Maximum number of tokens to include in the context
+ * @returns A dictionary containing the session context with messages and optional summary
+ */
+ async getSessionContext(
+ sessionId: string,
+ summary: boolean = true,
+ tokens?: number,
+ ): Promise {
+ const session = await this.honcho.session(sessionId);
+ const context = await session.getContext({ summary, tokens });
+
+ return {
+ session_id: context.sessionId,
+ summary: context.summary,
+ messages: context.messages.map((msg) => ({
+ id: msg.id,
+ content: msg.content,
+ peer_id: msg.peer_id,
+ metadata: msg.metadata,
+ created_at: msg.created_at,
+ })),
+ };
+ }
+
+ /**
+ * Search for messages in a specific session.
+ * @param sessionId - The ID of the session to search messages in
+ * @param query - The search query to use
+ * @returns A list of message dictionaries matching the search query
+ */
+ async searchSessionMessages(
+ sessionId: string,
+ query: string,
+ ): Promise {
+ const session = await this.honcho.session(sessionId);
+ const messagesPage = await session.search(query);
+ return await formatMessages(messagesPage);
+ }
+
+ /**
+ * Get the current working representation of a peer in a session.
+ * @param sessionId - The ID of the session
+ * @param peerId - The ID of the peer to get the working representation of
+ * @param targetPeerId - Optional target peer ID to get the representation of what peer_id knows about target_peer_id
+ * @returns A dictionary containing information about the peer
+ */
+ async getWorkingRepresentation(
+ sessionId: string,
+ peerId: string,
+ targetPeerId?: string,
+ ): Promise> {
+ const session = await this.honcho.session(sessionId);
+ if (targetPeerId) {
+ return await session.workingRep(peerId, targetPeerId);
+ } else {
+ return await session.workingRep(peerId);
+ }
+ }
+
+ /**
+ * Get all sessions in the current workspace.
+ * @returns A list of session dictionaries with their IDs
+ */
+ async listSessions(): Promise<{ id: string }[]> {
+ const sessionsPage = await this.honcho.getSessions();
+ const sessions = [];
+
+ for await (const session of sessionsPage) {
+ sessions.push({
+ id: session.id,
+ });
+ }
+
+ return sessions;
+ }
}
/**
@@ -518,32 +601,34 @@ class HonchoWorker {
* @returns Configuration object or null if invalid
*/
function parseConfig(request: Request): HonchoConfig | null {
- // Get API key from Authorization header
- const authHeader = request.headers.get('Authorization');
- if (!authHeader || !authHeader.startsWith('Bearer ')) {
- return null;
- }
- const apiKey = authHeader.substring(7);
+ // Get API key from Authorization header
+ const authHeader = request.headers.get("Authorization");
+ if (!authHeader || !authHeader.startsWith("Bearer ")) {
+ return null;
+ }
+ const apiKey = authHeader.substring(7);
- if (!apiKey) {
- return null;
- }
+ if (!apiKey) {
+ return null;
+ }
- const userName = request.headers.get('X-Honcho-User-Name');
- if (!userName) {
- return null;
- }
+ const userName = request.headers.get("X-Honcho-User-Name");
+ if (!userName) {
+ return null;
+ }
- // Get configuration from headers with proper defaults
- const config: HonchoConfig = {
- apiKey,
- userName,
- baseUrl: request.headers.get('X-Honcho-Base-URL') || 'https://api.honcho.dev',
- workspaceId: request.headers.get('X-Honcho-Workspace-ID') || 'default',
- assistantName: request.headers.get('X-Honcho-Assistant-Name') || 'Assistant',
- };
+ // Get configuration from headers with proper defaults
+ const config: HonchoConfig = {
+ apiKey,
+ userName,
+ baseUrl:
+ request.headers.get("X-Honcho-Base-URL") || "https://api.honcho.dev",
+ workspaceId: request.headers.get("X-Honcho-Workspace-ID") || "default",
+ assistantName:
+ request.headers.get("X-Honcho-Assistant-Name") || "Assistant",
+ };
- return config;
+ return config;
}
/**
@@ -553,19 +638,23 @@ function parseConfig(request: Request): HonchoConfig | null {
* @param error - Error object if any
* @returns JSON-RPC response object
*/
-function createJsonRpcResponse(id: string | number | null, result?: any, error?: { code: number; message: string; data?: any }): JsonRpcResponse {
- const response: JsonRpcResponse = {
- jsonrpc: '2.0',
- id,
- };
+function createJsonRpcResponse(
+ id: string | number | null,
+ result?: any,
+ error?: { code: number; message: string; data?: any },
+): JsonRpcResponse {
+ const response: JsonRpcResponse = {
+ jsonrpc: "2.0",
+ id,
+ };
- if (error) {
- response.error = error;
- } else {
- response.result = result;
- }
+ if (error) {
+ response.error = error;
+ } else {
+ response.result = result;
+ }
- return response;
+ return response;
}
/**
@@ -575,770 +664,964 @@ function createJsonRpcResponse(id: string | number | null, result?: any, error?:
* @param data - Optional error data
* @returns Error object
*/
-function createJsonRpcError(code: number, message: string, data?: any): { code: number; message: string; data?: any } {
- return { code, message, data };
+function createJsonRpcError(
+ code: number,
+ message: string,
+ data?: any,
+): { code: number; message: string; data?: any } {
+ return { code, message, data };
}
// Define all MCP tools based on the Python server.py functions
const tools: Tool[] = [
- // Bespoke tools
- {
- name: 'start_conversation',
- description: 'Start a new conversation with a user. Call this when a user starts a new conversation.',
- inputSchema: {
- type: 'object',
- properties: {},
- required: [],
- },
+ // Bespoke tools
+ {
+ name: "start_conversation",
+ description:
+ "Start a new conversation with a user. Call this when a user starts a new conversation.",
+ inputSchema: {
+ type: "object",
+ properties: {},
+ required: [],
},
- {
- name: 'add_turn',
- description: 'Add a turn to a conversation. Call this after a user has sent a message and the assistant has responded.',
- inputSchema: {
- type: 'object',
+ },
+ {
+ name: "add_turn",
+ description:
+ "Add a turn to a conversation. Call this after a user has sent a message and the assistant has responded.",
+ inputSchema: {
+ type: "object",
+ properties: {
+ session_id: {
+ type: "string",
+ description: "The ID of the session to add the turn to.",
+ },
+ messages: {
+ type: "array",
+ description: "A list of messages to add to the session.",
+ items: {
+ type: "object",
properties: {
- session_id: {
- type: 'string',
- description: 'The ID of the session to add the turn to.',
- },
- messages: {
- type: 'array',
- description: 'A list of messages to add to the session.',
- items: {
- type: 'object',
- properties: {
- role: {
- type: 'string',
- enum: ['user', 'assistant'],
- description: 'The role of the message author.',
- },
- content: {
- type: 'string',
- description: 'The content of the message.',
- },
- metadata: {
- type: 'object',
- description: 'Optional metadata about the message.',
- },
- },
- required: ['role', 'content'],
- },
- },
+ role: {
+ type: "string",
+ enum: ["user", "assistant"],
+ description: "The role of the message author.",
+ },
+ content: {
+ type: "string",
+ description: "The content of the message.",
+ },
+ metadata: {
+ type: "object",
+ description: "Optional metadata about the message.",
+ },
},
- required: ['session_id', 'messages'],
+ required: ["role", "content"],
+ },
},
+ },
+ required: ["session_id", "messages"],
},
- {
- name: 'get_personalization_insights',
- description: 'Get personalization insights about the user, based on the query and the accumulated knowledge of the user across all conversations.',
- inputSchema: {
- type: 'object',
- properties: {
- session_id: {
- type: 'string',
- description: 'The ID of the session for context.',
- },
- query: {
- type: 'string',
- description: 'The question about the user\'s preferences, habits, etc.',
- },
- },
- required: ['session_id', 'query'],
+ },
+ {
+ name: "get_personalization_insights",
+ description:
+ "Get personalization insights about the user, based on the query and the accumulated knowledge of the user across all conversations.",
+ inputSchema: {
+ type: "object",
+ properties: {
+ session_id: {
+ type: "string",
+ description: "The ID of the session for context.",
},
+ query: {
+ type: "string",
+ description:
+ "The question about the user's preferences, habits, etc.",
+ },
+ },
+ required: ["session_id", "query"],
},
+ },
- // Workspace operations
- {
- name: 'search_workspace',
- description: 'Search for messages across the entire workspace.',
- inputSchema: {
- type: 'object',
- properties: {
- query: {
- type: 'string',
- description: 'The search query to use.',
- },
- },
- required: ['query'],
+ // Workspace operations
+ {
+ name: "search_workspace",
+ description: "Search for messages across the entire workspace.",
+ inputSchema: {
+ type: "object",
+ properties: {
+ query: {
+ type: "string",
+ description: "The search query to use.",
},
+ },
+ required: ["query"],
},
- {
- name: 'get_workspace_metadata',
- description: 'Get metadata for the current workspace.',
- inputSchema: {
- type: 'object',
- properties: {},
- required: [],
- },
- },
- {
- name: 'set_workspace_metadata',
- description: 'Set metadata for the current workspace.',
- inputSchema: {
- type: 'object',
- properties: {
- metadata: {
- type: 'object',
- description: 'A dictionary of metadata to associate with the workspace.',
- },
- },
- required: ['metadata'],
+ },
+ {
+ name: "get_workspace_metadata",
+ description: "Get metadata for the current workspace.",
+ inputSchema: {
+ type: "object",
+ properties: {},
+ required: [],
+ },
+ },
+ {
+ name: "set_workspace_metadata",
+ description: "Set metadata for the current workspace.",
+ inputSchema: {
+ type: "object",
+ properties: {
+ metadata: {
+ type: "object",
+ description:
+ "A dictionary of metadata to associate with the workspace.",
},
+ },
+ required: ["metadata"],
},
+ },
- // Peer operations
- {
- name: 'create_peer',
- description: 'Create or get a peer with the specified ID and optional configuration.',
- inputSchema: {
- type: 'object',
- properties: {
- peer_id: {
- type: 'string',
- description: 'Unique identifier for the peer.',
- },
- config: {
- type: 'object',
- description: 'Optional configuration dictionary for the peer.',
- },
- },
- required: ['peer_id'],
+ // Peer operations
+ {
+ name: "create_peer",
+ description:
+ "Create or get a peer with the specified ID and optional configuration.",
+ inputSchema: {
+ type: "object",
+ properties: {
+ peer_id: {
+ type: "string",
+ description: "Unique identifier for the peer.",
},
- },
- {
- name: 'get_peer_metadata',
- description: 'Get metadata for a specific peer.',
- inputSchema: {
- type: 'object',
- properties: {
- peer_id: {
- type: 'string',
- description: 'The ID of the peer to get metadata for.',
- },
- },
- required: ['peer_id'],
+ config: {
+ type: "object",
+ description: "Optional configuration dictionary for the peer.",
},
+ },
+ required: ["peer_id"],
},
- {
- name: 'set_peer_metadata',
- description: 'Set metadata for a specific peer.',
- inputSchema: {
- type: 'object',
- properties: {
- peer_id: {
- type: 'string',
- description: 'The ID of the peer to set metadata for.',
- },
- metadata: {
- type: 'object',
- description: 'A dictionary of metadata to associate with the peer.',
- },
- },
- required: ['peer_id', 'metadata'],
+ },
+ {
+ name: "get_peer_metadata",
+ description: "Get metadata for a specific peer.",
+ inputSchema: {
+ type: "object",
+ properties: {
+ peer_id: {
+ type: "string",
+ description: "The ID of the peer to get metadata for.",
},
+ },
+ required: ["peer_id"],
},
- {
- name: 'search_peer_messages',
- description: 'Search for messages sent by a peer.',
- inputSchema: {
- type: 'object',
- properties: {
- peer_id: {
- type: 'string',
- description: 'The ID of the peer to search messages for.',
- },
- query: {
- type: 'string',
- description: 'The search query to use.',
- },
- },
- required: ['peer_id', 'query'],
+ },
+ {
+ name: "set_peer_metadata",
+ description: "Set metadata for a specific peer.",
+ inputSchema: {
+ type: "object",
+ properties: {
+ peer_id: {
+ type: "string",
+ description: "The ID of the peer to set metadata for.",
},
- },
- {
- name: 'chat',
- description: 'Query a peer\'s representation with natural language questions.',
- inputSchema: {
- type: 'object',
- properties: {
- peer_id: {
- type: 'string',
- description: 'The ID of the peer to query.',
- },
- query: {
- type: 'string',
- description: 'The natural language question to ask.',
- },
- target_peer_id: {
- type: 'string',
- description: 'Optional target peer ID for local representation queries.',
- },
- session_id: {
- type: 'string',
- description: 'Optional session ID to scope the query to a specific session.',
- },
- },
- required: ['peer_id', 'query'],
+ metadata: {
+ type: "object",
+ description: "A dictionary of metadata to associate with the peer.",
},
+ },
+ required: ["peer_id", "metadata"],
},
- {
- name: 'list_peers',
- description: 'Get all peers in the current workspace.',
- inputSchema: {
- type: 'object',
- properties: {},
- required: [],
+ },
+ {
+ name: "search_peer_messages",
+ description: "Search for messages sent by a peer.",
+ inputSchema: {
+ type: "object",
+ properties: {
+ peer_id: {
+ type: "string",
+ description: "The ID of the peer to search messages for.",
},
+ query: {
+ type: "string",
+ description: "The search query to use.",
+ },
+ },
+ required: ["peer_id", "query"],
},
+ },
+ {
+ name: "chat",
+ description:
+ "Query a peer's representation with natural language questions.",
+ inputSchema: {
+ type: "object",
+ properties: {
+ peer_id: {
+ type: "string",
+ description: "The ID of the peer to query.",
+ },
+ query: {
+ type: "string",
+ description: "The natural language question to ask.",
+ },
+ target_peer_id: {
+ type: "string",
+ description:
+ "Optional target peer ID for local representation queries.",
+ },
+ session_id: {
+ type: "string",
+ description:
+ "Optional session ID to scope the query to a specific session.",
+ },
+ },
+ required: ["peer_id", "query"],
+ },
+ },
+ {
+ name: "list_peers",
+ description: "Get all peers in the current workspace.",
+ inputSchema: {
+ type: "object",
+ properties: {},
+ required: [],
+ },
+ },
- // Session operations
- {
- name: 'create_session',
- description: 'Create or get a session with the specified ID and optional configuration.',
- inputSchema: {
- type: 'object',
+ // Session operations
+ {
+ name: "create_session",
+ description:
+ "Create or get a session with the specified ID and optional configuration.",
+ inputSchema: {
+ type: "object",
+ properties: {
+ session_id: {
+ type: "string",
+ description: "Unique identifier for the session.",
+ },
+ config: {
+ type: "object",
+ description: "Optional configuration dictionary for the session.",
+ },
+ },
+ required: ["session_id"],
+ },
+ },
+ {
+ name: "get_session_metadata",
+ description: "Get metadata for a specific session.",
+ inputSchema: {
+ type: "object",
+ properties: {
+ session_id: {
+ type: "string",
+ description: "The ID of the session to get metadata for.",
+ },
+ },
+ required: ["session_id"],
+ },
+ },
+ {
+ name: "set_session_metadata",
+ description: "Set metadata for a specific session.",
+ inputSchema: {
+ type: "object",
+ properties: {
+ session_id: {
+ type: "string",
+ description: "The ID of the session to set metadata for.",
+ },
+ metadata: {
+ type: "object",
+ description:
+ "A dictionary of metadata to associate with the session.",
+ },
+ },
+ required: ["session_id", "metadata"],
+ },
+ },
+ {
+ name: "add_peers_to_session",
+ description: "Add peers to a session.",
+ inputSchema: {
+ type: "object",
+ properties: {
+ session_id: {
+ type: "string",
+ description: "The ID of the session to add peers to.",
+ },
+ peer_ids: {
+ type: "array",
+ items: { type: "string" },
+ description: "List of peer IDs to add to the session.",
+ },
+ },
+ required: ["session_id", "peer_ids"],
+ },
+ },
+ {
+ name: "remove_peers_from_session",
+ description: "Remove peers from a session.",
+ inputSchema: {
+ type: "object",
+ properties: {
+ session_id: {
+ type: "string",
+ description: "The ID of the session to remove peers from.",
+ },
+ peer_ids: {
+ type: "array",
+ items: { type: "string" },
+ description: "List of peer IDs to remove from the session.",
+ },
+ },
+ required: ["session_id", "peer_ids"],
+ },
+ },
+ {
+ name: "get_session_peers",
+ description: "Get all peer IDs in a session.",
+ inputSchema: {
+ type: "object",
+ properties: {
+ session_id: {
+ type: "string",
+ description: "The ID of the session to get peers from.",
+ },
+ },
+ required: ["session_id"],
+ },
+ },
+ {
+ name: "add_messages_to_session",
+ description: "Add messages to a session.",
+ inputSchema: {
+ type: "object",
+ properties: {
+ session_id: {
+ type: "string",
+ description: "The ID of the session to add messages to.",
+ },
+ messages: {
+ type: "array",
+ items: {
+ type: "object",
properties: {
- session_id: {
- type: 'string',
- description: 'Unique identifier for the session.',
- },
- config: {
- type: 'object',
- description: 'Optional configuration dictionary for the session.',
- },
+ peer_id: {
+ type: "string",
+ description: "ID of the peer sending the message",
+ },
+ content: {
+ type: "string",
+ description: "Message content",
+ },
+ metadata: {
+ type: "object",
+ description: "Optional metadata dictionary",
+ },
},
- required: ['session_id'],
+ required: ["peer_id", "content"],
+ },
+ description: "List of message dictionaries.",
},
+ },
+ required: ["session_id", "messages"],
},
- {
- name: 'get_session_metadata',
- description: 'Get metadata for a specific session.',
- inputSchema: {
- type: 'object',
- properties: {
- session_id: {
- type: 'string',
- description: 'The ID of the session to get metadata for.',
- },
- },
- required: ['session_id'],
+ },
+ {
+ name: "get_session_messages",
+ description: "Get messages from a session with optional filtering.",
+ inputSchema: {
+ type: "object",
+ properties: {
+ session_id: {
+ type: "string",
+ description: "The ID of the session to get messages from.",
},
- },
- {
- name: 'set_session_metadata',
- description: 'Set metadata for a specific session.',
- inputSchema: {
- type: 'object',
- properties: {
- session_id: {
- type: 'string',
- description: 'The ID of the session to set metadata for.',
- },
- metadata: {
- type: 'object',
- description: 'A dictionary of metadata to associate with the session.',
- },
- },
- required: ['session_id', 'metadata'],
+ filters: {
+ type: "object",
+ description: "Optional dictionary of filter criteria.",
},
+ },
+ required: ["session_id"],
},
- {
- name: 'add_peers_to_session',
- description: 'Add peers to a session.',
- inputSchema: {
- type: 'object',
- properties: {
- session_id: {
- type: 'string',
- description: 'The ID of the session to add peers to.',
- },
- peer_ids: {
- type: 'array',
- items: { type: 'string' },
- description: 'List of peer IDs to add to the session.',
- },
- },
- required: ['session_id', 'peer_ids'],
+ },
+ {
+ name: "get_session_context",
+ description: "Get optimized context for a session within a token limit.",
+ inputSchema: {
+ type: "object",
+ properties: {
+ session_id: {
+ type: "string",
+ description: "The ID of the session to get context for.",
},
- },
- {
- name: 'remove_peers_from_session',
- description: 'Remove peers from a session.',
- inputSchema: {
- type: 'object',
- properties: {
- session_id: {
- type: 'string',
- description: 'The ID of the session to remove peers from.',
- },
- peer_ids: {
- type: 'array',
- items: { type: 'string' },
- description: 'List of peer IDs to remove from the session.',
- },
- },
- required: ['session_id', 'peer_ids'],
+ summary: {
+ type: "boolean",
+ description: "Whether to include summary information.",
+ default: true,
},
- },
- {
- name: 'get_session_peers',
- description: 'Get all peer IDs in a session.',
- inputSchema: {
- type: 'object',
- properties: {
- session_id: {
- type: 'string',
- description: 'The ID of the session to get peers from.',
- },
- },
- required: ['session_id'],
+ tokens: {
+ type: "integer",
+ description: "Maximum number of tokens to include in the context.",
},
+ },
+ required: ["session_id"],
},
- {
- name: 'add_messages_to_session',
- description: 'Add messages to a session.',
- inputSchema: {
- type: 'object',
- properties: {
- session_id: {
- type: 'string',
- description: 'The ID of the session to add messages to.',
- },
- messages: {
- type: 'array',
- items: {
- type: 'object',
- properties: {
- peer_id: {
- type: 'string',
- description: 'ID of the peer sending the message',
- },
- content: {
- type: 'string',
- description: 'Message content',
- },
- metadata: {
- type: 'object',
- description: 'Optional metadata dictionary',
- },
- },
- required: ['peer_id', 'content'],
- },
- description: 'List of message dictionaries.',
- },
- },
- required: ['session_id', 'messages'],
+ },
+ {
+ name: "search_session_messages",
+ description: "Search for messages in a specific session.",
+ inputSchema: {
+ type: "object",
+ properties: {
+ session_id: {
+ type: "string",
+ description: "The ID of the session to search messages in.",
},
- },
- {
- name: 'get_session_messages',
- description: 'Get messages from a session with optional filtering.',
- inputSchema: {
- type: 'object',
- properties: {
- session_id: {
- type: 'string',
- description: 'The ID of the session to get messages from.',
- },
- filters: {
- type: 'object',
- description: 'Optional dictionary of filter criteria.',
- },
- },
- required: ['session_id'],
+ query: {
+ type: "string",
+ description: "The search query to use.",
},
+ },
+ required: ["session_id", "query"],
},
- {
- name: 'get_session_context',
- description: 'Get optimized context for a session within a token limit.',
- inputSchema: {
- type: 'object',
- properties: {
- session_id: {
- type: 'string',
- description: 'The ID of the session to get context for.',
- },
- summary: {
- type: 'boolean',
- description: 'Whether to include summary information.',
- default: true,
- },
- tokens: {
- type: 'integer',
- description: 'Maximum number of tokens to include in the context.',
- },
- },
- required: ['session_id'],
+ },
+ {
+ name: "get_working_representation",
+ description:
+ "Get the current working representation of a peer in a session.",
+ inputSchema: {
+ type: "object",
+ properties: {
+ session_id: {
+ type: "string",
+ description: "The ID of the session.",
},
- },
- {
- name: 'search_session_messages',
- description: 'Search for messages in a specific session.',
- inputSchema: {
- type: 'object',
- properties: {
- session_id: {
- type: 'string',
- description: 'The ID of the session to search messages in.',
- },
- query: {
- type: 'string',
- description: 'The search query to use.',
- },
- },
- required: ['session_id', 'query'],
+ peer_id: {
+ type: "string",
+ description:
+ "The ID of the peer to get the working representation of.",
},
- },
- {
- name: 'get_working_representation',
- description: 'Get the current working representation of a peer in a session.',
- inputSchema: {
- type: 'object',
- properties: {
- session_id: {
- type: 'string',
- description: 'The ID of the session.',
- },
- peer_id: {
- type: 'string',
- description: 'The ID of the peer to get the working representation of.',
- },
- target_peer_id: {
- type: 'string',
- description: 'Optional target peer ID to get the representation of what peer_id knows about target_peer_id.',
- },
- },
- required: ['session_id', 'peer_id'],
+ target_peer_id: {
+ type: "string",
+ description:
+ "Optional target peer ID to get the representation of what peer_id knows about target_peer_id.",
},
+ },
+ required: ["session_id", "peer_id"],
},
- {
- name: 'list_sessions',
- description: 'Get all sessions in the current workspace.',
- inputSchema: {
- type: 'object',
- properties: {},
- required: [],
- },
+ },
+ {
+ name: "list_sessions",
+ description: "Get all sessions in the current workspace.",
+ inputSchema: {
+ type: "object",
+ properties: {},
+ required: [],
},
+ },
];
/**
* Execute a tool with validation and consistent response handling
*/
-async function executeToolCall(honcho: HonchoWorker, toolName: string, toolArguments: any, requestId: string | number | null): Promise {
- let result: any;
+async function executeToolCall(
+ honcho: HonchoWorker,
+ toolName: string,
+ toolArguments: any,
+ requestId: string | number | null,
+): Promise {
+ let result: any;
- switch (toolName) {
- // Bespoke tools
- case 'start_conversation':
- result = await honcho.startConversation();
- break;
+ switch (toolName) {
+ // Bespoke tools
+ case "start_conversation":
+ result = await honcho.startConversation();
+ break;
- case 'add_turn': {
- const validation = validateArguments(toolArguments, ['session_id', 'messages'], requestId);
- if (validation) return validation;
+ case "add_turn": {
+ const validation = validateArguments(
+ toolArguments,
+ ["session_id", "messages"],
+ requestId,
+ );
+ if (validation) return validation;
- await honcho.addTurn(toolArguments.session_id, toolArguments.messages);
- result = 'Turn added successfully';
- break;
- }
-
- case 'get_personalization_insights': {
- const validation = validateArguments(toolArguments, ['session_id', 'query'], requestId);
- if (validation) return validation;
-
- result = await honcho.getPersonalizationInsights(toolArguments.session_id, toolArguments.query);
- break;
- }
-
- // Workspace operations
- case 'search_workspace': {
- const validation = validateArguments(toolArguments, ['query'], requestId);
- if (validation) return validation;
-
- result = await honcho.searchWorkspace(toolArguments.query);
- break;
- }
-
- case 'get_workspace_metadata':
- result = await honcho.getWorkspaceMetadata();
- break;
-
- case 'set_workspace_metadata': {
- const validation = validateArguments(toolArguments, ['metadata'], requestId);
- if (validation) return validation;
-
- await honcho.setWorkspaceMetadata(toolArguments.metadata);
- result = 'Workspace metadata set successfully';
- break;
- }
-
- // Peer operations
- case 'create_peer': {
- const validation = validateArguments(toolArguments, ['peer_id'], requestId);
- if (validation) return validation;
-
- result = await honcho.createPeer(toolArguments.peer_id, toolArguments.config);
- break;
- }
-
- case 'get_peer_metadata': {
- const validation = validateArguments(toolArguments, ['peer_id'], requestId);
- if (validation) return validation;
-
- result = await honcho.getPeerMetadata(toolArguments.peer_id);
- break;
- }
-
- case 'set_peer_metadata': {
- const validation = validateArguments(toolArguments, ['peer_id', 'metadata'], requestId);
- if (validation) return validation;
-
- await honcho.setPeerMetadata(toolArguments.peer_id, toolArguments.metadata);
- result = 'Peer metadata set successfully';
- break;
- }
-
- case 'search_peer_messages': {
- const validation = validateArguments(toolArguments, ['peer_id', 'query'], requestId);
- if (validation) return validation;
-
- result = await honcho.searchPeerMessages(toolArguments.peer_id, toolArguments.query);
- break;
- }
-
- case 'chat': {
- const validation = validateArguments(toolArguments, ['peer_id', 'query'], requestId);
- if (validation) return validation;
-
- result = await honcho.chat(toolArguments.peer_id, toolArguments.query, toolArguments.target_peer_id, toolArguments.session_id);
- break;
- }
-
- case 'list_peers':
- result = await honcho.listPeers();
- break;
-
- // Session operations
- case 'create_session': {
- const validation = validateArguments(toolArguments, ['session_id'], requestId);
- if (validation) return validation;
-
- result = await honcho.createSession(toolArguments.session_id, toolArguments.config);
- break;
- }
-
- case 'get_session_metadata': {
- const validation = validateArguments(toolArguments, ['session_id'], requestId);
- if (validation) return validation;
-
- result = await honcho.getSessionMetadata(toolArguments.session_id);
- break;
- }
-
- case 'set_session_metadata': {
- const validation = validateArguments(toolArguments, ['session_id', 'metadata'], requestId);
- if (validation) return validation;
-
- await honcho.setSessionMetadata(toolArguments.session_id, toolArguments.metadata);
- result = 'Session metadata set successfully';
- break;
- }
-
- case 'add_peers_to_session': {
- const validation = validateArguments(toolArguments, ['session_id', 'peer_ids'], requestId);
- if (validation) return validation;
-
- await honcho.addPeersToSession(toolArguments.session_id, toolArguments.peer_ids);
- result = 'Peers added to session successfully';
- break;
- }
-
- case 'remove_peers_from_session': {
- const validation = validateArguments(toolArguments, ['session_id', 'peer_ids'], requestId);
- if (validation) return validation;
-
- await honcho.removePeersFromSession(toolArguments.session_id, toolArguments.peer_ids);
- result = 'Peers removed from session successfully';
- break;
- }
-
- case 'get_session_peers': {
- const validation = validateArguments(toolArguments, ['session_id'], requestId);
- if (validation) return validation;
-
- result = await honcho.getSessionPeers(toolArguments.session_id);
- break;
- }
-
- case 'add_messages_to_session': {
- const validation = validateArguments(toolArguments, ['session_id', 'messages'], requestId);
- if (validation) return validation;
-
- await honcho.addMessagesToSession(toolArguments.session_id, toolArguments.messages);
- result = 'Messages added to session successfully';
- break;
- }
-
- case 'get_session_messages': {
- const validation = validateArguments(toolArguments, ['session_id'], requestId);
- if (validation) return validation;
-
- result = await honcho.getSessionMessages(toolArguments.session_id, toolArguments.filters);
- break;
- }
-
- case 'get_session_context': {
- const validation = validateArguments(toolArguments, ['session_id'], requestId);
- if (validation) return validation;
-
- result = await honcho.getSessionContext(toolArguments.session_id, toolArguments.summary, toolArguments.tokens);
- break;
- }
-
- case 'search_session_messages': {
- const validation = validateArguments(toolArguments, ['session_id', 'query'], requestId);
- if (validation) return validation;
-
- result = await honcho.searchSessionMessages(toolArguments.session_id, toolArguments.query);
- break;
- }
-
- case 'get_working_representation': {
- const validation = validateArguments(toolArguments, ['session_id', 'peer_id'], requestId);
- if (validation) return validation;
-
- result = await honcho.getWorkingRepresentation(toolArguments.session_id, toolArguments.peer_id, toolArguments.target_peer_id);
- break;
- }
-
- case 'list_sessions':
- result = await honcho.listSessions();
- break;
-
- default:
- return createErrorResponse(requestId, -32601, `Method not found: ${toolName}`);
+ await honcho.addTurn(toolArguments.session_id, toolArguments.messages);
+ result = "Turn added successfully";
+ break;
}
- const responseData = typeof result === 'string' ? result : JSON.stringify(result);
- return new Response(JSON.stringify(createJsonRpcResponse(requestId, {
- content: [{
- type: 'text',
+ case "get_personalization_insights": {
+ const validation = validateArguments(
+ toolArguments,
+ ["session_id", "query"],
+ requestId,
+ );
+ if (validation) return validation;
+
+ result = await honcho.getPersonalizationInsights(
+ toolArguments.session_id,
+ toolArguments.query,
+ );
+ break;
+ }
+
+ // Workspace operations
+ case "search_workspace": {
+ const validation = validateArguments(toolArguments, ["query"], requestId);
+ if (validation) return validation;
+
+ result = await honcho.searchWorkspace(toolArguments.query);
+ break;
+ }
+
+ case "get_workspace_metadata":
+ result = await honcho.getWorkspaceMetadata();
+ break;
+
+ case "set_workspace_metadata": {
+ const validation = validateArguments(
+ toolArguments,
+ ["metadata"],
+ requestId,
+ );
+ if (validation) return validation;
+
+ await honcho.setWorkspaceMetadata(toolArguments.metadata);
+ result = "Workspace metadata set successfully";
+ break;
+ }
+
+ // Peer operations
+ case "create_peer": {
+ const validation = validateArguments(
+ toolArguments,
+ ["peer_id"],
+ requestId,
+ );
+ if (validation) return validation;
+
+ result = await honcho.createPeer(
+ toolArguments.peer_id,
+ toolArguments.config,
+ );
+ break;
+ }
+
+ case "get_peer_metadata": {
+ const validation = validateArguments(
+ toolArguments,
+ ["peer_id"],
+ requestId,
+ );
+ if (validation) return validation;
+
+ result = await honcho.getPeerMetadata(toolArguments.peer_id);
+ break;
+ }
+
+ case "set_peer_metadata": {
+ const validation = validateArguments(
+ toolArguments,
+ ["peer_id", "metadata"],
+ requestId,
+ );
+ if (validation) return validation;
+
+ await honcho.setPeerMetadata(
+ toolArguments.peer_id,
+ toolArguments.metadata,
+ );
+ result = "Peer metadata set successfully";
+ break;
+ }
+
+ case "search_peer_messages": {
+ const validation = validateArguments(
+ toolArguments,
+ ["peer_id", "query"],
+ requestId,
+ );
+ if (validation) return validation;
+
+ result = await honcho.searchPeerMessages(
+ toolArguments.peer_id,
+ toolArguments.query,
+ );
+ break;
+ }
+
+ case "chat": {
+ const validation = validateArguments(
+ toolArguments,
+ ["peer_id", "query"],
+ requestId,
+ );
+ if (validation) return validation;
+
+ result = await honcho.chat(
+ toolArguments.peer_id,
+ toolArguments.query,
+ toolArguments.target_peer_id,
+ toolArguments.session_id,
+ );
+ break;
+ }
+
+ case "list_peers":
+ result = await honcho.listPeers();
+ break;
+
+ // Session operations
+ case "create_session": {
+ const validation = validateArguments(
+ toolArguments,
+ ["session_id"],
+ requestId,
+ );
+ if (validation) return validation;
+
+ result = await honcho.createSession(
+ toolArguments.session_id,
+ toolArguments.config,
+ );
+ break;
+ }
+
+ case "get_session_metadata": {
+ const validation = validateArguments(
+ toolArguments,
+ ["session_id"],
+ requestId,
+ );
+ if (validation) return validation;
+
+ result = await honcho.getSessionMetadata(toolArguments.session_id);
+ break;
+ }
+
+ case "set_session_metadata": {
+ const validation = validateArguments(
+ toolArguments,
+ ["session_id", "metadata"],
+ requestId,
+ );
+ if (validation) return validation;
+
+ await honcho.setSessionMetadata(
+ toolArguments.session_id,
+ toolArguments.metadata,
+ );
+ result = "Session metadata set successfully";
+ break;
+ }
+
+ case "add_peers_to_session": {
+ const validation = validateArguments(
+ toolArguments,
+ ["session_id", "peer_ids"],
+ requestId,
+ );
+ if (validation) return validation;
+
+ await honcho.addPeersToSession(
+ toolArguments.session_id,
+ toolArguments.peer_ids,
+ );
+ result = "Peers added to session successfully";
+ break;
+ }
+
+ case "remove_peers_from_session": {
+ const validation = validateArguments(
+ toolArguments,
+ ["session_id", "peer_ids"],
+ requestId,
+ );
+ if (validation) return validation;
+
+ await honcho.removePeersFromSession(
+ toolArguments.session_id,
+ toolArguments.peer_ids,
+ );
+ result = "Peers removed from session successfully";
+ break;
+ }
+
+ case "get_session_peers": {
+ const validation = validateArguments(
+ toolArguments,
+ ["session_id"],
+ requestId,
+ );
+ if (validation) return validation;
+
+ result = await honcho.getSessionPeers(toolArguments.session_id);
+ break;
+ }
+
+ case "add_messages_to_session": {
+ const validation = validateArguments(
+ toolArguments,
+ ["session_id", "messages"],
+ requestId,
+ );
+ if (validation) return validation;
+
+ await honcho.addMessagesToSession(
+ toolArguments.session_id,
+ toolArguments.messages,
+ );
+ result = "Messages added to session successfully";
+ break;
+ }
+
+ case "get_session_messages": {
+ const validation = validateArguments(
+ toolArguments,
+ ["session_id"],
+ requestId,
+ );
+ if (validation) return validation;
+
+ result = await honcho.getSessionMessages(
+ toolArguments.session_id,
+ toolArguments.filters,
+ );
+ break;
+ }
+
+ case "get_session_context": {
+ const validation = validateArguments(
+ toolArguments,
+ ["session_id"],
+ requestId,
+ );
+ if (validation) return validation;
+
+ result = await honcho.getSessionContext(
+ toolArguments.session_id,
+ toolArguments.summary,
+ toolArguments.tokens,
+ );
+ break;
+ }
+
+ case "search_session_messages": {
+ const validation = validateArguments(
+ toolArguments,
+ ["session_id", "query"],
+ requestId,
+ );
+ if (validation) return validation;
+
+ result = await honcho.searchSessionMessages(
+ toolArguments.session_id,
+ toolArguments.query,
+ );
+ break;
+ }
+
+ case "get_working_representation": {
+ const validation = validateArguments(
+ toolArguments,
+ ["session_id", "peer_id"],
+ requestId,
+ );
+ if (validation) return validation;
+
+ result = await honcho.getWorkingRepresentation(
+ toolArguments.session_id,
+ toolArguments.peer_id,
+ toolArguments.target_peer_id,
+ );
+ break;
+ }
+
+ case "list_sessions":
+ result = await honcho.listSessions();
+ break;
+
+ default:
+ return createErrorResponse(
+ requestId,
+ -32601,
+ `Method not found: ${toolName}`,
+ );
+ }
+
+ const responseData =
+ typeof result === "string" ? result : JSON.stringify(result);
+ return new Response(
+ JSON.stringify(
+ createJsonRpcResponse(requestId, {
+ content: [
+ {
+ type: "text",
text: responseData,
- }],
- })), {
- status: 200,
- headers: {
- 'Content-Type': 'application/json',
- 'Access-Control-Allow-Origin': '*',
- },
- });
+ },
+ ],
+ }),
+ ),
+ {
+ status: 200,
+ headers: {
+ "Content-Type": "application/json",
+ "Access-Control-Allow-Origin": "*",
+ },
+ },
+ );
}
/**
* Main Cloudflare Worker export
*/
export default {
- async fetch(request: Request): Promise {
- // Handle CORS preflight requests
- if (request.method === 'OPTIONS') {
- return new Response(null, {
- status: 200,
- headers: {
- 'Access-Control-Allow-Origin': '*',
- 'Access-Control-Allow-Methods': 'GET, POST, OPTIONS',
- 'Access-Control-Allow-Headers': 'Content-Type, Authorization, X-Honcho-User-Name, X-Honcho-Base-URL, X-Honcho-Workspace-ID, X-Honcho-Assistant-Name',
+ async fetch(request: Request): Promise {
+ // Handle CORS preflight requests
+ if (request.method === "OPTIONS") {
+ return new Response(null, {
+ status: 200,
+ headers: {
+ "Access-Control-Allow-Origin": "*",
+ "Access-Control-Allow-Methods": "GET, POST, OPTIONS",
+ "Access-Control-Allow-Headers":
+ "Content-Type, Authorization, X-Honcho-User-Name, X-Honcho-Base-URL, X-Honcho-Workspace-ID, X-Honcho-Assistant-Name",
+ },
+ });
+ }
+
+ // Only accept POST requests for JSON-RPC
+ if (request.method !== "POST") {
+ return createErrorResponse(null, -32600, "Invalid Request");
+ }
+
+ let requestData: JsonRpcRequest;
+
+ try {
+ requestData = (await request.json()) as JsonRpcRequest;
+ } catch (error) {
+ return createErrorResponse(null, -32700, "Parse error");
+ }
+
+ // Validate JSON-RPC format
+ if (requestData.jsonrpc !== "2.0") {
+ return createErrorResponse(
+ requestData.id ?? null,
+ -32600,
+ "Invalid Request",
+ );
+ }
+
+ if (!requestData.method) {
+ return createErrorResponse(
+ requestData.id ?? null,
+ -32600,
+ "Invalid Request",
+ );
+ }
+
+ // Parse configuration
+ const config = parseConfig(request);
+ if (!config && requestData.method !== "initialize") {
+ return createErrorResponse(
+ requestData.id ?? null,
+ -32602,
+ "Missing or invalid API key",
+ );
+ }
+
+ const honcho = config ? new HonchoWorker(config) : null;
+
+ try {
+ switch (requestData.method) {
+ case "initialize":
+ return new Response(
+ JSON.stringify(
+ createJsonRpcResponse(requestData.id ?? null, {
+ protocolVersion: "2024-11-05",
+ capabilities: {
+ tools: {},
},
- });
- }
+ serverInfo: {
+ name: "Honcho MCP Server",
+ version: "1.0.0",
+ },
+ }),
+ ),
+ {
+ status: 200,
+ headers: {
+ "Content-Type": "application/json",
+ "Access-Control-Allow-Origin": "*",
+ },
+ },
+ );
- // Only accept POST requests for JSON-RPC
- if (request.method !== 'POST') {
- return createErrorResponse(null, -32600, 'Invalid Request');
- }
+ case "notifications/initialized":
+ // MCP initialized notification - no response needed
+ return new Response(null, {
+ status: 204,
+ headers: {
+ "Access-Control-Allow-Origin": "*",
+ },
+ });
- let requestData: JsonRpcRequest;
+ case "tools/list":
+ return new Response(
+ JSON.stringify(
+ createJsonRpcResponse(requestData.id ?? null, {
+ tools: tools,
+ }),
+ ),
+ {
+ status: 200,
+ headers: {
+ "Content-Type": "application/json",
+ "Access-Control-Allow-Origin": "*",
+ },
+ },
+ );
- try {
- requestData = await request.json() as JsonRpcRequest;
- } catch (error) {
- return createErrorResponse(null, -32700, 'Parse error');
- }
+ case "tools/call":
+ if (!honcho) {
+ return createErrorResponse(
+ requestData.id ?? null,
+ -32602,
+ "Missing API key",
+ );
+ }
- // Validate JSON-RPC format
- if (requestData.jsonrpc !== '2.0') {
- return createErrorResponse(requestData.id ?? null, -32600, 'Invalid Request');
- }
+ const toolName = requestData.params?.name;
+ const toolArguments = requestData.params?.arguments || {};
- if (!requestData.method) {
- return createErrorResponse(requestData.id ?? null, -32600, 'Invalid Request');
- }
+ return await executeToolCall(
+ honcho,
+ toolName,
+ toolArguments,
+ requestData.id ?? null,
+ );
- // Parse configuration
- const config = parseConfig(request);
- if (!config && requestData.method !== 'initialize') {
- return createErrorResponse(requestData.id ?? null, -32602, 'Missing or invalid API key');
- }
-
- const honcho = config ? new HonchoWorker(config) : null;
-
- try {
- switch (requestData.method) {
- case 'initialize':
- return new Response(JSON.stringify(createJsonRpcResponse(requestData.id ?? null, {
- protocolVersion: '2024-11-05',
- capabilities: {
- tools: {}
- },
- serverInfo: {
- name: 'Honcho MCP Server',
- version: '1.0.0',
- },
- })), {
- status: 200,
- headers: {
- 'Content-Type': 'application/json',
- 'Access-Control-Allow-Origin': '*',
- },
- });
-
- case 'notifications/initialized':
- // MCP initialized notification - no response needed
- return new Response(null, {
- status: 204,
- headers: {
- 'Access-Control-Allow-Origin': '*',
- },
- });
-
- case 'tools/list':
- return new Response(JSON.stringify(createJsonRpcResponse(requestData.id ?? null, {
- tools: tools,
- })), {
- status: 200,
- headers: {
- 'Content-Type': 'application/json',
- 'Access-Control-Allow-Origin': '*',
- },
- });
-
- case 'tools/call':
- if (!honcho) {
- return createErrorResponse(requestData.id ?? null, -32602, 'Missing API key');
- }
-
- const toolName = requestData.params?.name;
- const toolArguments = requestData.params?.arguments || {};
-
- return await executeToolCall(honcho, toolName, toolArguments, requestData.id ?? null);
-
- default:
- return createErrorResponse(requestData.id ?? null, -32601, `Method not found: ${requestData.method}`);
- }
- } catch (error) {
- console.error('Worker error:', error);
- const errorMessage = error instanceof Error ? error.message : 'Internal server error';
- return createErrorResponse(requestData.id ?? null, -32603, errorMessage);
- }
- },
+ default:
+ return createErrorResponse(
+ requestData.id ?? null,
+ -32601,
+ `Method not found: ${requestData.method}`,
+ );
+ }
+ } catch (error) {
+ console.error("Worker error:", error);
+ const errorMessage =
+ error instanceof Error ? error.message : "Internal server error";
+ return createErrorResponse(requestData.id ?? null, -32603, errorMessage);
+ }
+ },
};
diff --git a/pyproject.toml b/pyproject.toml
index 3cce118f..c63d5742 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "honcho"
-version = "2.5.0"
+version = "2.5.1"
description = "Honcho Server"
authors = [
{name = "Plastic Labs", email = "hello@plasticlabs.ai"},
@@ -33,7 +33,7 @@ dependencies = [
"typing-extensions>=4.11.0",
"prometheus-client>=0.20.0",
"json-repair>=0.49.0",
- "redis>=6.0.0",
+ "redis>=7.0.0,<8.0.0",
"cashews[redis]==7.4.1",
]
[tool.uv]
diff --git a/sdks/python/pyproject.toml b/sdks/python/pyproject.toml
index 5e3b4b67..513c269a 100644
--- a/sdks/python/pyproject.toml
+++ b/sdks/python/pyproject.toml
@@ -8,7 +8,7 @@ authors = [
{ name = "Plastic Labs", email = "hello@plasticlabs.ai" },
]
dependencies = [
- "honcho-core>=1.7.0",
+ "honcho-core>=1.8.0",
"httpx>=0.28.0, <1",
"pydantic>=2.0.0, <3",
"typing-extensions>=4.12.0; python_version < \"3.12\"",
diff --git a/sdks/typescript/bun.lock b/sdks/typescript/bun.lock
index a2449f90..78a4a5dd 100644
--- a/sdks/typescript/bun.lock
+++ b/sdks/typescript/bun.lock
@@ -4,7 +4,7 @@
"": {
"name": "@honcho-ai/sdk",
"dependencies": {
- "@honcho-ai/core": "^1.7.0",
+ "@honcho-ai/core": "^1.8.0",
"@types/node": "^24.0.1",
"zod": "4.0.0",
},
@@ -106,7 +106,7 @@
"@biomejs/cli-win32-x64": ["@biomejs/cli-win32-x64@2.3.8", "", { "os": "win32", "cpu": "x64" }, "sha512-RguzimPoZWtBapfKhKjcWXBVI91tiSprqdBYu7tWhgN8pKRZhw24rFeNZTNf6UiBfjCYCi9eFQs/JzJZIhuK4w=="],
- "@honcho-ai/core": ["@honcho-ai/core@1.7.0", "", { "dependencies": { "@types/node": "^18.11.18", "@types/node-fetch": "^2.6.4", "abort-controller": "^3.0.0", "agentkeepalive": "^4.2.1", "form-data-encoder": "1.7.2", "formdata-node": "^4.3.2", "node-fetch": "^2.6.7" } }, "sha512-ZZsRlz0DgXaWj5z81KKcw4dLlwSxHqsxuG/Gb9vaozqJa8SSj09IGMm3kJjRTxNOD/AhHxOxAX3l6WEq4VZL5g=="],
+ "@honcho-ai/core": ["@honcho-ai/core@1.8.0", "", { "dependencies": { "@types/node": "^18.11.18", "@types/node-fetch": "^2.6.4", "abort-controller": "^3.0.0", "agentkeepalive": "^4.2.1", "form-data-encoder": "1.7.2", "formdata-node": "^4.3.2", "node-fetch": "^2.6.7" } }, "sha512-qxBNoXLezH8yx4iBoz4Bsxkm9zp4Gm1fNwuP8gHRdSelxhR0dXpvLffx8B5V0XFWsx+SfPaJFyaKw0X2sYMwLA=="],
"@istanbuljs/load-nyc-config": ["@istanbuljs/load-nyc-config@1.1.0", "", { "dependencies": { "camelcase": "^5.3.1", "find-up": "^4.1.0", "get-package-type": "^0.1.0", "js-yaml": "^3.13.1", "resolve-from": "^5.0.0" } }, "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ=="],
diff --git a/sdks/typescript/package.json b/sdks/typescript/package.json
index 21671ccf..a780bc86 100644
--- a/sdks/typescript/package.json
+++ b/sdks/typescript/package.json
@@ -20,7 +20,7 @@
"test:coverage": "jest --coverage"
},
"dependencies": {
- "@honcho-ai/core": "^1.7.0",
+ "@honcho-ai/core": "^1.8.0",
"@types/node": "^24.0.1",
"zod": "4.0.0"
},
diff --git a/src/deriver/deriver.py b/src/deriver/deriver.py
index 589b30b3..e16e03da 100644
--- a/src/deriver/deriver.py
+++ b/src/deriver/deriver.py
@@ -472,9 +472,9 @@ class CertaintyReasoner:
]
accumulate_metric(
f"deriver_{self.ctx[-1].id}_{self.observer}",
- "new_peer_card"
+ "updated_peer_card"
if self.observer == self.observed
- else f"new_{self.observed}_peer_card",
+ else f"updated_{self.observed}_peer_card",
"\n".join(new_peer_card),
"blob",
)
diff --git a/src/dreamer/consolidate.py b/src/dreamer/consolidate.py
index d834df4b..bb3c047c 100644
--- a/src/dreamer/consolidate.py
+++ b/src/dreamer/consolidate.py
@@ -15,6 +15,7 @@ from src.utils.queue_payload import DreamPayload
from src.utils.representation import (
ExplicitObservation,
Representation,
+ flatten_message_ids,
)
logger = logging.getLogger(__name__)
@@ -202,7 +203,7 @@ async def _consolidate_cluster(
# NOTE: other kinds of observations here in the future
metadata = schemas.DocumentMetadata(
- message_ids=obs.message_ids,
+ message_ids=flatten_message_ids(obs.message_ids),
message_created_at=format_datetime_utc(obs.created_at),
premises=premises,
)
diff --git a/src/main.py b/src/main.py
index b2480e63..48b7afdb 100644
--- a/src/main.py
+++ b/src/main.py
@@ -139,7 +139,7 @@ app = FastAPI(
title="Honcho API",
summary="The Identity Layer for the Agentic World",
description="""Honcho is a platform for giving agents user-centric memory and social cognition""",
- version="2.5.0",
+ version="2.5.1",
contact={
"name": "Plastic Labs",
"url": "https://honcho.dev",
diff --git a/src/utils/representation.py b/src/utils/representation.py
index 7a0644d0..74557496 100644
--- a/src/utils/representation.py
+++ b/src/utils/representation.py
@@ -8,6 +8,40 @@ from src import models
from src.utils.formatting import parse_datetime_iso
+def flatten_message_ids(
+ message_ids: list[int] | list[list[int]] | list[tuple[int, int]],
+) -> list[int]:
+ """
+ Flatten message_ids that may be in old tuple format or nested list format.
+
+ This handles backwards compatibility with the old schema where message_ids
+ was list[tuple[int, int]] representing ranges, and the new schema where
+ it's list[int] representing individual message IDs.
+
+ Args:
+ message_ids: Either a flat list of ints, nested list, or list of tuples
+
+ Returns:
+ A flat list of unique message IDs, sorted
+
+ Examples:
+ [1, 2, 3] -> [1, 2, 3]
+ [[1, 2], [3, 4]] -> [1, 2, 3, 4]
+ [(105, 105)] -> [105]
+ [[105, 105]] -> [105]
+ """
+ result: list[int] = []
+ for item in message_ids:
+ if isinstance(item, (list | tuple)):
+ # Nested list or tuple - flatten it
+ result.extend(item)
+ else:
+ # Already flat
+ result.append(item)
+ # Remove duplicates and sort
+ return sorted(set(result))
+
+
class ObservationMetadata(BaseModel):
created_at: datetime
message_ids: list[int]
@@ -267,7 +301,9 @@ class Representation(BaseModel):
doc.internal_metadata, doc.created_at
),
content=doc.content,
- message_ids=doc.internal_metadata.get("message_ids", []),
+ message_ids=flatten_message_ids(
+ doc.internal_metadata.get("message_ids", [])
+ ),
session_name=doc.session_name,
)
for doc in documents
@@ -279,7 +315,9 @@ class Representation(BaseModel):
doc.internal_metadata, doc.created_at
),
conclusion=doc.content,
- message_ids=doc.internal_metadata.get("message_ids", []),
+ message_ids=flatten_message_ids(
+ doc.internal_metadata.get("message_ids", [])
+ ),
session_name=doc.session_name,
premises=doc.internal_metadata.get("premises", []),
)
diff --git a/uv.lock b/uv.lock
index 8e644b73..d11770e9 100644
--- a/uv.lock
+++ b/uv.lock
@@ -1,5 +1,5 @@
version = 1
-revision = 2
+revision = 3
requires-python = ">=3.10"
resolution-markers = [
"python_full_version >= '3.13'",
@@ -710,7 +710,7 @@ wheels = [
[[package]]
name = "honcho"
-version = "2.5.0"
+version = "2.5.1"
source = { virtual = "." }
dependencies = [
{ name = "alembic" },
@@ -782,7 +782,7 @@ requires-dist = [
{ name = "pydantic-settings", specifier = ">=2.10.1" },
{ name = "pyjwt", specifier = ">=2.10.0" },
{ name = "python-dotenv", specifier = ">=1.0.0" },
- { name = "redis", specifier = ">=6.0.0" },
+ { name = "redis", specifier = ">=7.0.0,<8.0.0" },
{ name = "rich", specifier = ">=13.7.1" },
{ name = "sentry-sdk", extras = ["anthropic", "fastapi", "sqlalchemy"], specifier = ">=2.3.1" },
{ name = "sqlalchemy", specifier = ">=2.0.30" },
@@ -826,7 +826,7 @@ dev = [
[package.metadata]
requires-dist = [
- { name = "honcho-core", specifier = ">=1.7.0" },
+ { name = "honcho-core", specifier = ">=1.8.0" },
{ name = "httpx", specifier = ">=0.28.0,<1" },
{ name = "pydantic", specifier = ">=2.0.0,<3" },
{ name = "typing-extensions", marker = "python_full_version < '3.12'", specifier = ">=4.12.0" },
@@ -837,7 +837,7 @@ dev = [{ name = "ruff", specifier = ">=0.11.13" }]
[[package]]
name = "honcho-core"
-version = "1.7.0"
+version = "1.8.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "anyio" },
@@ -847,9 +847,9 @@ dependencies = [
{ name = "sniffio" },
{ name = "typing-extensions" },
]
-sdist = { url = "https://files.pythonhosted.org/packages/9e/75/0185a8b1c85d6947b3c7fe1a3ee5793fdedb944aec4798a370fcc27ec34f/honcho_core-1.7.0.tar.gz", hash = "sha256:b2eac28bc8b47ef8a1da404a1fce12180f12a8ea014f2bd68ad95d6e37bf90c4", size = 145919, upload-time = "2025-12-10T16:05:09.387Z" }
+sdist = { url = "https://files.pythonhosted.org/packages/c8/ea/c0949bbac5a9f20625bdb152b7da2350e89ffc15b5862cd6094b464cde14/honcho_core-1.8.0.tar.gz", hash = "sha256:ffe0840639651640722ad0ed38d193cc9402b077dac3e6726ac7be551398d952", size = 142469, upload-time = "2025-12-15T19:27:59.555Z" }
wheels = [
- { url = "https://files.pythonhosted.org/packages/6b/4d/74611a5055116ae683b5b256349f23913b2e35cc2ea2d96c28a5ddf23e76/honcho_core-1.7.0-py3-none-any.whl", hash = "sha256:2d9b31b0439513518e3156a798f5096fd92ab71fe46bc40b4b5507e23dd1116f", size = 148271, upload-time = "2025-12-10T16:05:07.964Z" },
+ { url = "https://files.pythonhosted.org/packages/4a/9a/5aba73353c7e70d331a21e01a931c951c5bd8688fb25e5fc318517f2adf9/honcho_core-1.8.0-py3-none-any.whl", hash = "sha256:30a44b7d421328dfac015e8a6ecbe09c89b6cac9f3a913262244e7d15698a8a8", size = 140580, upload-time = "2025-12-15T19:27:58.562Z" },
]
[[package]]
@@ -2015,14 +2015,14 @@ wheels = [
[[package]]
name = "redis"
-version = "6.4.0"
+version = "7.1.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "async-timeout", marker = "python_full_version < '3.11.3'" },
]
-sdist = { url = "https://files.pythonhosted.org/packages/0d/d6/e8b92798a5bd67d659d51a18170e91c16ac3b59738d91894651ee255ed49/redis-6.4.0.tar.gz", hash = "sha256:b01bc7282b8444e28ec36b261df5375183bb47a07eb9c603f284e89cbc5ef010", size = 4647399, upload-time = "2025-08-07T08:10:11.441Z" }
+sdist = { url = "https://files.pythonhosted.org/packages/43/c8/983d5c6579a411d8a99bc5823cc5712768859b5ce2c8afe1a65b37832c81/redis-7.1.0.tar.gz", hash = "sha256:b1cc3cfa5a2cb9c2ab3ba700864fb0ad75617b41f01352ce5779dabf6d5f9c3c", size = 4796669, upload-time = "2025-11-19T15:54:39.961Z" }
wheels = [
- { url = "https://files.pythonhosted.org/packages/e8/02/89e2ed7e85db6c93dfa9e8f691c5087df4e3551ab39081a4d7c6d1f90e05/redis-6.4.0-py3-none-any.whl", hash = "sha256:f0544fa9604264e9464cdf4814e7d4830f74b165d52f2a330a760a88dd248b7f", size = 279847, upload-time = "2025-08-07T08:10:09.84Z" },
+ { url = "https://files.pythonhosted.org/packages/89/f0/8956f8a86b20d7bb9d6ac0187cf4cd54d8065bc9a1a09eb8011d4d326596/redis-7.1.0-py3-none-any.whl", hash = "sha256:23c52b208f92b56103e17c5d06bdc1a6c2c0b3106583985a76a18f83b265de2b", size = 354159, upload-time = "2025-11-19T15:54:38.064Z" },
]
[[package]]