docs: Add comprehensive messaging and memory lifecycle documentation#41
Merged
docs: Add comprehensive messaging and memory lifecycle documentation#41
Conversation
This commit adds two in-depth technical documentation files that explain the core engines of ContextIQ: the messaging system and the memory lifecycle. Complete guide to the RabbitMQ messaging system including: - RabbitMQ configuration with all environment variables - Core components: RabbitMQClient, MessagePublisher, MessageConsumer - Queue definitions (extraction, consolidation, events, DLQ) - Message flow diagrams showing system interactions - Queue patterns: work queues, event queues, dead letter queues - Publishing and consuming messages with 100+ code examples - RPC pattern with correlation IDs and reply queues - Error handling: retry logic, dead letter queues, message rejection - Reliability features: publisher confirms, persistence, prefetch control - Performance tuning: batch operations, connection pooling, compression - Production deployment: clustering, HA queues, monitoring - Troubleshooting guide with common issues and solutions Complete guide to how memories are created and consolidated including: **The Six Phases**: 1. Session Events Collection - How conversations are captured 2. Memory Extraction - LLM-powered extraction with Anthropic Claude 3. Embedding Generation - OpenAI text-embedding-3-small integration 4. Memory Storage - PostgreSQL and Qdrant vector storage 5. Memory Consolidation - Similarity detection and merging 6. Memory Retrieval - Semantic search and ranking **Key Components**: - MemoryGenerationWorker: Extracts memories from sessions - MemoryGenerationProcessor: Orchestrates extraction pipeline - ExtractionEngine: LLM-powered extraction (Anthropic Claude) - ConsolidationWorker: Merges duplicate memories - ConsolidationProcessor: Orchestrates consolidation pipeline - ConsolidationEngine: Similarity detection and merging **Technical Details**: - Memory categories: preference, fact, goal, habit, relationship, professional, location, temporal - Confidence scoring (0.0-1.0) with filtering - Cosine similarity calculation for consolidation - Merge strategies: highest_confidence, most_recent, longest - Conflict detection for contradictory memories - Confidence boost for merged memories **Documentation Quality**: - End-to-end flow diagrams (ASCII) - Complete data models with examples - 100+ comprehensive code examples - Configuration reference for all settings - Performance considerations and optimization - Monitoring and debugging guides - Production best practices - Comprehensive troubleshooting guide - Added "Technical Deep Dives" section with links to new docs - Added use cases: - "...understand how messaging works" - "...understand how memories are created" Based on implementation from: - shared/messaging/config.py - MessagingSettings - shared/messaging/rabbitmq_client.py - RabbitMQClient - shared/messaging/publisher.py - MessagePublisher - shared/messaging/consumer.py - MessageConsumer - shared/messaging/queues.py - Queue definitions - workers/memory_generation/worker.py - workers/consolidation/worker.py Based on implementation from: - workers/memory_generation/worker.py - MemoryGenerationWorker - workers/memory_generation/processor.py - Pipeline orchestration - shared/extraction/engine.py - ExtractionEngine with LLM - workers/consolidation/worker.py - ConsolidationWorker - workers/consolidation/processor.py - Consolidation pipeline - shared/consolidation/engine.py - Similarity and merging Both documents include: - Comprehensive technical explanations - Real implementation details from codebase - 200+ combined code examples - ASCII diagrams for visual understanding - Complete configuration references - Production-ready best practices - Troubleshooting guides - Cross-references to related documentation Total: 7,529 lines of technical documentation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Add comprehensive documentation explaining the Processing Layer and its relationships to other system components. The Processing Layer sits between Core Services and Storage layers, providing four critical capabilities: - Extraction Engine: LLM-powered fact extraction with Anthropic Claude - Consolidation Engine: Deduplication and conflict resolution - Embedding Service: Vector generation with OpenAI - Revision Tracker: Provenance and history management Documentation includes: - Architecture position and component relationships - Detailed coverage of each engine with code examples - Data flow patterns through the processing layer - Configuration reference for all components - Performance optimization strategies - Production best practices - Monitoring and troubleshooting guidance Updated docs/README.md to include the new guide in Technical Deep Dives section and added a use case for understanding the processing layer. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
5811f7a to
8a05355
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds two comprehensive technical deep dive documentation files that explain the core engines of ContextIQ: the messaging system and the complete memory lifecycle from sessions to consolidated memories.
New Documentation Files
1. docs/MESSAGING.md (3,681 lines, 101KB)
Complete technical guide to the RabbitMQ messaging system including:
Architecture & Configuration:
Core Components:
Message Flows:
Queue Patterns:
Reliability & Performance:
Documentation Quality:
2. docs/MEMORY_LIFECYCLE.md (3,848 lines, 122KB)
Complete technical guide to the memory lifecycle - how ContextIQ transforms sessions into memories:
The Six Phases:
Memory Extraction Pipeline:
Memory Consolidation Pipeline:
Technical Implementation Details:
Documentation Quality:
3. docs/README.md (updated)
Added "Technical Deep Dives" section with:
Added new use cases:
Implementation Coverage
Messaging System Documentation
Based on actual implementation from:
shared/messaging/config.py- MessagingSettings configurationshared/messaging/rabbitmq_client.py- RabbitMQClient implementationshared/messaging/publisher.py- MessagePublishershared/messaging/consumer.py- MessageConsumershared/messaging/queues.py- Queue definitionsworkers/memory_generation/worker.py- Extraction workerworkers/consolidation/worker.py- Consolidation workerMemory Lifecycle Documentation
Based on actual implementation from:
workers/memory_generation/worker.py- MemoryGenerationWorkerworkers/memory_generation/processor.py- Extraction pipelineshared/extraction/engine.py- ExtractionEngine with LLMshared/extraction/prompts.py- LLM prompts and schemasworkers/consolidation/worker.py- ConsolidationWorkerworkers/consolidation/processor.py- Consolidation pipelineshared/consolidation/engine.py- Similarity and merging logicDocumentation Statistics
Key Benefits
Test Plan
Related Documentation
This PR complements PR #40 (Embeddings and Vector Search) and PR #39 (Comprehensive Documentation) to complete the technical documentation suite.
Related docs:
🤖 Generated with Claude Code