"I hold your memories so they never fade away~" — Jeshta ✨
Cognitive Memory Engine for Agentic AI
Jeshta is a local-first MCP server that gives LLMs true cognitive memory. Powered by APSM (Active Programmatic Synthesis Memory) — a neuro-symbolic architecture with episodic traces, semantic knowledge graphs, procedural skill learning, and Wake-Sleep consolidation.
┌─────────────────────────────────────────────────────────────┐
│ JESHTA COGNITIVE ENGINE │
├─────────────────────────────────────────────────────────────┤
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ LAYER 1 │ │ LAYER 2 │ │ LAYER 3 │ │
│ │ Episodic │ │ Semantic │ │ Procedural │ │
│ │ Stream │ │ Graph │ │ Library │ │
│ │ │ │ │ │ │ │
│ │ Experience │ │ Knowledge │ │ Skills │ │
│ │ Traces │ │ Triples │ │ Code │ │
│ │ │ │ │ │ │ │
│ │ (Context, │ │ (Subject, │ │ (Name, │ │
│ │ Action, │ │ Relation, │ │ Code, │ │
│ │ Outcome) │ │ Object) │ │ Execute) │ │
│ └──────┬──────┘ └──────┬──────┘ └──────┬──────┘ │
│ │ │ │ │
│ └────────────┬────┴──────────────────┘ │
│ │ │
│ ┌───────▼───────┐ │
│ │ WAKE-SLEEP │ │
│ │ Consolidation │ │
│ │ │ │
│ │ Pattern→Skill │ │
│ └───────────────┘ │
└─────────────────────────────────────────────────────────────┘
Layer
Name
Purpose
Analogy
1
Episodic Stream
Raw experience traces
Hippocampus
2
Semantic Graph
Knowledge relationships
Neocortex (Declarative)
3
Programmatic Library
Executable skills
Neocortex (Procedural)
Wake (Active) : Log experiences → Query knowledge → Execute skills
Sleep (Consolidate) : Find patterns → Abstract into skills → Prune old data
Feature
Description
🧠 Tri-Layer Memory
Episodic traces + Semantic graph + Procedural skills
🔄 Wake-Sleep Cycle
Automatic pattern→skill consolidation
🌐 Knowledge Graph
Entity-Relation-Entity triples with Cypher-like queries
⚡ Skill Execution
Store and run Python code safely (AST sandboxed)
📊 Experience Logging
Context, Action, Observation, Outcome traces
🔌 Zero Dependencies
Just Python + SQLite. Local-first, no cloud
Tool
Purpose
compile_context
Initialize session, get cognitive state
apsm_status
Memory health check
verify_integrity
Data corruption check
Tool
Purpose
log_episode
Log experience (context, action, outcome)
recall_episodes
Search past experiences
Tool
Purpose
add_atom
Save fact/preference/constraint
search_atoms
Search knowledge
add_fact
Add relationship triple
query_graph
Cypher-like graph query
recall_related
Get connected nodes
delete_atom
Remove knowledge
Layer 3: Procedural Skills
Tool
Purpose
add_skill
Store executable Python code
execute_skill
Run stored skill
list_skills
List available skills
Tool
Purpose
consolidate
Run pattern→skill cycle
pip install numpy fastembed
Add to your MCP config:
{
"mcpServers" : {
"Jeshta" : {
"command" : " python" ,
"args" : [" D:\\ brain\\ Jeshta\\ server.py" ]
}
}
}
Save a Preference (Layer 2)
mcp_Jeshta_add_atom (
content = "User prefers TypeScript over JavaScript" ,
intent_mask = 4 # Constraint
)
Log an Experience (Layer 1)
mcp_Jeshta_log_episode (
action = "Fixed authentication bug" ,
context = {"file" : "auth.py" , "error" : "token expired" },
observation = "Token refresh was missing" ,
outcome = {"success" : True , "solution" : "Added refresh logic" },
surprise_score = 0.7
)
Add Knowledge Triple (Layer 2)
mcp_Jeshta_add_fact (
subject = "React" ,
relation = "is_a" ,
object = "Frontend Framework"
)
mcp_Jeshta_add_skill (
name = "format_json" ,
description = "Pretty print JSON" ,
code = "import json; result = json.dumps(data, indent=2)" ,
parameters = [{"name" : "data" , "type" : "dict" }]
)
File
Purpose
apsm.py
Core cognitive engine (Tri-Layer + Wake-Sleep)
server.py
MCP server interface
AI_INSTRUCTIONS.md
How AI should use Jeshta
apsm.db
SQLite database (auto-created)
Jeshta — Cognitive memory that learns, forgets, and grows.
Built with ❤️ for the Agentic Future.