All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- MCP Server — FastMCP-based tool server with 9 tools (add_memory, search_memory, add_knowledge, get_conversation_context, get_user_profile, get_emotional_state, get_relationship_state, manage_persona, create_session), stdio transport,
cortexflow-mcpentry point - LangChain Integration —
CortexFlowChatMessageHistory,CortexFlowRetriever,CortexFlowMemoryadapters incortexflow.integrations.langchain - CrewAI Integration —
CortexFlowCrewStorageimplementing CrewAI storage protocol incortexflow.integrations.crewai - Pluggable Vector Store Backends —
VectorStoreBackendABC with SQLite (default), ChromaDB, and Qdrant adapters;create_vector_store()factory; wired intoKnowledgeStorewith dual-write and fallback - Temporal Facts —
TemporalFactandTemporalManagerfor time-aware fact management with validity windows, superseding, conflict detection; auto-extracts from conversation messages - Episodic Memory —
EpisodeandEpisodicMemoryStorewith SQLite + FTS5 full-text search; auto-saves episodes on session close - Event System — Thread-safe
EventBuswith pub/sub, 12 event types, emits at 7 manager lifecycle points; decorator-based handler registration - Safety Pipeline —
SafetyPipelinewith PII detection (email, phone, SSN, credit card), boundary enforcement (medical/legal/impersonation), custom rules; configurable blocking or filtering - New config sections —
VectorStoreConfig,TemporalConfig,EpisodicConfig,EventConfig,SafetyConfigwith builder methods - New optional dependency groups —
mcp,langchain,crewai,chromadb,qdrant - 5 example scripts in
examples/directory - Convenience methods —
get_temporal_facts(),get_recent_episodes(),search_episodes()on manager
- Version bumped to 1.0.0
pyproject.tomlupdated with new classifiers, keywords, andcortexflow-mcpentry point__init__.pynow exports all new classes (EventType, EventBus, TemporalFact, TemporalManager, Episode, EpisodicMemoryStore, VectorStoreBackend, VectorSearchResult, SafetyLevel, SafetyResult, SafetyRule, SafetyPipeline)- README updated with comprehensive documentation for all new features
- LiteLLM integration — new
LiteLLMClientsupporting 100+ LLM providers (OpenAI, Anthropic, Cohere, Azure, Bedrock, etc.) through a unified interface - Async LLM interface —
agenerate()andagenerate_from_prompt()methods onLLMProviderInterfacewith native async support in LiteLLMClient - Dependabot — automated weekly dependency updates for pip and GitHub Actions
- Security scanning — TruffleHog secret scanning and dependency review on PRs via GitHub Actions
- Personal Fact Extraction for deep memory recall:
- New
fact_detector.pymodule with regex-basedPersonalFactDetectorclass - Detects names, occupations, locations, preferences, possessions, and age statements
- Entity-aware importance scoring: personal facts score 8.0 (above regular content, below system messages)
- Entity-preserving compression: fact sentences get maximum score (10.0) in extractive summarization
- Dual-write to knowledge store: detected facts are automatically stored for BM25 retrieval
- New
use_fact_extractionconfig flag and.with_fact_extraction()builder method - Benchmark result: 5/5 personal facts recalled after 40 filler pairs (up from 0-1/5)
- New
- Core Reasoning Framework:
- Implemented ReasoningEngine for multi-step reasoning orchestration
- Added QueryPlanner for breaking complex queries into reasoning steps
- Created ReasoningState for tracking multi-step reasoning processes
- Implemented multiple reasoning strategies (forward/backward chaining, abductive reasoning)
- Added state tracking mechanisms for reasoning confidence and explanation
- Path-based Inference capabilities:
- Implemented BidirectionalSearch for efficient path finding between entities
- Added WeightedPathSearch for confidence and importance-based path discovery
- Created ConstrainedPathSearch for relation-filtered path traversal
- Added PathExplainer for human-readable reasoning traces
- Integrated with agent chain for enhanced knowledge exploration
- Enhanced Knowledge Graph Schema and Integration:
- Extended database schema for relation types and confidence scores
- Added metadata fields for provenance tracking and versioning
- Implemented GraphMerger component for intelligent knowledge integration
- Added entity merging with duplicate detection and conflict resolution
- Implemented automatic taxonomic relationship extraction
- Added relationship inference for transitive, symmetric, and inverse relations
- Performance optimization features for knowledge graph operations:
- Graph partitioning for efficient storage and retrieval
- Multi-hop indexing strategies for faster path traversal
- Query planning system for optimizing reasoning paths
- Caching mechanisms for common reasoning patterns
- LRU cache management with prioritization and persistence
- Advanced indexing for direct relationships and frequent query patterns
- Cache eviction strategies based on usage patterns and recency
- Comprehensive Evaluation Framework:
- Multi-hop reasoning test suite with complex query patterns
- Automatic metrics for reasoning accuracy (precision, recall, F1)
- Path continuity and semantic relevance scoring
- Knowledge graph consistency benchmarks and validation
- Constraint-based verification (functional, inverse functional, disjoint classes)
- Visualizations and reports for benchmark results
- Advanced Graph Traversal Components:
- Optimized traversal algorithms including BFS, bidirectional search, A* search
- Graph traversal profiler with performance monitoring and optimization suggestions
- Weighted path finding with custom weight functions
- Dijkstra's algorithm implementation for weighted paths
- Path finding with constraints and exclusions
- New documentation for performance optimization features
- Example script demonstrating performance optimization capabilities
- Evaluation Framework implementation:
- Added missing multi-hop query methods in CortexFlowManager
- Implemented knowledge snapshot functionality for consistency tracking
- Fixed build_knowledge_subgraph method for reliable entity handling
- Enhanced temporal consistency calculation in consistency metrics
- Added support for path finding and reasoning path logging
- Improved memory and resource management:
- Added proper resource cleanup to
Ontologyclass withclose()method and destructor - Enhanced
CortexFlowManager.close()to properly clean up all child components - Implemented context manager pattern for
TraversalProfilerwith proper cleanup - Added safer file operations with context managers to prevent resource leaks
- Enhanced existing
close()methods with more thorough cleanup - Added destruction safeguards to ensure resources are properly released
- Improved error handling in cleanup routines across modules
- Added proper resource cleanup to
- Centralized optional dependency management:
- Created
dependency_utilsmodule with utilities for handling optional dependencies - Added
check_dependencyandimport_optional_dependencyfunctions for consistent dependency checking - Refactored optional import patterns across modules to use the new utility functions
- Improved error messaging and logging for missing dependencies
- Created
- Python 3.10+ required — dropped Python 3.8 and 3.9 support, added 3.13 and 3.14
- Ruff replaces flake8/black/isort — single Rust-based tool for linting and formatting (10-100x faster)
- Modern type hints — all modules use PEP 604/585 syntax (
list[str],X | None) viafrom __future__ import annotations - CI modernized — Python 3.10-3.14 matrix, Ruff linting,
--cov-fail-under=80coverage threshold - Coverage threshold — CI enforces 80% minimum code coverage
- Refactored search methods in knowledge.py using strategy pattern:
- Created abstract
SearchStrategyinterface - Implemented concrete strategy classes for BM25, dense vector, hybrid, and keyword search
- Updated
KnowledgeStoreto use these strategies through thesearch_strategymethod
- Created abstract
- Improved configuration management:
- Refactored
CortexFlowConfigusing builder pattern and nested config classes - Organized parameters into logical sections for better clarity and maintainability
- Added descriptive documentation for all configuration sections
- Refactored
- Enhanced knowledge module API:
- Added new
add_knowledge()method with clearer naming and purpose - Deprecated
remember_knowledge()method with proper warnings - Improved backward compatibility with support for both old and new config structures
- Added migration guide for transitioning to new API
- Added new
- Resolved issues with CortexFlowManager multi-hop query handling
- Fixed knowledge snapshot functionality for consistency evaluation
- Improved error handling in graph subgraph building
- Corrected temporal calculations in consistency metrics
- Fixed database initialization issues in reasoning engine tests
- Improved mock implementations for path inference tests
- Enhanced demonstration script to use mocked objects for reliable testing
- Corrected bidirectional search implementation for proper path finding
- Fixed method patching in test_reasoning_process test case
- Addressed overlapping functionality between
remember_explicitandremember_knowledgemethods
- Uncertainty handling and belief revision mechanisms:
- Support for explicit representation of uncertainty (confidence scores, probability distributions)
- Contradiction detection and resolution strategies
- Source reliability tracking and weighting
- Methods for reasoning with incomplete information
- Belief revision history tracking
- Improved entity extraction with semantic role labeling
- Enhanced relation extraction with coreference resolution
- Updated documentation with uncertainty handling examples
- Advanced graph traversal features:
- Weighted path algorithms prioritizing importance and confidence
- Bidirectional search for efficient entity connection discovery
- Constrained path finding with relation type requirements
- Graph contraction for handling large knowledge graphs
- Hierarchical graph abstraction for simplified representations
- Performance improvements in knowledge retrieval
- Enhanced entity and relationship extraction
- Self-Reflection capabilities to verify knowledge relevance and response consistency
- Reflection-based learning for improving future responses
- Configuration options for reflection depth and threshold
- Improved token usage with more efficient compression algorithms
- Enhanced documentation with self-reflection examples
- Chain of Agents for collaborative multi-agent reasoning
- Support for specialized agents with different expertise areas
- Agent communication protocols for complex query resolution
- Configuration options for agent chains
- Enhanced documentation with Chain of Agents examples
- Performance improvements in knowledge retrieval
- Dynamic memory tier weighting for adaptive token allocation
- Importance-based balancing between tiers
- Configuration options for dynamic weighting
- Improved compression strategies for working and archive tiers
- Enhanced documentation with dynamic weighting examples
- Advanced retrieval augmentation with GraphRAG
- Knowledge graph integration for complex querying
- Support for multi-hop relationship queries
- Improved entity and relationship extraction
- Enhanced documentation with GraphRAG examples
- Initial release with multi-tier memory architecture
- Support for active, working, and archive memory tiers
- Basic importance-based information retention
- Knowledge store for persistent information
- Simple context compression strategies