# plastic-labs/honcho — AlpLab Radar Static Code Audit

- Ring: `trial`
- Category: `agents`
- Overall score: `3.9/5`
- Implementation check: `verified`
- Maturity: `early`
- Audited commit: `15bbbc68f2dd` (read-only; nothing from the repository was executed)
- Reviewed at: 2026-12-02T05:51:29Z
- Repository: https://github.com/plastic-labs/honcho
- Radar entry: https://radar.alplab.co/#repo/plastic-labs/honcho
- License: `AGPL-3.0`
- CI workflows: `.github/workflows`
- Tags: `agent-memory`, `fastapi`, `pgvector`, `llm`, `mcp`, `multi-tenant`

## Summary

A FastAPI agent-memory server (storage + background deriver + dialectic chat over per-peer representations) with Python/TypeScript SDKs, a CLI, an MCP server, and coding-agent plugins, backed by Postgres/pgvector with optional Redis caching and pluggable vector stores.

## Implementation Check

The README's store/reason/query loop is genuinely implemented: src/routers/messages.py `_create_and_enqueue` inserts messages plus queue rows atomically, src/deriver/deriver.py `process_representation_tasks_batch` does the background LLM reasoning, src/dialectic/chat.py `agentic_chat` powers the peer chat endpoint, and src/utils/search.py `search` implements the advertised hybrid BM25+vector search — with real SDKs in sdks/python/src/honcho/client.py and sdks/typescript matching the quickstart.

## When to Use

Use it when you need persistent, peer-modeled memory for agents and can run Postgres+pgvector, a deriver worker, and an LLM provider key (managed api.honcho.dev or self-hosted). Not suitable if you want zero external LLM dependency for reasoning, can't accept AGPL-3.0, or need turnkey deployment without assembling infrastructure.

## Sub-scores

| Dimension | Score |
|---|---|
| quality | 4.5/5 |
| usability | 4.0/5 |
| reliability | 3.0/5 |
| security | 3.5/5 |
| integration | 4.5/5 |

## Code Evidence

src/main.py `lifespan` wires 13 routers and runs fail-closed startup validators (validate_embedding_schema, validate_tenant_isolation, validate_queue_item_batches); src/security.py `verify_jwt`/`auth`/`require_auth` enforce workspace/session/peer/named-scope JWT claims with a dedicated audience and required tenant claim under MULTI_TENANT; src/dependencies.py `tracked_db` refuses to run unbound under MULTI_TENANT and `service_db` is the explicit RLS-bypass path; src/crud/session.py `delete_session`/`_get_or_add_peers_to_session` show careful cascade deletes, advisory-lock membership serialization, and observer limits; src/utils/filter.py `apply_filter` whitelists filter columns, escapes ILIKE patterns, caps nesting at 5; src/utils/search.py `search` fuses semantic+FTS via `reciprocal_rank_fusion` with a server-enforced statement_timeout budget (search_db/bound_search_statement); src/deriver/deriver.py and src/utils/agent_tools.py (TOOLS registry, `_truncate_tool_output`, `_filter_ungrounded_source_ids` rejecting fabricated provenance) implement the reasoning pipeline; multi-tenant RLS is validated at boot by src/startup/tenant_isolation_validator.py and the tenant registry uses constant-time secret compare in src/routers/tenants.py `require_tenant_api`; tests/conftest.py builds the schema via real alembic migrations per run and the suite includes ~30 test modules (test_security.py, test_session_allowlist.py, test_scoped_tenant_id.py, test_search.py, property tests); CI in .github/workflows/unittest.yml runs pytest against a pgvector/pgvector:pg15 service plus TS SDK tests against a live API with a mock LLM provider, and staticanalysis.yml runs basedpyright, ruff, and an OpenAPI drift check.

## Issues Found

src/schemas/api.py `validate_webhook_url` blocks private/reserved IP literals but accepts hostnames (e.g. `internal.corp`, `localhost` variants resolvable via DNS) that resolve to internal addresses, leaving src/webhooks/webhook_delivery.py `deliver_webhook` — which POSTs event JSON to customer-registered URLs — open to hostname-based SSRF on network-exposed self-hosted deployments.

## Key Risks

Static review only — nothing was executed, LLM reasoning quality and the LongMemEval/LoCoMo benchmark claims are not verifiable from code, and unit tests mock all LLM/embedding calls (live-LLM coverage is a separate opt-in workflow). Running it requires Python 3.13+, Postgres with pgvector, an LLM provider key, and two processes (API + deriver); Redis is optional. Auth is off by default (src/config.py `AuthSettings.USE_AUTH=False` — documented in README as required before network exposure). Telemetry/metrics/Sentry default off. AGPL-3.0 and maintainer-only PRs constrain contributions; maturity signals show 70 unpinned GitHub Actions. Version churn is high (10 releases in ~3 months, 310 commits/90d) — pin a release when self-hosting.

## Reviewed Files

- `README.md`
- `pyproject.toml`
- `src/main.py`
- `src/security.py`
- `src/dependencies.py`
- `tests/conftest.py`
- `src/routers/peers.py`
- `src/routers/sessions.py`
- `src/routers/messages.py`
- `src/routers/tenants.py`
- `src/routers/keys.py`
- `src/routers/webhooks.py`
- `src/crud/session.py`
- `src/utils/search.py`
- `src/utils/filter.py`
- `src/utils/agent_tools.py`
- `src/utils/files.py`
- `src/dialectic/chat.py`
- `src/deriver/deriver.py`
- `src/config.py`
- `src/schemas/api.py`
- `src/webhooks/webhook_delivery.py`
- `.github/workflows/unittest.yml`
- `.github/workflows/staticanalysis.yml`
- `mcp/README.md`
- `sdks/python/src/honcho/client.py`
