# Epicode Agent Guide Epicode is an AI Memory Operating System. It gives AI agents persistent, searchable, connected memory across sessions. ## Authentication Header: `X-API-Key: YOUR_API_KEY` Rate limit: Free=60, Pro=300, Enterprise=1000 requests/minute ## MCP Endpoint `POST https://epicode.cn/api/mcp` Content-Type: application/json | Protocol: JSON-RPC 2.0 Request: `{"jsonrpc":"2.0","method":"tools/call","params":{"name":"TOOL_NAME","arguments":{...}},"id":1}` Response: `{"jsonrpc":"2.0","id":1,"result":{"content":[{"type":"text","text":"{...}"}]}}` Note: the `text` field is a JSON string that needs to be parsed again. ## Error Codes - `-32700` Parse error (malformed JSON) - `-32601` Method not found - `-32602` Invalid params - `-32603` Internal error - `-32001` Invalid API key ## Quick Start ``` 1. identity_confirm(name, mission, author) — ONCE, then immutable 2. ctx_load(project, task) — ALWAYS call at session start 3. ... work normally, use tools below ... 4. session_summary(accomplished, next_steps) — ALWAYS call at session end ``` ## MCP Tools (call `tools/list` for full schemas) Memory CRUD: memory_create, memory_get, memory_list, memory_update, memory_delete, memory_search Deep Recall: memory_recall Session Lifecycle: ctx_load (MANDATORY at start), ctx_save, session_summary Knowledge Capture: pattern_learn, pattern_recall, decision_record, bug_memory Knowledge Graph: knowledge_relations, concepts, kg_quality, dream_cycle Identity: identity_confirm, identity_step, identity_finalize Skills: skill_execute, skills_sync, skill_feedback Feedback & Rules: feedback_submit, enforced_rules, project_list Documents: doc_import, doc_list System: space_stats, context_observe, embedding_diagnostic, embedding_migrate ## Key Rules - ctx_load MUST be called at every session start. Pass `task` for precision loading. - feedback_submit after using search results — the system learns from outcomes. - session_summary at session end — next ctx_load picks up from it. - enforced_rules returns hard constraints — inject into system prompts. - Identity is immutable after confirmation.