跳到正文
Skillpedia
API 与服务器(后端)7.9k · #12749

honcho-integration

它能做什么

该技能指导开发者把 Honcho 软件开发工具包加入现有的 Python 或 TypeScript 项目中。它讲解如何设置参与者和对话,以及如何读取为他们存储的记忆。

适用场景

  • ✓你想为现有 Python 应用加入持久的用户记忆的时候。
  • ✓你想使用 SDK 在 TypeScript 项目中加入 Honcho 的时候。
  • ✓你需要为聊天应用设置对等方和会话的时候。

技能链接

https://github.com/plastic-labs/honcho/blob/main/skills/honcho-integration/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/plastic-labs/honcho/blob/main/skills/honcho-integration/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请把 Honcho 记忆加入我的 Python 聊天机器人,让它在会话之间记住每位用户。”

每周 5 个新技能,1 分钟读完。

工作原理

它讲解核心概念:对等方是参与者,会话是对话,消息则输入到后台进程中以构建记忆。然后助手会把这些概念与你的代码联系起来。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Honcho Integration Guide

What is Honcho

Honcho is an open source memory library for building stateful agents. It works with any model, framework, or architecture. You send Honcho the messages from your conversations, and custom reasoning models process them in the background — extracting premises, drawing conclusions, and building rich representations of each participant over time. Your agent can then query those representations on-demand ("What does this user care about?", "How technical is this person?") and get grounded, reasoned answers.

The key mental model: Peers are any participant — human or AI. Both are represented the same way. observe_me is a peer-level flag (PeerConfig) controlling whether Honcho forms a representation of that peer; typically you want Honcho to model your users (observe_me=True) but not anything with deterministic behavior (observe_me=False). observe_others is a separate per-peer SessionPeerConfig setting that controls whether that peer forms representations of the other participants in a session. Sessions scope conversations between peers. Messages are the raw data you feed in — Honcho reasons about them asynchronously and stores the results as the peer's representation. No messages means no reasoning means no memory.

Your agent accesses this memory through peer.chat(query) (ask a natural language question, get a reasoned answer — a few seconds of live reasoning) or session.context() (near-instant read of formatted history + representation). Prefer context() for per-turn grounding; use chat() when you need a reasoned answer.

Reference map

Follow the workflow below. Read a reference file only when you reach the step that needs it:

When you're… Read
Writing the client/peer/session setup (init, peers, sessions, add messages) references/core-patterns.md
Wiring how the AI reads context (tool call, pre-fetch, context(), streaming) references/agent-patterns.md
Integrating into a bot framework (nanobot, openclaw, picoclaw, …) references/bot-frameworks.md + references/bot-frameworks/<framework>/

Integration Workflow

Follow these phases in order:

Phase 1: Codebase Exploration

Before asking the user anything, explore the codebase to understand:

  1. Language & Framework: Is this Python or TypeScript? What frameworks are used (FastAPI, Express, Next.js, etc.)?
  2. Existing AI/LLM code: Search for existing LLM integrations (OpenAI, Anthropic, LangChain, etc.)
  3. Entity structure: Identify users, agents, bots, or other entities that interact
  4. Session/conversation handling: How does the app currently manage conversations?
  5. Message flow: Where are messages sent/received? What's the request/response cycle?

Use Glob and Grep to find:

  • **/*.py or **/*.ts files with "openai", "anthropic", "llm", "chat", "message"
  • User/session models or types
  • API routes handling chat or conversation endpoints

Bot framework detected? If the codebase is built around an agent loop, tool registry, session manager, and message bus (e.g., nanobot, openclaw, picoclaw), read references/bot-frameworks.md for framework-specific integration guidance and check references/bot-frameworks/<framework>/ for concrete reference implementations.

Phase 2: Interview (REQUIRED)

After exploring the codebase, use the AskUserQuestion tool to clarify integration requirements. Ask these questions (adapt based on what you learned in Phase 1):

Question Set 1 - Entities & Peers

Ask about which entities should be Honcho peers:

  • header: "Peers"
  • question: "Which entities should Honcho track and build representations for?"
  • options based on what you found (e.g., "End users only", "Users + AI assistant", "Users + multiple AI agents", "All participants including third-party services")
  • Include a follow-up if they have multiple AI agents: should any AI peers be observed?

Question Set 2 - Integration Pattern

Ask how they want to use Honcho context (see references/agent-patterns.md for the implementation of each):

  • header: "Pattern"
  • question: "How should your AI access Honcho's user context?"
  • options:
    • "Tool call (Recommended)" - "Agent queries Honcho on-demand via function calling"
    • "Pre-fetch" - "Fetch user context before each LLM call with predefined queries"
    • "context()" - "Include conversation history and representations in prompt"
    • "Multiple patterns" -
常见问题

什么是 Honcho?

它是一个开源的记忆库,用于构建有状态的 AI 智能体,可以与任何模型或框架配合使用。

没有消息也会形成记忆吗?

不会。Honcho 只对你发送的消息进行推理,因此没有消息就没有记忆。

我如何向 Honcho 询问某位用户的情况?

你可以通过其聊天方法提出自然语言问题,它会返回基于已存记忆的答案。

详情

作者的原始描述

Integrate Honcho memory into existing Python or TypeScript codebases. Use when adding Honcho SDK, setting up peers, configuring sessions, and accessing Honcho's representation.

repo: plastic-labs/honcho

热度

GitHub 星标
7.9k
排名
#12749
许可证
AGPL-3.0
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能