Welcome! This guide will get you up and running in 10 minutes.
pip install persistent-cognitionfrom persistent_cognition import DynamicSegmentedMemory
# Create memory
memory = DynamicSegmentedMemory(".memory/my-project.json")
# Store information
memory.write(
"Our API uses FastAPI with PostgreSQL. Auth is JWT-based.",
category_path="Project/Architecture"
)
# Query anytime
context = memory.active_context("How does our auth work?")
print(context.context_text)Add to claude_desktop_config.json:
{
"mcpServers": {
"persistent-cognition": {
"command": "persistent-cognition-mcp",
"args": ["--store", "/path/to/.memory/project.json"]
}
}
}Restart Claude Desktop. Done!
kernel = memory.crystallize_skill(
goal="Fix Redis timeout",
trajectory=["Increased connections", "Added health checks"],
outcome="Timeouts eliminated"
)history = memory.get_segment_history(segment_id)
memory.rollback_segment(segment_id, version=2)from persistent_cognition.ux_mapping import UXMapping
mapper = UXMapping(memory)
mapper.register_component(
file_path="src/components/LoginButton.tsx",
component_name="LoginButton",
user_description_en="Blue login button in top right"
)
results = mapper.find_component("login button")stats = memory.visualize(format="stats")
tree = memory.visualize(format="tree")
mermaid = memory.visualize(format="mermaid")
html = memory.visualize(format="html")- Organize with categories - Use clear hierarchical paths
- Set importance - Critical info gets 0.9+, normal 0.5
- Crystallize solutions - After solving problems
- Register UI components - Keep mappings updated
- Regular maintenance - Check duplicates, prune old data
Built with love by Narelabs - https://narelabs.com