Inspiration
Most memory agents depend on several separate services: an LLM framework, a vector database, a SQL store, queues, and another API. JAH MemoryAgent explores a smaller, auditable alternative: persistent memory implemented directly in the agent runtime.
JAH MemoryAgent is a production-oriented, native-PHP memory agent for Qwen Cloud. It retains durable preferences and project facts across sessions, injects only relevant memories into Qwen's bounded context, and supports persistent forgetting through tombstones.
What it does
JAH implements the core requirements of Track 1: MemoryAgent:
Persistent cross-session memory: append-only DataCoreTurbo records and persistent indexes survive requests and restarts. Hot / Warm / Cold lifecycle: Hot contains active dialogue, Warm retains useful temporary history, and Cold stores explicit or highly important long-term knowledge. Bounded Qwen context: retrieval is ranked, deduplicated, tombstone-aware, and limited before inference. Meaningful-memory classification: greetings, noise, secrets, transient questions, and forget commands are rejected; useful preferences, identity, workflows, project facts, and reusable knowledge can be retained. Reliable forgetting: persistent tombstones prevent canonical or archived copies from reappearing. Collection isolation: users, agents, and workspaces use separate memory namespaces. Security and auditability: SALK performs secret detection, output masking, security preflight, access control, CSRF protection, and append-only audit logging.
The demo shows Qwen recalling the earlier book Demian from a retrieved Warm-tier memory, receiving that memory through an explicitly delimited context block, saving a user preference to Cold memory, and retrieving it later through the DataCore index.
How we built it
The request path is coordinated by a custom ActionScript PHP runtime:
SALK security preflight input and importance classification Hot/Warm conversation loading Warm/Cold durable-memory retrieval context deduplication and size bounding Qwen Cloud inference conversation and durable-memory updates response masking and audit persistence
DataCoreTurbo is this project's own append-only binary storage engine—not an external company or service. SHA-256 selects compact pointer journals for direct ID lookup, while a persistent inverted term/prefix index supports rare-first query planning. Current pointers and tombstones are verified before results are returned.
MemoryPyramid implements the lifecycle:
Hot: active conversational working context Warm: temporary useful history Cold: compressed permanent knowledge Tombstones: deletion authority across every tier
QwenConnector calls the Qwen Cloud OpenAI-compatible endpoint directly through native PHP cURL. The API key is loaded from the environment and sent only in the Authorization header. It never enters prompts, memory records, screenshots, public responses, or Git.
Alibaba Cloud ECS deployment
The project was deployed directly on an Alibaba Cloud Linux 3 ECS instance without Docker. The included installer:
installs Git and PHP 8.2 with the required extensions; requests QWEN_API_KEY and JAH_API_KEY through hidden terminal input; writes secrets only to the ignored .env; validates the PHP source; runs the 18/18 product suite and 7/7 ActionScript suite; installs and enables jah-memoryagent.service; performs live Qwen and cross-session memory checks; and writes a secret-free deployment report containing the host, runtime, commit, service state, listening port, and test summaries.
Deployment commands: dnf install -y git cd /root git clone -b agent/alibaba-ecs-installer https://github.com/esmeydub/jah-php.git cd /root/jah-php chmod 755 deploy_alibaba_ecs.sh ./deploy_alibaba_ecs.sh
systemctl status jah-memoryagent --no-pager -l ss -ltnp | grep ':8000' cat /root/jah-php/runtime/deployment/alibaba-ecs-proof.txt
The verified deployment used PHP 8.2.32, an active and enabled systemd service, and source revision e9c094cf1a40111196bbb6e09610722be4a7ffcd. The generated proof reported SUMMARY 18/18 and SUMMARY 7/7.
Secure SSH tunnel used for testing
We deliberately did not expose inbound TCP 8000 in the ECS Security Group. The real Alibaba Cloud backend was tested through an encrypted SSH local-forward tunnel: ssh -N -L 8000:127.0.0.1:8000 root@
The tester then opens: http://127.0.0.1:8000/index.php
The request path is: Browser 127.0.0.1:8000 -> encrypted SSH tunnel over TCP 22 -> ECS 127.0.0.1:8000 -> jah-memoryagent.service -> Qwen Cloud over outbound HTTPS
-N prevents SSH from opening a remote shell. -L 8000:127.0.0.1:8000 maps port 8000 on the tester's computer to the ECS loopback service. The browser displays a local address, but all application logic, memory operations, and Qwen requests execute on the real Alibaba Cloud ECS backend. No SSH password, private key, Qwen key, or JAH API key is published.
Temporary public judging endpoint
The SSH tunnel above was the access method used while recording the deployment demonstration. After the demo was completed, a temporary inbound rule was enabled specifically for hackathon judging:
http://47.77.201.239:8000/index.php
The endpoint runs the same jah-memoryagent.service on Alibaba Cloud ECS and remains protected by the JAH application login. The temporary access credential is provided only in Devpost's private Testing Instructions for judges. QWEN_API_KEY remains server-side and is never disclosed. The TCP 8000 rule and judge credential will be removed or rotated after judging.
Architecture
The architecture diagram is available in the repository:
Full deployment evidence and reproducible commands:
https://github.com/esmeydub/jah-php/blob/agent/alibaba-ecs-installer/ALIBABA_CLOUD_PROOF.md
Challenges we ran into
Conversational continuity without keyword overlap: recent Hot/Warm turns must remain available even when a follow-up shares no terms with the original question. Forgetting across append-only storage: persistent tombstones must override canonical, Warm, and Cold copies. Fast retrieval without a database: DataCore v3 adds direct SHA-256 pointers and a persistent inverted index instead of full segment scans. Concurrent writes and consistency: file locks, atomic offsets, bounded workers, and verification prevent partial records from being accepted. Keeping secrets out of memory: SALK blocks sensitive fields, masks output and traces, and keeps Qwen credentials outside prompts and storage.
Accomplishments that we're proud of
Built a working persistent MemoryAgent around Qwen Cloud in native PHP. Implemented a real Hot/Warm/Cold lifecycle and persistent forgetting. Added direct ID pointers and indexed retrieval without an external database. Added collection isolation, authentication, SALK security gates, audit traces, and bounded worker execution. Deployed and verified the complete backend on Alibaba Cloud ECS without Docker. Passed 18/18 product tests and 7/7 ActionScript tests. Demonstrated recovered-memory injection, Cold-tier persistence, indexed search, and secure tunnel access in the final video.
What we learned
Memory quality is not the same as storing everything. A useful agent needs explicit rules for what becomes durable, what remains temporary, what is retrieved into a limited context window, and what must be permanently forgotten.
We also learned that a compact, database-free runtime can still support indexes, locking, isolation, authentication, auditing, recovery, and secure cloud deployment when those capabilities are designed into the memory layer.
What's next
Add richer importance scoring using explicit intent, recency, frequency, and preference type. Expand repeatable benchmarks across larger datasets and filesystems. Add a real-time dashboard for Hot/Warm/Cold movement. Add operational metrics for retrieval quality, context utilization, and memory aging.
Built With
- actionscript-php
- alibaba-cloud-ecs
- datacoreturbo
- memorypyramid
- php-8.2
- qwen-cloud
- qwen-max
- salk

Log in or sign up for Devpost to join the conversation.