kith
Social memory for multi-agent systems — who remembers what, about whom, visible to whom.
Working draft README. Not yet published.
Why
Agent memory today answers one question: what facts should I remember? (Mem0, Zep, LangMem — all excellent at it.)
But when agents work with other agents (or with you, across contexts), the failures that actually hurt are not fact-retrieval failures:
- Your planner delegates to the same flaky coder agent for the fifth time, because nothing remembers the first four failures.
- A negotiation agent's private read on its counterpart leaks into a shared channel, because memory has no notion of where a memory may go.
- Every session, your agents meet each other as strangers.
Research on multi-agent failures (the MAST taxonomy) puts inter-agent misalignment and weak verification at the top of the list. These are relationship-state failures: the system has no memory of who anyone is to anyone.
kith is that memory.
Install
pip install kith-ai # imports as `kith`
What it is
A small Python library (sqlite by default, zero heavy deps) that gives your agents:
- Observations — append-only records of what happened between principals: interactions, claims, emotional reads
- Relationship views — trust, reliability, sentiment, capabilities: derived from observations with decay and full provenance (
view.explain()shows its work) - Scope contracts — every memory has an explicit visibility boundary, enforced at a single gate below every read path (retrieval, errors, exports — no leaks through side doors)
import kith
store = kith.Store("sqlite:///team.db")
me = store.principal("agent:planner-7")
me.observe(subject="agent:coder-2", kind="interaction",
payload={"promised": "fix by 5pm", "delivered": False},
context="task:deploy-42")
v = me.view("agent:coder-2")
if v.reliability < 0.4:
plan.add_verification_step() # remembered, not repeated
It is not a Mem0 replacement — run it beside your fact store. Facts are what happened; kith is what it did to the relationship.
Design commitments
- Access boundaries are contracts, not filters. One visibility gate under every read surface, with a leak-path test suite to prove it. (Battle-tested design: grew out of hermes-agent #71224, where snapshot-only filtering was shown to leak through error inventories.)
- Identity comes from the runtime, never from the model. Models say
current/peer; the runtime resolves who that is. LLMs don't get to invent IDs. - Psychology is pluggable. Default trust/reliability/sentiment derivers are documented and swappable — bring your own model of a mind.
- Useful at n=2. One user, one assistant, cross-context privacy: already worth it. Scales to agent teams from there.
Does it help? (reproducible)
A planner delegating to 20 workers of hidden, mixed reliability — identical setup, the only difference is memory:
policy failures repeat-fail retries
------------------------------------------------------------
baseline (no memory) 100.6 83.1±32.9 100.6
kith (relationship memory) 25.2 15.3±9.5 25.2
repeat-delegation failures cut by 82%
python examples/delegation_sim/simulator.py — seeded, no LLM calls,
runs in seconds. Details.
And the observation log doubles as a research instrument: in the contagion demo, kith's derived sentiment views reconstruct a team's emotional dynamics — and locate the toxic source — from per-dyad memories alone, no access to anyone's internal state.
LangGraph
pip install "kith-ai[langgraph]" — wrap any node so its outcomes become
relationship memory, and let the supervisor pick workers by track record:
from kith.integrations.langgraph import KithSupervisor, observe_node
sup = KithSupervisor(store, supervisor="agent:supervisor",
workers=["agent:coder", "agent:researcher"])
graph.add_node("coder", observe_node(
coder_fn, store=store, observer="agent:supervisor",
subject="agent:coder", judge=lambda out: not out.get("error")))
def route(state):
return node_of[sup.pick()] # explore unknowns, avoid known-bad
prompt += sup.brief() # derived, scope-safe worker briefing
Tested against a real StateGraph (langgraph ≥ 1.0).
hermes-agent
kith runs as a hermes-agent memory provider (shim):
every subagent delegation the parent witnesses becomes relationship memory
automatically (on_delegation), the system prompt gains a scope-safe
relationship brief, and the agent gets kith_observe / kith_view tools —
observing always as the session principal, never as a model-chosen identity.
A2A
For agents that talk A2A, kith observes the protocol traffic you already handle — no extra instrumentation:
from kith.integrations.a2a import observe_task, assert_card, confirm_capability
assert_card(me, "agent:remote-writer", agent_card) # skills -> self-claims
observe_task(me, "agent:remote-writer", task) # terminal Task -> outcome
confirm_capability(me, "agent:remote-writer", "summarization") # seen it work
Completed/failed/rejected tasks become reliability evidence; canceled and
non-terminal states are ignored (withdrawn work is not a signal). AgentCard
skills stay source="self" until a real task confirms them — a card never
inflates a track record.
Status
v0.2 on PyPI (pip install kith-ai). Core library + leak-path test suite +
LangGraph, hermes-agent, and A2A adapters. See docs/DESIGN.md.
Author
Yan Liu (@theNamek) — PhD researcher on group emotion dynamics in multi-agent LLM systems.
Metadata
Release files for kith-ai 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| kith_ai-0.2.0.tar.gz | 187.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| kith_ai-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 211.1 kB
Release files / kith_ai-0.2.0.tar.gz
| Download URL | kith_ai-0.2.0.tar.gz |
|---|---|
| Size | 187.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5720c37d2bdf6116cea8dfc3876eacb23084917ec997738649514099697bf044
|
|
BLAKE2b-256 checksum How to use checksums |
d8bd90990df4695a03dccb082791a591dafb6e5359c9b266072c91d1738636f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.7
|
Release files / kith_ai-0.2.0-py3-none-any.whl
| Download URL | kith_ai-0.2.0-py3-none-any.whl |
|---|---|
| Size | 23.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f6a282d9f60ff967c7055e62534a7d218660652718ff86ae490fd725ad13b8f2
|
|
BLAKE2b-256 checksum How to use checksums |
d45b1ce7cf59bf7b32235d5fe0e501a47b1fba708a93d118a7eac8a0de12b97d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.7
|