ENGRAM v0.4.0 — DANH SACH TINH NANG (265 features) ==================================================== Repo: github.com/docaohieu2808/engram Python 3.11+ | ~13,865 LOC | 790 tests | 108 source files ## 1. HE THONG BO NHO EPISODIC — Vector Store (10 tinh nang) 1.1 ChromaDB Integration — Luu tru vector bang ChromaDB voi collection rieng cho moi namespace 1.2 Dual Embedding — Ho tro Gemini (3072-dim) va fallback MiniLM (384-dim) khi khong co API key 1.3 TTL/Expiry — Tu dong xoa memory het han dua tren thoi gian song (time-to-live) 1.4 Ebbinghaus Decay Scoring — Tinh diem suy giam theo duong cong Ebbinghaus (retention + recency + frequency boost) 1.5 FTS5 Full-Text Search — Tim kiem tu khoa song song voi vector search bang SQLite FTS5 1.6 Memory Deduplication — Phat hien trung lap bang cosine similarity > 0.85 1.7 Topic Key Upsert — Cap nhat (khong tao moi) khi memory cung topic key da ton tai 1.8 Memory Consolidation — Gom nhom bang Jaccard clustering + tom tat bang LLM 1.9 Namespace Isolation — Cach ly du lieu theo namespace, moi namespace 1 ChromaDB collection 1.10 Access Tracking — Theo doi access_count va last_accessed de tinh decay score ## 2. HE THONG BO NHO SEMANTIC — Knowledge Graph (10 tinh nang) 2.1 NetworkX Graph — Do thi co huong trong bo nho voi lazy loading 2.2 Pluggable Backends — Ho tro SQLite (mac dinh) hoac PostgreSQL 2.3 Schema Definition — Dinh nghia node types, edge relations, attributes bang YAML 2.4 Node Operations — Them/sua/xoa node voi attributes tuy chinh 2.5 Edge Operations — Them/sua/xoa canh voi relation types (e.g. USES, DEPENDS_ON) 2.6 Graph Queries — Truy van theo keyword, type, lien quan (entity neighbors) 2.7 PostgreSQL Multi-Tenancy — Cach ly du lieu theo row-level voi tenant_id 2.8 Built-in Schema — Template devops co san voi services, tech, incidents 2.9 Max Node Cap — Gioi han an toan 50,000 node voi canh bao log 2.10 Concurrent Load Lock — Double-check async lock pattern chong race condition ## 3. RECALL PIPELINE — Duong Ong Goi Nho (10 tinh nang) 3.1 Query Decision Engine — Bo qua cac tin nhan tam thuong (< 10ms) 3.2 Entity Resolution (Temporal) — Phan giai ngay thang dua tren regex (hom nay, yesterday, tuan truoc) 3.3 Pronoun Resolution — Phan giai dai tu bang regex truoc, LLM fallback sau (Tieng Viet + Tieng Anh) 3.4 Parallel Search Fusion — Tim kiem dong thoi tu episodic + entity graph + FTS5 + keyword 3.5 Result Re-ranking — Xep hang lai theo diem tong hop: similarity x importance 3.6 Consolidated Memory Skip — Loai bo memory goc da duoc tom tat (tranh trung lap) 3.7 Fallback Search — Chuyen sang keyword search khi semantic score < nguong 3.8 Fusion Formatter — Nhom ket qua theo loai: [preference] / [fact] / [lesson] 3.9 Result Deduplication — Phat hien trung lap bang hash va gop theo uu tien 3.10 Vietnamese Temporal Patterns — Ho tro "hom nay", "hom qua", "ngay mai", "tuan truoc", "thang truoc" ## 4. FEEDBACK LOOP — Vong Phan Hoi Tu Hoc (8 tinh nang) 4.1 Feedback Detection — Nhan dien phan hoi tich cuc/tieu cuc bang regex (Viet + Anh) 4.2 Confidence Tracking — Theo doi do tin cay moi memory [0.0 - 1.0] 4.3 Positive Feedback — Phan hoi tich cuc: +0.15 confidence, +1 priority 4.4 Negative Feedback — Phan hoi tieu cuc: -0.2 confidence, -1 priority, +1 negative_count 4.5 Auto-Delete — Tu dong xoa memory khi 3+ lan phan hoi xau + confidence < 0.15 4.6 Per-Memory Locking — Async lock moi memory, tranh mat du lieu khi feedback dong thoi 4.7 Importance Adjustment — Phan hoi tu dong dieu chinh priority score 4.8 Negative Count Tracking — Bo dem persistent de xac dinh nguong xoa tu dong ## 5. POISONING GUARD — Bao Ve Chong Doc Hai (4 tinh nang) 5.1 Prompt Injection Detection — 12+ regex pattern phat hien prompt injection 5.2 Injection Patterns — Chan: ignore instructions, system prompt ref, role override 5.3 Safe Ingest Gating — Chan noi dung nghi ngo truoc khi luu vao store 5.4 Pattern Categories — 3 nhom: instruction override, identity impersonation, memory wipe ## 6. AUTO-MEMORY DETECTION — Tu Dong Phat Hien Bo Nho (8 tinh nang) 6.1 Manual Save Prefix — "Save: ..." tu dong luu voi importance 4 6.2 Identity Detection — Nhan dien "my name is", "ten toi la" -> category identity 6.3 Preference Detection — Nhan dien "i prefer", "toi thich" -> type preference 6.4 Explicit Requests — Nhan dien "remember that", "nho la" -> category explicit 6.5 Pattern Detection — Nhan dien "i always", "toi luon" -> behavioral pattern 6.6 Decision Detection — Nhan dien "i decided", "quyet dinh" -> decision type 6.7 Sensitive Data Filtering — Chan password, API key, credential truoc khi luu 6.8 Multi-Language Support — Ho tro pattern nhan dien Tieng Viet + Tieng Anh ## 7a. MEMORY AUDIT TRAIL — Nhat Ky Kiem Toan (8 tinh nang) 7a.1 JSONL Audit Log — Nhat ky giao dich append-only bat bien 7a.2 Before/After Values — Ghi nhan snapshot truoc/sau moi thay doi 7a.3 Modification Types — Ho tro: memory_create, memory_delete, metadata_update, cleanup, batch 7a.4 Reversibility Info — Danh dau thao tac co the dao nguoc hoac khong 7a.5 Tenant Isolation — Nhat ky kiem toan rieng theo tenant 7a.6 Actor Tracking — Ghi nhan ai thuc hien thay doi (user/system/agent) 7a.7 Timestamp & Details — ISO timestamp + metadata chi tiet thao tac 7a.8 No-op When Disabled — Khong ton tai chi phi khi audit tat (mac dinh tat) ## 7b. RESOURCE TIER — He Thong Cap Tai Nguyen (7 tinh nang) 7b.1 4-Tier Degradation — 4 cap: FULL -> STANDARD -> BASIC -> READONLY 7b.2 Automatic Tier Evaluation — Tu dong danh gia cap dua tren ty le thanh cong LLM 7b.3 Failure Tracking — Cua so truot theo doi loi LLM gan day 7b.4 Auto-Recovery — Phuc hoi tu dong voi exponential backoff + jitter 7b.5 Forced Tier Override — Admin co the ep cap de test 7b.6 Tier-Aware Task Skip — Scheduler bo qua thao tac nang khi cap BASIC 7b.7 60-Second Window — Cua so 60 giay de quyet dinh chuyen cap ## 7c. DATA CONSTITUTION — Hien Phap Du Lieu (7 tinh nang) 7c.1 Immutable Rules — 3 luat bat bien inject vao moi LLM prompt 7c.2 Namespace Isolation Law — Khong bao gio truy cap cheo namespace 7c.3 No Fabrication Law — Khong bao gio tao memory gia (hallucinate) 7c.4 Audit Rights Law — Moi truy cap deu duoc ghi log, khong xoa khi chua co dong y 7c.5 SHA-256 Tamper Detection — Kiem tra hash khi load de phat hien chinh sua trai phep 7c.6 File Persistence — Luu tai ~/.engram/constitution.md 7c.7 Prompt Injection — Tien to ngan gon them vao moi reasoning prompt ## 7d. CONSOLIDATION SCHEDULER — Bo Lap Lich Gom Nhom (8 tinh nang) 7d.1 Asyncio-Based Loop — Vong lap dung setTimeout de quy (khong race condition) 7d.2 Periodic Consolidation — Tom tat bang LLM moi 6 gio 7d.3 Daily Cleanup — Xoa memory het han hang ngay 7d.4 Decay Report — Bao cao thong ke suy giam hang ngay 7d.5 Overlap Prevention — Tick tiep theo chi chay khi hien tai xong 7d.6 State Persistence — Luu trang thai tai ~/.engram/scheduler_state.json 7d.7 LLM Requirement Gating — Bo qua task khi tier < STANDARD 7d.8 Status Tracking — Theo doi last_run, run_count, error_history ## 8. REASONING ENGINE — Dong Co Suy Luan (9 tinh nang) 8.1 Combined Query — Tong hop tu episodic + semantic memory 8.2 LLM Reasoning — Tich hop litellm (ho tro bat ky model nao) 8.3 Memory Injection — Tu dong chuan bi context tu memory 8.4 Summarization — Tom tat N memory gan nhat qua LLM 8.5 Provider Integration — Ho tro provider ben ngoai (routable) 8.6 Constitutional Injection — Them tien to constitution vao moi prompt 8.7 Temporal Awareness — Prompt bao gom ngay/gio hien tai 8.8 Language Matching — Tra loi cung ngon ngu voi cau hoi 8.9 Node Names Cache — Cache ten node, tranh quet toan bo graph moi lan think() ## 9. CLIENT SDK — Bo Phat Trien Tich Hop (10 tinh nang) 9.1 EngramClient Wrapper — Drop-in wrapper cho litellm voi auto-memory 9.2 Pre-Call Recall — Tu dong goi nho memory truoc khi goi LLM 9.3 Post-Call Extraction — Trich xuat memory sau khi LLM tra loi (fire-and-forget) 9.4 Fail-Open — LLM luon thanh cong ngay ca khi memory loi 9.5 Auto-Extraction Toggle — Bat/tat tu dong trich xuat memory 9.6 Auto-Recall Toggle — Bat/tat tu dong goi nho memory 9.7 Namespace Support — Cach ly memory theo namespace cho moi client 9.8 Async API — Ho tro day du async/await 9.9 Sync Wrappers — Phien ban dong bo cho code khong async 9.10 Memory Extractor — Lazy-loaded LLM extractor cho facts/decisions ## 10. MCP SERVER — May Chu MCP (19 cong cu) 10.1 engram_remember — Luu memory voi type, priority, tags 10.2 engram_recall — Tim kiem episodic memory (compact format) 10.3 engram_resolve — Phan giai entity/temporal 10.4 engram_feedback — Ghi nhan phan hoi (positive/negative) 10.5 engram_think — Suy luan LLM qua memory 10.6 engram_summarize — Tom tat N memory gan nhat 10.7 engram_cleanup — Xoa memory het han 10.8 engram_status — Thong ke memory 10.9 engram_get_memory — Lay memory theo ID 10.10 engram_timeline — Dong thoi gian xung quanh memory 10.11 engram_add_entity — Them node vao knowledge graph 10.12 engram_add_relation — Them canh vao graph 10.13 engram_query_graph — Truy van knowledge graph 10.14 engram_ingest — Dual ingest: trich xuat entity + luu memory 10.15 engram_session_start — Bat dau phien hoi thoai 10.16 engram_session_end — Ket thuc phien voi summary 10.17 engram_session_summary — Lay tom tat phien da hoan thanh 10.18 engram_session_context — Lay memory cua phien dang hoat dong 10.19 engram_get_graph_data — Lay toan bo graph JSON de truc quan hoa ## 11. HTTP API — Giao Dien HTTP (14 endpoints) 11.1 POST /api/v1/remember — Luu episodic memory (content, type, priority, tags) 11.2 GET /api/v1/recall — Tim kiem memory voi phan trang (limit, offset) 11.3 POST /api/v1/think — Suy luan LLM qua memory 11.4 GET /api/v1/query — Tim kiem knowledge graph 11.5 POST /api/v1/ingest — Trich xuat entity + luu memory tu chat messages 11.6 POST /api/v1/feedback — Ghi nhan phan hoi cho memory 11.7 POST /api/v1/cleanup — Xoa memory het han (admin) 11.8 POST /api/v1/summarize — Tom tat bang LLM (admin) 11.9 GET /graph — Giao dien graph tuong tac (WebUI) 11.10 GET /api/v1/graph/data — Lay du lieu graph JSON 11.11 POST /auth/token — Cap JWT token (admin) 11.12 GET /health — Kiem tra suc khoe he thong 11.13 POST /api/v1/backup — Xuat ban sao luu toan bo memory 11.14 POST /api/v1/restore — Nhap ban sao luu ## 12. CLI COMMANDS — Lenh Dong Lenh (37 lenh) ### Episodic (4) 12.1 engram remember — Luu memory voi --type, --priority, --tags, --expires 12.2 engram recall — Tim kiem memory voi --limit, --type, --tags, --namespace 12.3 engram cleanup — Xoa memory het han 12.4 engram consolidate — Gom nhom memory thu cong (--auto de tu dong) ### Semantic (5) 12.5 engram add node — Them node voi --type 12.6 engram add edge — Them canh voi --relation 12.7 engram remove node — Xoa node theo key 12.8 engram remove edge — Xoa canh theo key va relation 12.9 engram query — Truy van graph theo keyword, --type, --related-to, --format ### Recall Pipeline (4) 12.10 engram resolve — Phan giai entity/temporal voi --context 12.11 engram feedback — Ghi phan hoi --positive hoac --negative theo ID 12.12 engram audit — Xem nhat ky kiem toan (--last N) 12.13 engram benchmark — Chay benchmark do chinh xac voi file JSON ### Reasoning (2) 12.14 engram think — Suy luan LLM ve cau hoi 12.15 engram summarize — Tom tat memory (--count, --save) ### Session (3) 12.16 engram session start — Bat dau phien (--namespace) 12.17 engram session end — Ket thuc phien (--goal, --discoveries) 12.18 engram session summary — Lay tom tat phien (--id) ### System (9) 12.19 engram status — Thong ke memory tong quat 12.20 engram dump — Xuat toan bo memory ra JSON 12.21 engram watch — Theo doi thu muc inbox de tu dong ingest (--daemon) 12.22 engram serve — Khoi dong HTTP API server (--host, --port) 12.23 engram resource-status — Hien thi LLM tier + thong ke cua so loi 12.24 engram constitution-status — Hien thi cac luat + hash 12.25 engram scheduler-status — Hien thi trang thai scheduled tasks 12.26 engram ingest — Nhap du lieu tu file JSON (--dry-run) 12.27 engram migrate — Import tu export cu (legacy format) ### Config (6) 12.28 engram config show — Hien thi toan bo config 12.29 engram config get — Lay gia tri theo dot notation (e.g. episodic.decay_rate) 12.30 engram config set — Dat gia tri config 12.31 engram schema show — Hien thi schema hien tai 12.32 engram schema init — Khoi tao schema 12.33 engram schema validate — Kiem tra file YAML schema ### Auth (4) 12.34 engram auth create-key — Tao API key moi (--name) 12.35 engram auth list-keys — Liet ke tat ca API key 12.36 engram auth revoke-key — Thu hoi API key theo ID 12.37 engram auth create-token — Tao JWT token (--hours) ### Backup (2) 12.38 engram backup — Xuat ban sao luu (--output) 12.39 engram restore — Nhap ban sao luu tu archive ### Sync (2) 12.40 engram sync push — Day memory len git (--message) 12.41 engram sync pull — Keo memory tu git ### Provider (2) 12.42 engram providers list — Liet ke cac provider kha dung 12.43 engram providers test — Kiem tra ket noi provider ## 13. AUTHENTICATION & RBAC — Xac Thuc Va Phan Quyen (9 tinh nang) 13.1 JWT Authentication — Xac thuc bang Bearer token trong Authorization header 13.2 API Keys — Token dai han, luu dang hash 13.3 RBAC (3 roles) — 3 vai tro: ADMIN, AGENT, READER 13.4 Token Expiry — TTL cau hinh duoc (mac dinh 24h) 13.5 Admin Secret — Bootstrap token de tao token qua /auth/token 13.6 Optional Auth — Mac dinh tat (tuong thich nguoc) 13.7 Key Revocation — Liet ke va thu hoi API key 13.8 Secure Storage — Luu key bang SHA-256 hash 13.9 FastAPI Integration — Dependency injection cho endpoint bao mat ## 14. CACHING — Bo Nho Dem Redis (7 tinh nang) 14.1 Redis Integration — Async Redis voi graceful degradation 14.2 Tenant-Scoped Keys — Key format: engram:{tenant}:{op}:{hash} 14.3 Per-Endpoint TTLs — Thoi gian cache rieng cho moi endpoint 14.4 Graceful Degradation — Hoat dong binh thuong khi Redis khong kha dung (no-op) 14.5 Result Serialization — JSON voi datetime fallback 14.6 Cache Invalidation — Xoa cache theo pattern 14.7 Thread-Safe — Async lock bao dam an toan da luong ## 15. RATE LIMITING — Gioi Han Toc Do (6 tinh nang) 15.1 Sliding Window — Cua so truot 60 giay voi theo doi theo tenant 15.2 Burst Allowance — Cho phep burst vuot RPM limit (cau hinh duoc) 15.3 Redis Sorted Sets — Kiem tra va ghi atomic bang sorted sets 15.4 Tenant Isolation — Bucket gioi han rieng cho moi tenant 15.5 Fail Closed — Tu choi khi Redis loi (bao mat an toan) 15.6 Reset Tracking — Timestamp Unix cho thoi diem reset window tiep theo ## 16. OBSERVABILITY & TELEMETRY — Quan Sat Va Do Luong (7 tinh nang) 16.1 OpenTelemetry Integration — Async span processor + OTLP exporter 16.2 Retrieval Audit Log — JSONL ghi lai moi truy cap memory 16.3 Structured Logging — Dinh dang JSON cho he thong tong hop log 16.4 Tracer Provider — Tu dong cau hinh tu config 16.5 Metrics Provider — Meter de theo doi hieu nang 16.6 Graceful Degradation — Telemetry la optional, he thong van chay khi thieu 16.7 Configurable OTLP Endpoint — Xuat trace/metrics den endpoint tuy chinh ## 17. BACKUP & RESTORE — Sao Luu Va Phuc Hoi (8 tinh nang) 17.1 Episodic Export — Snapshot toan bo ChromaDB collection 17.2 Semantic Export — Xuat toan bo node + edge cua graph 17.3 Tar.gz Archive — Nen backup thanh tar.gz 17.4 Manifest — Ghi version + timestamp + so luong record 17.5 Safe Extraction — Chong path traversal attack khi giai nen 17.6 Episodic Upsert — Phuc hoi voi xu ly trung ID (upsert) 17.7 Semantic Restoration — Nhap lai node + edge tu backup 17.8 Count Reporting — Thong ke chi tiet sau khi phuc hoi ## 18. SESSION MANAGEMENT — Quan Ly Phien (6 tinh nang) 18.1 Session Lifecycle — Vong doi: start -> active -> end -> archive 18.2 JSON Persistence — Luu tai ~/.engram/sessions/ 18.3 Active Session Tracking — active.json cho phien hien tai 18.4 Session Metadata — Ghi nhan goal, discoveries, accomplished, files_touched 18.5 Archival — Phien hoan thanh luu tru voi ten UUID 18.6 Session Tagging — Memory duoc gan tag voi session ID ## 19. BENCHMARKING — Do Luong Do Chinh Xac (5 tinh nang) 19.1 Question-Based Testing — Nap cau hoi tu file JSON 19.2 Expected Answer Matching — Kiem tra cac tu khoa mong doi co trong ket qua 19.3 Accuracy Calculation — Ty le dung/tong so cau hoi 19.4 Type-Based Metrics — Phan tich theo loai cau hoi (temporal, factual, etc.) 19.5 Detailed Results — Ket qua chi tiet: dung/sai + thoi gian cho moi cau hoi ## 20. INGESTION & EXTRACTION — Nhap Lieu Va Trich Xuat (7 tinh nang) 20.1 LLM Fact Extraction — Trich xuat facts, decisions, lessons tu van ban bang LLM 20.2 Dual Ingest — Trich xuat entity + luu memory dong thoi 20.3 Chat JSON Parsing — Nhap du lieu tu dinh dang chat file 20.4 Folder Watching — Tu dong ingest khi co file moi (inotify-based) 20.5 OpenClaw Integration — Bat session real-time tu OpenClaw agent 20.6 Dry-Run Mode — Xem truoc ket qua ma khong luu 20.7 Legacy Migration — Nhap tu export dinh dang cu ## 21. GRAPH VISUALIZATION — Truc Quan Hoa Do Thi (7 tinh nang) 21.1 Interactive UI — Giao dien vis-network voi force-directed layout 21.2 Dark Theme — Giao dien toi de mat 21.3 Node Search — Tim kiem node theo tu khoa + highlight 21.4 Click Inspection — Xem chi tiet node khi click 21.5 Edge Labeling — Hien thi loai relationship tren canh 21.6 Graph Data Export — Endpoint JSON /api/v1/graph/data 21.7 Spring-Damper Physics — Mo phong vat ly 1D cho canh do thi ## 22. MULTI-TENANCY — Da Doi Tuong (5 tinh nang) 22.1 Namespace Isolation — Collection episodic rieng cho moi namespace 22.2 ContextVar-Based Tenancy — Thread-safe tenant context bang ContextVar 22.3 PostgreSQL Row-Level Security — Loc du lieu theo tenant_id trong SQL 22.4 API-Level Isolation — Dinh tuyen tenant theo HTTP request 22.5 Session Per-Tenant — Session store rieng cho moi namespace ## 23. WEBSOCKET API — Giao Dien WebSocket (20 tinh nang) ### Commands (7) 23.1 remember — Luu memory qua WebSocket 23.2 recall — Tim kiem memory qua WebSocket 23.3 think — Suy luan LLM qua WebSocket 23.4 feedback — Ghi phan hoi qua WebSocket 23.5 query — Truy van graph qua WebSocket 23.6 ingest — Nhap du lieu qua WebSocket 23.7 status — Lay thong ke qua WebSocket ### Authentication (3) 23.8 JWT Token Auth — Xac thuc bang JWT token qua query parameter 23.9 Write Command Protection — Lenh ghi (remember, feedback, ingest) can quyen AGENT+ 23.10 Unauthorized Close — Dong ket noi voi ma 4001 khi xac thuc that bai ### Protocol (4) 23.11 WSCommand — Mo hinh lenh client -> server voi id, type, payload 23.12 WSResponse — Mo hinh phan hoi server -> client voi status + data 23.13 WSError — Mo hinh loi voi error code + message 23.14 WSEvent — Push notification cho thay doi memory ### Events (4) 23.15 memory_created — Su kien khi memory moi duoc tao 23.16 memory_updated — Su kien khi memory cap nhat 23.17 memory_deleted — Su kien khi memory bi xoa 23.18 feedback_recorded — Su kien khi phan hoi duoc ghi nhan ### Connection Management (2) 23.19 Tenant-Grouped Connections — Nhom ket noi theo tenant_id 23.20 Event Bus Broadcasting — Phat song su kien toi tat ca client cung tenant (tru sender) ## 24. CONFIGURATION SYSTEM — He Thong Cau Hinh (7 tinh nang) 24.1 YAML-Based Config — File cau hinh tai ~/.engram/config.yaml 24.2 Environment Var Expansion — Thay the ${ENV_VAR} trong config 24.3 Pydantic Models — Type-safe config voi validation tu dong 24.4 CLI Overrides — Flag dong lenh ghi de YAML 24.5 Env Var Overlay — Bien moi truong ENGRAM_* ghi de file config 24.6 Defaults — Gia tri mac dinh hop ly, chay duoc ngay khong can config 24.7 Config Sections — Phan: episodic, semantic, llm, auth, cache, telemetry, etc. ## 25. ERROR HANDLING — Xu Ly Loi (5 tinh nang) 25.1 Error Codes — Phan hoi loi co cau truc: NOT_FOUND, INVALID, CONFLICT, etc. 25.2 LLM Input Sanitization — Gioi han do dai + escape chong injection 25.3 Content Sanitization — Loai bo/escape noi dung nguy hiem 25.4 Logging Setup — Structured JSON + text logging voi correlation ID 25.5 Exception Handling — Try/catch toan dien voi logging chi tiet ## 26. PROVIDER SYSTEM — He Thong Provider Mo Rong (10 tinh nang) 26.1 Provider Registry — Dang ky va quan ly provider bang config + entry_points 26.2 REST Adapter — Ket noi den memory service ben ngoai qua REST API 26.3 File Adapter — Doc/ghi memory tu file cuc bo 26.4 PostgreSQL Adapter — Ket noi truc tiep den PostgreSQL 26.5 MCP Adapter — Ket noi den MCP server ben ngoai 26.6 Smart Query Router — Phan loai query (think vs recall) va fan-out den provider phu hop 26.7 Intent Classification — Nhan dien reasoning keywords (Vietnamese + English) 26.8 Auto-Discovery — Tu dong phat hien service ben ngoai (cognee, mem0, etc.) 26.9 Entry Point Plugins — Ho tro plugin ben thu 3 qua importlib entry_points 26.10 Internal/Domain Routing — Bo qua provider ngoai cho truy van noi bo, them cho truy van domain ## 27. WEBUI — Giao Dien Web (12 tinh nang) 27.1 Dashboard — Tong quan he thong voi thong ke memory 27.2 Memory Browser — Duyet va tim kiem memory voi filter 27.3 Think Interface — Giao dien suy luan LLM truc tiep tren web 27.4 Audit Viewer — Xem nhat ky kiem toan 27.5 Settings Panel — Cau hinh he thong qua web 27.6 Authentication — Dang nhap voi JWT token 27.7 Dark/Light Theme — Chuyen doi giao dien sang/toi 27.8 SVG Icon System — He thong icon SVG nhe 27.9 Toast Notifications — Thong bao popup noi tuyen 27.10 Modal Dialogs — Hop thoai modal cho xac nhan/nhap lieu 27.11 Tab-Based Navigation — Dieu huong tab: Dashboard, Memories, Think, Audit, Settings 27.12 Responsive API Client — Module api.js giao tiep voi backend ## 28. TUI — Giao Dien Terminal (5 tinh nang) 28.1 Textual App — Ung dung terminal tuong tac dung Textual framework 28.2 Dashboard Pane — Tab tong quan trong terminal 28.3 Search Pane — Tim kiem memory trong terminal 28.4 Recent Pane — Xem memory gan day trong terminal 28.5 Sessions Pane — Quan ly phien trong terminal ## 29. GIT SYNC — Dong Bo Git (5 tinh nang) 29.1 Incremental JSONL Chunks — Xuat memory thanh chunk UUID gz, tranh xung dot merge 29.2 Manifest Tracking — Theo doi trang thai synced/imported 29.3 Git Root Detection — Tu dong tim .git root tu thu muc hien tai 29.4 Push Command — Day memory moi len git 29.5 Pull Command — Keo va nhap memory tu git ## 30. CONSOLIDATION ENGINE — Dong Co Gom Nhom (5 tinh nang) 30.1 Jaccard Clustering — Gom nhom memory theo entity/tag overlap 30.2 LLM Summarization — Tom tat moi cluster bang LLM 30.3 Consolidation Groups — Lien ket memory goc voi memory tong hop 30.4 Auto-Trigger — Tu dong gom nhom sau N tin nhan 30.5 Threshold Configuration — Cau hinh nguong tu dong trigger ## 31. HEALTH CHECK — Kiem Tra Suc Khoe (4 tinh nang) 31.1 ChromaDB Health — Kiem tra trang thai va latency cua ChromaDB 31.2 Semantic Graph Health — Kiem tra trang thai va latency cua graph 31.3 Component Health Model — Mo hinh: name, status, latency_ms, details, error 31.4 Liveness Endpoint — GET /health tra ve trang thai tong quat ## 32. WEBHOOK HOOKS — Su Kien Hook (4 tinh nang) 32.1 on_remember Hook — Goi webhook khi memory moi duoc luu 32.2 on_think Hook — Goi webhook khi suy luan hoan tat 32.3 SSRF Protection — Chan IP noi bo va scheme khong cho phep 32.4 IPv6 Mapped IPv4 Handling — Xu ly dia chi IPv6-mapped IPv4 (::ffff:127.0.0.1) ## 33. DATA MODELS — Mo Hinh Du Lieu (5 tinh nang) 33.1 Memory Types (10) — fact, decision, preference, todo, error, context, workflow, lesson, avoidance, personality_trait 33.2 Priority Levels (5) — LOWEST(1), LOW(3), NORMAL(5), HIGH(7), CRITICAL(10) 33.3 Feedback Types — positive, negative 33.4 Pydantic Models — EpisodicMemory, SemanticNode, SemanticEdge, ExtractionResult, IngestResult 33.5 Schema Models — AttributeDef, NodeDef, EdgeDef, SchemaDefinition ==================================================== TONG CONG: 265 TINH NANG ==================================================== Phan bo theo danh muc: 1. Episodic Memory .............. 10 2. Semantic Memory .............. 10 3. Recall Pipeline .............. 10 4. Feedback Loop ................ 8 5. Poisoning Guard .............. 4 6. Auto-Memory Detection ........ 8 7a. Audit Trail ................. 8 7b. Resource Tier ............... 7 7c. Data Constitution ........... 7 7d. Consolidation Scheduler ..... 8 8. Reasoning Engine ............. 9 9. Client SDK ................... 10 10. MCP Server ................... 19 11. HTTP API ..................... 14 12. CLI Commands ................. 43 13. Auth & RBAC .................. 9 14. Caching ..................... 7 15. Rate Limiting ................ 6 16. Telemetry .................... 7 17. Backup & Restore ............. 8 18. Session Management ........... 6 19. Benchmarking ................. 5 20. Ingestion & Extraction ....... 7 21. Graph Visualization .......... 7 22. Multi-Tenancy ................ 5 23. WebSocket API ................ 20 24. Config System ................ 7 25. Error Handling ............... 5 26. Provider System .............. 10 27. WebUI ....................... 12 28. TUI .......................... 5 29. Git Sync ..................... 5 30. Consolidation Engine ......... 5 31. Health Check ................. 4 32. Webhook Hooks ................ 4 33. Data Models .................. 5 ----- TONG: 265 ==================================================== Engram v0.4.0 | Python 3.11+ | 790 tests | 108 files github.com/docaohieu2808/engram ====================================================