# Zeyi

A production-grade Python framework for a team's own AI agent that lives inside chat platforms such as Feishu, with tiered persistent memory, a hook-driven architecture, and separated compute and storage.

Zeyi is a Python agent framework built to embed an AI agent inside a team's chat platform rather than an IDE. It keeps four layers of persistent memory (session, fact, workflow, and vector archive) that the agent retrieves from on every turn, backed by SQLite FTS5 with Chinese jieba tokenization and a scheduled warn-then-archive lifecycle.

Successful sessions are automatically distilled into reusable SOP skill files, which graduate to versioned SKILL.md documents as they prove useful, and stale ones can be actively forgotten. A Session Affinity Gateway supports active-active horizontal scaling across multiple workers using Redis-based affinity registration and pub/sub forwarding, tested on a three-worker deployment.

Governance includes three permission tiers (read-only, approval, yolo) with per-user profiles, sandboxed execution using Anthropic's srt (macOS Seatbelt or Linux bubblewrap and seccomp) enforcing fail-closed architectural invariants, and structured JSON audit logging. The web client and Feishu CardKit integration share the same agent core.

Website: https://github.com/Timeflys2018/zeyi
