fix: 11.24 checkpoint

This commit is contained in:
vintro 2025-11-24 12:33:15 -05:00
parent 90cd0b814f
commit ace8558388
No known key found for this signature in database
14 changed files with 169 additions and 8435 deletions

View File

@ -26,6 +26,7 @@
"group": "Introduction",
"pages": [
"v2/documentation/introduction/overview",
"v2/documentation/introduction/architecture",
"v2/documentation/introduction/vibecoding"
]
},
@ -37,18 +38,17 @@
"group": "Storage",
"expanded": true,
"pages": [
"v2/documentation/core-concepts/features/storing-data",
"v2/documentation/core-concepts/features/file-uploads"
"v2/documentation/honcho-context/storage/storing-data",
"v2/documentation/honcho-context/storage/file-uploads"
]
},
{
"group": "Retrieval",
"expanded": true,
"pages": [
"v2/documentation/honcho-context/retrieval/overview",
"v2/documentation/core-concepts/features/using-filters",
"v2/documentation/core-concepts/features/search",
"v2/documentation/core-concepts/features/get-context"
"v2/documentation/honcho-context/retrieval/using-filters",
"v2/documentation/honcho-context/retrieval/search",
"v2/documentation/honcho-context/retrieval/get-context"
]
}
]
@ -372,26 +372,7 @@
}
]
}
],
"global": {
"anchors": [
{
"anchor": "Dashboard",
"href": "https://app.honcho.dev",
"icon": "table-columns"
},
{
"anchor": "Community",
"href": "https://discord.gg/honcho",
"icon": "discord"
},
{
"anchor": "Blog",
"href": "https://blog.plasticlabs.ai",
"icon": "newspaper"
}
]
}
]
},
"logo": {
"light": "/logo/honcho-dark.svg",
@ -408,7 +389,8 @@
"twitter": "https://x.com/honchodotdev",
"github": "https://github.com/plastic-labs/honcho",
"discord": "https://discord.gg/honcho",
"linkedin": "https://www.linkedin.com/company/plasticlabs"
"linkedin": "https://www.linkedin.com/company/plasticlabs",
"youtube": "https://www.youtube.com/@plasticlabs"
}
},
"integrations": {

File diff suppressed because it is too large Load Diff

View File

@ -1,10 +1,10 @@
---
title: 'Honcho Context Quickstart'
title: 'Quickstart - Honcho Context'
icon: 'bolt'
sidebarTitle: 'Quickstart'
---
Implement Honcho in just a few steps. No signup required.
Implement Honcho Context in just a few steps. No signup required.
<Note>
By default, the SDK uses the demo server hosted at demo.honcho.dev. The demo server is meant for quick experimentation and the data is cleared on a regular basis. Do not use for production applications.
@ -58,7 +58,7 @@ const honcho = new Honcho({});
## 3. Create Peers
Peers represent individual users, AI agents, or any conversational entity in your system:
Peers represent individual users, AI agents, or any entity in your system:
<CodeGroup>
```python Python
@ -74,23 +74,25 @@ const bob = await honcho.peer("bob")
## 4. Create a Session
Sessions are independent conversations that can include multiple peers:
Sessions can be used to organize messages amongst peers.
<CodeGroup>
```python Python
session = honcho.session("session_1")
session = honcho.session("session_1", config={"deriver_disabled": True})
session.add_peers([alice, bob])
```
```typescript TypeScript
const session = await honcho.session("session_1")
const session = await honcho.session("session_1", {config:{"deriver_disabled": true}});
await session.addPeers([alice, bob])
```
</CodeGroup>
## 5. Add Messages
<Note>
In Honcho, memory is a reasoning task. By default it runs inference over every message. To use Honcho just for context engineering, you can toggle off this behavior.
</Note>
Add some conversation messages. Honcho automatically learns from these interactions:
## 5. Add Messages
<CodeGroup>
```python Python
@ -118,16 +120,16 @@ await session.addMessages([
## 6. Get Context
Curating your peer's context window is remarkably simple. The `get_context` method pulls in a mixture of recent messages and messages relevant to the one just sent.
Curating your peer's context window is remarkably simple. The `get_context` method pulls recent messages for you based on a token limit.
<CodeGroup>
```python Python
context = session.get_context()
context = session.get_context() # chain with .to_openAI() or .to_anthropic() to format for APIs
```
```typescript TypeScript
const context = await session.getContext();
const context = await session.getContext(); // chain with .toOpenAI() or .toAnthropic() to format for APIs
```
</CodeGroup>
@ -138,20 +140,28 @@ const context = await session.getContext();
<CodeGroup>
```python Python
import os
from openai import OpenAI
from dotenv import load_dotenv
from honcho import Honcho
# Create your client
# Load environment variables (e.g., OPENAI_API_KEY in .env file)
load_dotenv()
# Create OpenAI client
openai_client = OpenAI()
# Create your Honcho client
honcho = Honcho()
# Get your Peers
# Create your peers
alice = honcho.peer("alice")
bob = honcho.peer("bob")
# Make a Session and add your Peers
session = honcho.session("session_1")
# Make a session, add peers to the session
session = honcho.session("session_1", config={"deriver_disabled": True})
session.add_peers([alice, bob])
# Add messages sent by your Peers
# Add messages sent by your peers
session.add_messages([
alice.message("Hi Bob, how are you?"),
bob.message("I'm good, thank you!"),
@ -161,112 +171,122 @@ session.add_messages([
bob.message("You should! I find that evening workouts help me relax."),
])
# Get insights about your Peers
response = bob.chat("Tell me about Bob's interests and habits")
print(response)
# Get context for LLM
messages = session.get_context(tokens=2000).to_openai(assistant=bob)
# Returns rich context like:
# "Bob is health-conscious and has been working on getting back in shape.
# He regularly goes to the gym, particularly in the evenings, and finds
# exercise helps him relax. He's encouraging about fitness and willing
# to share advice about workout routines."
# Add new user message and get AI response
messages.append({
"role": "user",
"content": "Oh maybe I'll find them relaxing as well!"
})
response = openai_client.chat.completions.create(
model="gpt-4o",
messages=messages
)
# Add AI response back to session
session.add_messages([
user.message("Oh maybe I'll find them relaxing as well!"),
assistant.message(response.choices[0].message.content)
])
print(response.choices[0].message.content)
# Expected Output: something like "Definitely! Plus, it's a great way to end the day."
```
```typescript TypeScript
import * as dotenv from 'dotenv';
import OpenAI from 'openai';
import { Honcho } from '@honcho-ai/sdk';
// Create your client
// Load environment variables (e.g., OPENAI_API_KEY in .env file)
dotenv.config();
// Create OpenAI client
const openai = new OpenAI({
apiKey: process.env.OPENAI_API_KEY,
});
// Create your Honcho client
const honcho = new Honcho({});
// Get your Peers
const alice = await honcho.peer("alice")
const bob = await honcho.peer("bob")
// Main async function to handle everything
async function main() {
try {
// Create peers
const alice = await honcho.peer("alice");
const bob = await honcho.peer("bob");
// Make a Session and add your peers
const session = await honcho.session("session_1")
await session.addPeers([alice, bob])
// Make a session, add peers to the session
const session = await honcho.session("session_1", {config:{"deriver_disabled": true}});
await session.addPeers([alice, bob]);
// Add messages sent by your Peers
await session.addMessages([
alice.message("Hi Bob, how are you?"),
bob.message("I'm good, thank you!"),
alice.message("What are you doing today after work?"),
bob.message("I'm going to the gym! I've been trying to get back in shape."),
alice.message("That's great! I should probably start exercising too."),
bob.message("You should! I find that evening workouts help me relax."),
])
// Add messages sent by your peers
await session.addMessages([
alice.message("Hi Bob, how are you?"),
bob.message("I'm good, thank you!"),
alice.message("What are you doing today after work?"),
bob.message("I'm going to the gym! I've been trying to get back in shape."),
alice.message("That's great! I should probably start exercising too."),
bob.message("You should! I find that evening workouts help me relax."),
]);
// Get insights about your peers
bob.chat("Tell me about Bob's interests and habits").then((response) => {
console.log(response);
// Returns rich context like:
// "Bob is health-conscious and has been working on getting back in shape.
// He regularly goes to the gym, particularly in the evenings, and finds
// exercise helps him relax. He's encouraging about fitness and willing
// to share advice about workout routines."
})
// Get context for LLM (await the context first, then call toOpenAI)
const context = await session.getContext({ tokens: 2000 });
const messages = context.toOpenAI(bob)
// Add new user message
messages.push({
role: "user",
content: "Oh maybe I'll find them relaxing as well!"
});
// Get AI response
const response = await openai.chat.completions.create({
model: "gpt-4o",
messages: messages,
});
const aiResponse = response.choices[0].message.content;
// Add AI response back to session (user as alice, AI as bob)
await session.addMessages([
alice.message("Oh maybe I'll find them relaxing as well!"),
bob.message(aiResponse!),
]);
// Print the AI response
console.log(aiResponse);
} catch (error) {
console.error('Error running the script:', error);
}
}
// Run the main function
main();
// Expected Output: something like "Definitely! Plus, it's a great way to end the day."
```
</CodeGroup>
## Recap
Honcho just reasoned about a conversation between two people--Alice
and Bob. We:
1. We set up our connection to Honcho.
2. Created our peers.
3. Made a session and added our peers.
4. Added messages from our peers to the session.
5. Used the `get_context` method to structure a stateful request to OpenAI.
1. Set up our connection to Honcho.
2. Setup the participants of our conversation--these are called `Peers`.
3. Made a `Session` and added our `Peers`.
4. Sent messages from our `Peers`.
5. Queried Honcho to get insights about one of the `Peers` in the conversation.
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).
## Next Steps
We're just scratching the surface. Choose from one of the cards below to keep building with Honcho.
<CardGroup cols={3}>
<Card title="Architecture" icon="rocket"
href="/v2/documentation/core-concepts/architecture">
Learn about the data primitives in Honcho and how they work together
<Card title="Get Context" icon="rocket"
href="/v2/documentation/core-concepts/features/get-context">
Learn more about the power and flexibility of the `get_context` method
</Card>
<Card title="Start Building" icon="brain" href="https://app.honcho.dev">
Sign up for Managed Honcho and get started building agents now.
<Card title="Start Building" icon="wrench" href="https://app.honcho.dev">
Sign up on the Honcho Platform for unlimited storage and retrieval
</Card>
<Card title="Guides" icon="book" href="/v2/guides/overview">
Check out spellbooks to see different examples apps built with Honcho
<Card title="Honcho Memory" icon="brain" href="/v2/guides/overview">
Leverage the advanced reasoning capabilities in Honcho
</Card>
</CardGroup>
---
# SCRATCH
### Production Environment
<CodeGroup>
```python Python
import os
from honcho import Honcho
# Production environment with API key
honcho = Honcho(
api_key=os.environ["HONCHO_API_KEY"],
environment="production",
# Create a workspace, otherwise set to "default"
# workspaceId="your-workspace-id"
)
```
```typescript TypeScript
import { Honcho } from '@honcho-ai/sdk';
// Production environment with API key
const honcho = new Honcho({
apiKey: process.env.HONCHO_API_KEY!,
environment: "production",
// Create a workspace, otherwise set to "default"
// workspace: "your-workspace-id"
});
```
</CodeGroup>

View File

@ -1,71 +0,0 @@
---
title: "Retrieval Overview"
description: "Understanding how to retrieve and query data from Honcho"
icon: "search"
sidebarTitle: "Overview"
---
# Retrieval in Honcho
Honcho provides multiple approaches for retrieving stored context, each optimized for different use cases.
## Retrieval Methods
### Basic Retrieval
Direct queries for messages and session data:
- **List Messages**: Retrieve messages from a session with pagination
- **Get Message**: Fetch a specific message by ID
- **List Sessions**: Query sessions with filtering options
### Advanced Retrieval
Context-aware retrieval methods:
- **Search**: Hybrid search across messages using semantic and full-text search
- **Get Context**: Intelligent context retrieval optimized for LLM consumption
- **Filters**: Powerful filtering options to narrow down results
## When to Use Each Method
| Method | Use Case | Best For |
|--------|----------|----------|
| List Messages | Sequential access | Displaying conversation history |
| Search | Find specific information | User searches, knowledge retrieval |
| Get Context | Provide context to LLM | Real-time agent responses |
| Filters | Narrow results | Time-based queries, peer-specific data |
## Retrieval Patterns
### Pattern 1: Conversation History
```python
# Get recent messages for display
messages = session.get_messages(limit=50)
```
### Pattern 2: Semantic Search
```python
# Find relevant past discussions
results = workspace.search(query="user preferences", limit=10)
```
### Pattern 3: Context for LLM
```python
# Get optimized context for agent
context = session.get_context(max_tokens=1000)
```
## Next Steps
<CardGroup cols={3}>
<Card title="Filters" icon="filter" href="/v2/documentation/core-concepts/features/using-filters">
Learn about filtering options
</Card>
<Card title="Search" icon="magnifying-glass" href="/v2/documentation/core-concepts/features/search">
Explore search capabilities
</Card>
<Card title="Get Context" icon="brain" href="/v2/documentation/core-concepts/features/get-context">
Understand intelligent context retrieval
</Card>
</CardGroup>

View File

@ -1,9 +1,10 @@
---
title: 'Quickstart'
title: 'Quickstart - Honcho Memory'
icon: 'bolt'
sidebarTitle: 'Quickstart'
---
Implement Honcho in just a few steps. No signup required.
Implement Honcho Memory in just a few steps. No signup required.
<Note>
By default, the SDK uses the demo server hosted at demo.honcho.dev. The demo server is meant for quick experimentation and the data is cleared on a regular basis. Do not use for production applications.

View File

@ -1,25 +1,22 @@
---
title: "Architecture & Intuition"
description: "Understanding Honcho's core concepts and data model."
description: "Understanding Honcho's data model and core concepts."
icon: "sitemap"
sidebarTitle: "Architecture"
---
<Note> The goal of this page is to build an intuition for the primitives in Honcho and how they fit together </Note>
Honcho has 2 main components that work together to manage agent identity and context.
Honcho has 2 main components that work together to manage agent context and memory.
- **The Memory Layer**: The Memory layer for storing interaction history for your agents
- **The Reasoning Layer**: The background processing layer that builds representations of users and agents
Below we'll deep dive into these different areas, discussing the data
primitives, the flow of data through the system, artifacts Honcho produces, and
how to use them.
- **The Context Layer**: For storing and retrieving interaction history for your agents.
- **The Memory Layer**: Background processing that builds representations of users and agents.
## Data Model
Honcho has a hierarchical data model centered around the entities below.
<div style={{ display: 'flex', justifyContent: 'center' }}>
```mermaid
graph TD
W[Workspaces] -->|have| P[Peers]
@ -29,21 +26,27 @@ Honcho has a hierarchical data model centered around the entities below.
P <-.->|many-to-many| S
style W fill:#FF5A7E,stroke:#333,stroke-width:2px,color:#fff
style P fill:#e1f5fe,stroke:#0277bd,color:#000
style S fill:#f3e5f5,stroke:#7b1fa2,color:#000
style SM fill:#e8f5e9,stroke:#2e7d32,color:#000
style W fill:#B6DBFF,stroke:#333,color:#000
style P fill:#B6DBFF,stroke:#333,color:#000
style S fill:#B6DBFF,stroke:#333,color:#000
style SM fill:#B6DBFF,stroke:#333,color:#000
```
</div>
- A `Workspaces` has `Peers` & `Sessions`
- A `Workspace` has `Peers` & `Sessions`
- A `Peer` can be in multiple `Sessions` and can send `Messages` in a `Session`.
- A `Session` can have many `Peers` and stores `Messages` sent by its `Peers`.
### <Icon icon="building" /> Workspaces
---
<div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
<Icon icon="building" />
<h3 style={{ margin: 0 }}>Workspaces</h3>
</div>
Workspaces are the top-level containers that provide complete isolation between different applications or environments; they essentially serve as a namespace to isolate different workloads or environments.
Workspaces are the top-level containers that provide complete isolation between
different applications or environments; they essentially serve as a namespace
to isolate different workloads or environments
**Key Features:**
- **Isolation**: Complete data separation between workspaces
@ -59,7 +62,10 @@ to isolate different workloads or environments
---
### <Icon icon="user" /> Peers
<div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
<Icon icon="user" />
<h3 style={{ margin: 0 }}>Peers</h3>
</div>
Honcho has a Peer-Centric Architecture: Peers are the most important entity within Honcho, with everything revolving around Peers and their representations.
@ -83,7 +89,10 @@ multi-agent or group chat scenarios.
---
### <Icon icon="message" /> Sessions
<div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
<Icon icon="message" />
<h3 style={{ margin: 0 }}>Sessions</h3>
</div>
Sessions represent individual conversation threads or interaction contexts between peers.
@ -102,7 +111,10 @@ Sessions represent individual conversation threads or interaction contexts betwe
---
### <Icon icon="envelope" /> Messages
<div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>
<Icon icon="envelope" />
<h3 style={{ margin: 0 }}>Messages</h3>
</div>
Messages are the fundamental units of interaction within sessions. They may
also be used to ingest information of any kind that is not related to a specific interaction, but provides

View File

@ -6,9 +6,9 @@ sidebarTitle: "Overview"
Honcho gives agents state-of-the-art memory.
It's is a flexible memory library available through a managed platform and an open source package for self-hosting.
It's is a flexible yet powerful library. Available through a managed platform and an open source repository for self-hosting.
Honcho can be thought of in two ways: Honcho Context and Honcho Memory.
Honcho can be understood by developers through two lenses--context and memory.
## Honcho Context
@ -19,15 +19,6 @@ Honcho offers elegant, flexible primitives for initializing, storing, retrieving
Don't waste time redundantly building complex systems. Focus on what makes your product unique.
---
(scratch)
Honcho solves context engineering so you can spend more time on your product.
Don't waste time redundantly building complex systems. Get back to what makes your agent unique.
---
## Honcho Memory
@ -83,4 +74,4 @@ Memory is table stakes--it's the system that constructs context to make decision
<CardGroup cols={2}> <Card title="Honcho Context Quickstart" icon="rocket"
href="/v2/documentation/honcho-context/quickstart"> Get up and running with
Honcho in minutes </Card> <Card title="Honcho Memory Quickstart" icon="brain"
href="/v2/documentation/honcho-memory/architecture"> Leverage Honcho's Memory in minutes. </Card> </CardGroup>
href="/v2/documentation/honcho-memory/quickstart"> Leverage Honcho for Memory in minutes. </Card> </CardGroup>