BlueCortexCE
AGENTS.md4 starsChanged 37 days agoMITView on GitHub
Claude-mem is a Java Spring Boot implementation of a persistent memory system for AI assistants. It provides persistent context and intelligent memory management across sessions. Core Components: 5 Lifecycle Hooks: SessionStart → UserPromptSubmit → PostToolUse → Summary → SessionEnd Key Services: - POST /api/ingest/tool-use - Ingest tool-use events into memory system (/user-prompt, /observation, /session-end are the sibling routes; there is no handler on the bare POST /api/ingest path) - GET /stream - SSE stream of memory events - GET /api/search…
- Reads credentials
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,774 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository2 other files it gives its agents.
- doc-managementSkill
- upstream-syncSkill
The file
We split this AGENTS.md into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 96
Use proxy/wrapper.js as CLI Hook wrapper.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Claude-Mem: AI Development Instructions
Claude-mem is a Java Spring Boot implementation of a persistent memory system for AI assistants. It provides persistent context and intelligent memory management across sessions.
Project Structure
cortexce/
├── .agents/ # Agent configuration and project-local skills
│ └── skills/ # Agent Skills
├── backend/ # Java Spring Boot backend service
│ └── src/main/java/com/ablueforce/cortexce/
│ ├── controller/ # REST API controllers
│ ├── service/ # Business logic services
│ ├── entity/ # JPA entities
│ ├── repository/ # Data access layer
│ ├── config/ # Spring configuration
│ ├── mcp/ # MCP tool integration
│ └── util/ # Utility classes
├── proxy/ # Node.js proxy layer (wrapper.js)
├── openclaw-plugin/ # OpenClaw plugin integration
│ └── skills/ # Agent Skills
├── docs/ # Project documentation
└── scripts/ # Scripts and toolsArchitecture
Core Components:
- Worker Service (
backend/) - Spring Boot 3.3 application, running on port 37777 - Database - PostgreSQL + pgvector for vector storage
- Proxy Layer (
proxy/wrapper.js) - Node.js middleware for CLI Hook forwarding - OpenClaw Plugin (
openclaw-plugin/) - OpenClaw integration plugin - Search Skill - HTTP API for searching historical records
5 Lifecycle Hooks: SessionStart → UserPromptSubmit → PostToolUse → Summary → SessionEnd
Key Services:
ContextService.java- Core context management serviceAgentService.java- Agent lifecycle managementSearchService.java- Vector search serviceEmbeddingService.java- Embedding vector generationModeService.java- Memory mode management
API Endpoints
POST /api/ingest/tool-use- Ingest tool-use events into memory system (/user-prompt,/observation,/session-endare the sibling routes; there is no handler on the barePOST /api/ingestpath)GET /stream- SSE stream of memory eventsGET /api/search- Search observations (semantic when an embedding model is configured, PostgreSQL full-text fallback otherwise)GET /api/sessions- List sessionsGET /api/health- Health check
Full, verified endpoint list:
docs/API.md/docs/API-zh-CN.md. Those files are checked against the running server byscripts/check-api-doc-surface.py.
Database Schema
- SessionEntity - Session records
- UserPromptEntity - User prompts
- ObservationEntity - Agent observations
- SummaryEntity - Summary records
- PendingMessageEntity - Pending messages
Build & Run
# Build backend (runs the test suite; DB-gated tests skip unless the
# MEMSCOPE_* variables in docs/TESTING.md are set)
cd backend
mvn clean install
# Run
java -jar target/cortex-ce-*.jar
# Or with Docker
docker-compose up -dConfiguration
Configuration is loaded from backend/src/main/resources/application.yml
(profile overrides: application-dev.yml, application-prd.yml) or environment variables:
SPRING_DATASOURCE_URL- PostgreSQL connectionSPRING_AI_OPENAI_API_KEY- OpenAI API KeySERVER_PORT- Service port (default 37777)
Integration
Claude Code
Use proxy/wrapper.js as CLI Hook wrapper.
OpenClaw
Integrated via openclaw-plugin/, provides search Skill.
Requirements
- Java 21+ (the test suite is verified on JDK 21 and JDK 25)
- PostgreSQL 16+ (with pgvector extension)
- Maven 3.8+
- Node.js (for proxy layer)
Documentation
docs/PROJECT-STATE.md- Current verified state and handover: test counts, gate command, schema decisions, known boundaries. Read this first when resuming work.docs/PROJECT-STATE-zh-CN.md- Chinese version of the same snapshot.docs/- Project documentation (stable reference)docs/drafts/- Active design documents under iterationdocs/archive/- Historical snapshots (read-only, date-prefixed filenames)backend/README.md- Backend detailed documentationproxy/README.md- Proxy layer documentation
Documentation Management Rules
⚠️ BEFORE creating or moving any .md file, activate .agents/skills/doc-management/SKILL.md and classify the document:
| Type | Location | Example |
| Live (periodically updated) | Appropriate dir + purpose header | docs/performance-test-results.md |
| Historical (point-in-time) | docs/archive/YYYY-MM-DD_<name>.md | Test reports, completed trackers |
| Draft (under iteration) | docs/drafts/ | Phase design docs |
| Reference (stable) | docs/ | API, Architecture docs |
Never scatter documents — no backend/TASK_PROGRESS.md, no root-level test reports, no duplicates.
Key Files
backend/pom.xml- Maven configurationbackend/src/main/resources/application.yml- Application configurationdocker-compose.yml- Docker deployment configuration
⚠️ WebUI 子模块 API 契约
WebUI 通过 git 子模块引入(https://github.com/Blueforce-Tech-Inc/claude-mem.git),路径 webui/。
修改任何 API 响应字段名前,必须先检查 WebUI 是否引用。
不可修改的 camelCase 字段(WebUI 硬契约)
| 端点 | 字段 | WebUI 引用 |
/api/observations | hasMore | src/ui/viewer/hooks/usePagination.ts |
/api/summaries | hasMore | 同上 |
/api/prompts | hasMore | 同上 |
/api/session/start | updateFiles | proxy/proxy.js |
/api/context/inject | updateFiles | proxy/proxy.js |
/api/settings | CLAUDE_MEM_* | src/ui/viewer/hooks/useSettings.ts |
可安全修改为 snake_case 的字段
| 端点 | 字段 | 原因 |
/api/modes | observation_types/observation_concepts | WebUI 从本地 ModeManager 读取(ModeManager.getInstance().getActiveMode()),不读 API 响应 |
/api/settings | modeName/modeDescription | WebUI 与 proxy 均不引用;ViewerController 直接 response.put 产出 |
检查方式
# 修改前搜索 WebUI 引用
# 注意 updateFiles 的消费方在 proxy/proxy.js,不在 webui/src/ ——
# 只扫 webui/ 会得到零命中,看起来"没人用",而它其实是硬契约。
grep -rn "hasMore\|updateFiles\|observationTypes" webui/src/ proxy/Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

