Graph-Native Infrastructure for Context and Accountable AI Systems
Python agent-memoryaiai-governanceai-infrastructureartificial-intelligencecontext-engineeringcontext-graphsdata-engineeringdecision-intelligencedeveloper-toolsexplainable-aigenerative-aigraph-ragknowledge-graphllmontologyprovenancepythonreasoningsemantic-search
Merge remote-tracking branch 'origin/utils' into utils
KaifAhmad172a6ddb48f2f
diff --cc CHANGELOG.mdindex 1220d98e,ff5833df..8a168452--- a/CHANGELOG.md+++ b/CHANGELOG.md@@@ -7,69 -7,14 +7,74 @@@ and this project adheres to [Semantic V## [Unreleased]+### Added+- **Parallel Extraction Engine**:+ - Implemented high-throughput parallel batch processing across all core extractors (`NERExtractor`, `RelationExtractor`, `TripletExtractor`, `EventDetector`, `SemanticNetworkExtractor`) using `concurrent.futures.ThreadPoolExecutor`.+ - Added `max_workers` configuration parameter (default: 1) to all extractor `extract()` methods, allowing users to tune concurrency based on available CPU cores or API rate limits.+ - **Parallel Chunking**: Implemented parallel processing for large document chunking in `_extract_entities_chunked` and `_extract_relations_chunked`, significantly reducing latency for long-form text analysis.+ - **Thread-Safe Progress Tracking**: Enhanced `ProgressTracker` to handle concurrent updates from multiple threads without race conditions during batch processing.++### Security+- **Secure Caching**:+ - Updated `ExtractionCache` to exclude sensitive parameters (e.g., `api_key`, `token`, `password`) from cache key generation, preventing secret leakage and enabling safe cache sharing.+ - Upgraded cache key hashing algorithm from MD5 to **SHA-256** for enhanced collision resistance and security.++### Performance+- **Bottleneck Optimization (GitHub Issue #186)**:+ - **Resolved Bottleneck #1 (Sequential Processing)**: Replaced sequential `for` loops with parallel execution for both document-level batches and intra-document chunks.+ - **Performance Gains**: Achieved **~1.89x speedup** in real-world extraction scenarios (tested with Groq `llama-3.3-70b-versatile` on standard datasets).+ - **Initialization Optimization**: Refactored test suite to use class-level `setUpClass` for LLM provider initialization, eliminating redundant API client creation overhead.+++## [0.2.1] - 2026-01-12+### Fixed+- **LLM Output Stability (Bug #176)**:+ - Fixed incomplete JSON output issues by correctly propagating `max_tokens` parameter in `extract_relations_llm`.+ - Implemented automatic error handling that halves chunk sizes and retries when LLM context or output limits are exceeded.+ - Fixed `AttributeError` in provider integration by ensuring consistent parameter passing via `**kwargs`.+- **Constraint Relaxations**:+ - Removed hardcoded `max_length` constraints from `Entity`, `Relation`, and `Triplet` classes to support long-form semantic extraction (e.g., long descriptions or names).+ - Fixed orchestrator lazy property initialization and configuration normalization logic in `Orchestrator`.+ - Resolved `AssertionError` in orchestrator tests by aligning test mocks with production component usage.-- Fixed dependency compatibility issues by pinning `protobuf==4.25.8` (Security Fix: Addresses DoS vulnerability) and `grpcio==1.67.1`.++- Fixed dependency compatibility issues by pinning `protobuf>=5.29.1,<7.0` and `grpcio>=1.71.2`.+ - Added missing dependencies `GitPython` and `chardet` to `pyproject.toml`.+ - Verified and aligned `FileObject.text` property usage in GraphRAG notebooks for consistent content decoding.+### Changed+- **Chunking Defaults**:+ - Increased default `max_text_length` for auto-chunking to **64,000 characters** (from 32k/16k) for OpenAI, Anthropic, Gemini, Groq, and DeepSeek providers.+ - Unified chunking logic across `extract_entities_llm`, `extract_relations_llm`, and `extract_triplets_llm`.+- **Groq Support**:+ - Standardized Groq provider defaults to use `llama-3.3-70b-versatile` with a 64k context window.+ - Added native support for `max_tokens` and `max_completion_tokens` to prevent output truncation.++### Added+- **Testing**:+ - Added `tests/reproduce_issue_176.py` to validate `max_tokens` propagation and chunking behavior across all extractors.+++## [0.2.0] - 2026-01-10+### Added+- **Amazon Neptune Support**:+ - Added `AmazonNeptuneStore` providing Amazon Neptune graph database integration via Bolt protocol and OpenCypher.+ - Implemented `NeptuneAuthTokenManager` extending Neo4j AuthManager for AWS IAM SigV4 signing with automatic token refresh.+ - Added robust connection handling: retry logic with backoff for transient errors (signature expired, connection closed) and driver recreation.+ - Added `graph-amazon-neptune` optional dependency group (boto3, neo4j).+ - Comprehensive test suite covering all GraphStore interface methods.+- **Docling Integration**:+ - Added `DoclingParser` in `semantica.parse` for high-fidelity document parsing using the Docling library.+ - Supports multi-format parsing (PDF, DOCX, PPTX, XLSX, HTML, images) with superior table extraction and structure understanding.+ - Implemented as a standalone parser supporting local execution, OCR, and multiple export formats (Markdown, HTML, JSON).+- **Robust Extraction Fallbacks**:+ - Implemented comprehensive fallback chains ("ML/LLM" -> "Pattern" -> "Last Resort") across `NERExtractor`, `RelationExtractor`, and `TripletExtractor` to prevent empty result lists.+ - Added "Last Resort" pattern matching in `NERExtractor` to identify capitalized words as generic entities when all other methods fail.+ - Added "Last Resort" adjacency-based relation extraction in `RelationExtractor` to create weak connections between adjacent entities if no relations are found.+ - Added fallback logic in `TripletExtractor` to convert relations to triplets or use rule-based extraction if standard methods fail.+- **Provenance & Tracking**:+ - Added count tracking to batch processing logs in `NERExtractor`, `RelationExtractor`, and `TripletExtractor`.+ - Added `batch_index` and `document_id` to the metadata of all extracted entities, relations, triplets, semantic roles, and clusters for better traceability.- **Semantic Extract Improvements**:- Introduced `auto-chunking` for long text processing in LLM extraction methods (`extract_entities_llm`, `extract_relations_llm`, `extract_triplets_llm`).- Added `silent_fail` parameter to LLM extraction methods for configurable error handling.