Storage Architecture
Cipher implements a four-layer storage architecture designed for different data types and access patterns:- Cache Backend: Fast, ephemeral storage for temporary data and caching
- Database Backend: Persistent, reliable storage for long-term data
- Vector Storage: High-dimensional vector storage for semantic search
- Knowledge Graph: Graph database for entity relationships
Cache Backend
The cache backend provides fast, ephemeral storage for session data, temporary caches, and frequently accessed information. This layer prioritizes speed over persistence. Options:- Redis (Production): Distributed, high-performance cache with persistence options
- In-Memory (Development): Simple local storage for testing and development
- Session state management
- Temporary conversation context
- Fast lookups and caching
- Performance optimization
Database Backend
The database backend provides persistent, reliable storage for long-term data that must survive system restarts and maintain ACID properties. Options:- PostgreSQL (Production): Full-featured relational database with advanced features
- SQLite (Development): Lightweight, file-based database for single-user applications
- In-Memory (Testing): Temporary storage for testing scenarios
- Memory operation history and audit trails
- User data and preferences
- Configuration persistence
- Long-term analytics and reporting
Memory Architecture
Built on top of these storage layers, Cipher implements a three-component memory system that provides intelligent knowledge management and continuous learning capabilities:Knowledge Memory
Knowledge memory stores factual information, technical concepts, and domain-specific knowledge extracted from conversations. It uses vector embeddings to enable semantic search and retrieval. Content Types:- Technical concepts and programming patterns
- Code snippets and implementation details
- Domain knowledge and project context
- Best practices and optimization techniques
Reflection Memory
Reflection memory captures the agent’s reasoning processes and decision-making patterns, enabling continuous learning and improvement through pattern recognition. Content Types:- Step-by-step reasoning traces
- Decision-making processes and logic
- Pattern recognition and effectiveness metrics
- Learning experiences and quality evaluations
Knowledge Graph
Knowledge graph provides advanced relationship modeling between entities, enabling complex queries and deep understanding of connections within the knowledge base. Content Types:- Entity relationships and connections
- Hierarchical knowledge structures
- Cross-domain knowledge mapping
- Complex query patterns
Vector Storage Configuration
Both knowledge and reflection memory utilize vector storage for semantic search capabilities:Knowledge Graph Configuration
Knowledge graph functionality provides advanced relationship modeling:Memory Tools
Cipher provides internal tools for memory operations across all three memory components:Knowledge Memory Tools
cipher_extract_and_operate_memory
: Extract and manage knowledge entriescipher_memory_search
: Search stored knowledge using semantic queries
Reflection Memory Tools
cipher_store_reasoning_memory
: Store reasoning patterns and evaluationscipher_extract_reasoning_steps
: Extract reasoning traces from conversationscipher_evaluate_reasoning
: Evaluate reasoning quality and effectivenesscipher_search_reasoning_patterns
: Search for similar reasoning patterns
Knowledge Graph Tools
cipher_add_node
: Add nodes to the knowledge graph with labels and propertiescipher_add_edge
: Create relationships between nodes in the knowledge graphcipher_search_graph
: Search for nodes and edges with filtering capabilitiescipher_get_neighbors
: Get neighboring nodes and their relationshipscipher_extract_entities
: Extract entities from text and add to knowledge graphcipher_update_node
: Update existing node properties and labelscipher_delete_node
: Remove nodes and their relationships from the graphcipher_query_graph
: Execute custom queries against the knowledge graphcipher_enhanced_search
: Advanced search with semantic and fuzzy matchingcipher_intelligent_processor
: Process natural language to manage entities automaticallycipher_relationship_manager
: Intelligently manage complex relationship operations
Memory System Benefits
Persistent Intelligence
- Cross-Session Knowledge: Information persists across conversations and sessions
- Contextual Understanding: Build comprehensive domain and project knowledge
- Continuous Learning: Improve through pattern recognition and quality evaluation
Advanced Capabilities
- Semantic Search: Natural language queries across stored knowledge
- Pattern Recognition: Identify and reuse successful reasoning approaches
- Relationship Modeling: Understand complex connections between concepts
- Quality Assurance: Automated evaluation and improvement of memory content
Next Steps
Explore the detailed capabilities of each memory component:- Knowledge Memory: Detailed guide to knowledge extraction and storage
- Reflection Memory: Understanding reasoning pattern capture and analysis
- Knowledge Graph: Advanced relationship modeling and graph operations
- Memory Tools: Complete reference for memory-related tools and APIs