RCP/IRCP Architecture Status & Usage Map
You have **3 related but distinct systems** in your codebase: 1. **RCP (Reply Chain Protocol)** - Conversation management system โ **ACTIVELY USED** 2. **IRCP (Inverse-Ring Context Propagation)** - Advanced ML framework โ ๏ธ **PARTIALLY USED** 3. **TPO (Topological Preference Optimization)** - Preference learning ๐ **IN DEVELOPMENT**
Full Public Reader
RCP/IRCP Architecture Status & Usage Map
Executive Summary
You have 3 related but distinct systems in your codebase:
1. RCP (Reply Chain Protocol) - Conversation management system โ
ACTIVELY USED
2. IRCP (Inverse-Ring Context Propagation) - Advanced ML framework โ ๏ธ PARTIALLY USED
3. TPO (Topological Preference Optimization) - Preference learning ๐ IN DEVELOPMENT
The confusion arises because: IRCP is a research/ML system while RCP is the production conversation system, but they both work with "chains" and "coordinates" in different ways.
---
1. RCP (Reply Chain Protocol) - Production System
### Purpose
Conversation management and reply chain construction for the DLM system.
### Where It's Used
โ
ACTIVELY USED in production:
Primary Location: `packages/dlm/response/`
- `system.py` - `ReplyChainSystem` class (1,520 lines) - MAIN ENTRY POINT
- `builder.py` - `ReplyChainBuilder` - Constructs chain trees
- `director.py` - `ReplyChainDirector` - Orchestrates construction
- `links.py` - `ChainTreeLink` - Data structures
What It Does:
1. Manages conversation history as linked chains
2. Propagates context bidirectionally (forward & inverse rings)
3. Tracks attention weights across conversation
4. Adapts responses based on user patterns
5. Truncates history to fit token limits
Real Usage Example:
# From dlm/response/system.py
from dlm.response import ReplyChainSystem
system = ReplyChainSystem(name="LinearAlgebra", verbose=True)
system.process_conversations(conversation_data)
# Build reply chain for new input
reply_chain = system.construct_reply_chain(
user_input="Tell me more about vector spaces",
max_history_length=5
)Status: โ PRODUCTION - ACTIVELY USED
---
2. IRCP (Inverse-Ring Context Propagation) - ML Framework
### Purpose
Advanced machine learning framework for conversation understanding using topological coordinates.
Where It's Located
Primary Packages:
- `packages/ircp/` - Full ML framework (separate package)
- `packages/dlm/inference/ircp/` - Integration utilities (just created in refactoring)
- `integration/advanced_tpo_ircp_bridge.py` - TPO-IRCP bridge
What It's Supposed To Do:
1. Predict IRCP coordinates (x, y, z, t) for messages
- x: Intent depth
- y: Branching/alternatives
- z: Consistency
- t: Temporal flow
2. Train ML models to understand conversation structure
3. Enhance similarity using coordinate proximity
4. Integrate with TPO for preference learning
Current Status: โ ๏ธ PARTIALLY IMPLEMENTED
What EXISTS:
packages/ircp/
โโโ models/
โ โโโ sentence_transformer_icp.py โ
Model architecture exists
โโโ core/
โ โโโ base_models.py โ
Data structures defined
โ โโโ inverse_attention.py โ
Attention mechanism
โ โโโ measure_theory.py โ
Mathematical framework
โ โโโ ring_topology.py โ
Topology implementation
โโโ training/
โ โโโ prepare_sentence_transformer_data.py โ
Just created!
โ โโโ train_sentence_transformer.py โ
Just created!
โโโ main.py โ
Entry point existsWhat's PARTIALLY USED:
1. In `dlm/inference/artificial.py`:
# Lines 1207-1492: semantic_similarity_cosine()
# Uses IRCP coordinates for enhanced similarity IF available
if use_ircp_coordinates and hasattr(self, "reply_chain_builder"):
chain_tree = self.reply_chain_builder.get_result()
# Calculate attention-based similarity
# Use coordinate proximity
# Apply temporal weightingStatus: โ ๏ธ Code exists but `reply_chain_builder` often None
2. In `dlm/engine/ircp_embedder.py`:
class IRCPEmbeddingEngine:
# Loads trained IRCP model
# Generates embeddings using fine-tuned sentence transformerStatus: โ ๏ธ DEPRECATED - Should use `dlm.core.embeddings.IRCPEmbedder`
3. In `dlm/inference/ircp/` (just created during refactoring):
# integration.py - Helper functions
# metrics.py - Metric extractionStatus: โ NEW - Not yet integrated into production
What's NOT USED YET:
โ Training pipeline - Models not trained on your data yet
โ Coordinate prediction - No trained models deployed
โ Full I-RCP integration - Mostly theoretical/placeholder code
โ TPO-IRCP bridge - Integration code exists but not in production flow
---
3. Empty/Placeholder Directories
`packages/rcp/intelligence/`
intelligence/
โโโ similarity_engine/ โ EMPTY (just __init__.py)
โโโ clustering_engine/ โ EMPTY (just __init__.py)
โโโ retrieval_engine/ โ EMPTY (just __init__.py)Purpose (from README): AI/ML components for similarity, clustering, retrieval
Status: โ PLACEHOLDER - NOT IMPLEMENTED
Why: Planned architecture that was never built out
`packages/rcp/interfaces/`
interfaces/
โโโ query_interface/ โ EMPTY (just __init__.py)
โโโ response_builder/ โ EMPTY (just __init__.py)Purpose (from README): User interfaces for queries and responses
Status: โ PLACEHOLDER - NOT IMPLEMENTED
Why: Planned architecture that was never built out
`packages/rcp/system/`
ls packages/rcp/system/
# Returns: Directory not found or emptyPurpose (from README): Core system with:
- `knowledge_base/unified_knowledge_system.py`
- `message_consolidation/cross_conversation_consolidator.py`
- `context_assembly/dynamic_context_builder.py`
- `continuous_learning/knowledge_evolution_engine.py`
Status: โ COMPLETELY MISSING
Why: Architectural plan that was documented but never implemented
---
4. What Actually Works Right Now
โ Production Systems:
1. RCP Reply Chain System (`dlm/response/`)
- Manages conversations
- Builds reply chains
- Used by DLM for conversation flow
2. DLM Core (`dlm/core/`, `dlm/engine/`)
- Database loading
- Embeddings
- Retrieval
- Search
3. Basic TPO (`tpo/`)
- Training data generation
- Preference pairs
- TPO loss functions
โ ๏ธ Partially Working:
1. IRCP Models (`ircp/models/`)
- Architecture exists
- Not trained on your data
- Not integrated into production
2. IRCP Similarity (`dlm/inference/artificial.py`)
- Code exists for IRCP-enhanced similarity
- Falls back to basic similarity when IRCP unavailable
โ Not Implemented:
1. RCP Intelligence Engines - Empty placeholders
2. RCP System Architecture - Documented but not built
3. RCP Interfaces - Empty placeholders
4. Full IRCP Integration - Theoretical code not in production
5. Context Assembly System - Planned but not built
6. Continual Learning - Planned but not built
---
5. Where RCP/IRCP Is Actually Used
Actual Usage Points:
# 1. dlm/response/system.py - ReplyChainSystem
# โ
PRODUCTION USE
system = ReplyChainSystem(name="LinearAlgebra")
system.process_conversations(data)
result = system.construct_reply_chain(user_input)
# 2. dlm/inference/artificial.py - semantic_similarity_cosine()
# โ ๏ธ CONDITIONAL USE (falls back if IRCP unavailable)
similarity = ai.semantic_similarity_cosine(
text1, text2,
use_ircp_coordinates=True # Only works if reply_chain_builder exists
)
# 3. dlm/engine/ircp_embedder.py - IRCPEmbeddingEngine
# โ ๏ธ DEPRECATED (warning emitted)
embedder = IRCPEmbeddingEngine(model_path="...")
embeddings = embedder.generate_embedding(text)
# 4. dlm/response/builder.py - ReplyChainBuilder
# โ
USED BY ReplyChainSystem
builder = ReplyChainBuilder(...)
chain_tree = builder.get_result()---
6. Recommended Actions
Immediate (To Clean Up Confusion):
1. Document What's Actually Used:
# Create usage map
docs/PRODUCTION_ARCHITECTURE.md # What's actually running
docs/RESEARCH_PROTOTYPES.md # What's experimental
docs/PLANNED_FEATURES.md # What's documented but not built2. Remove or Archive Empty Directories:
# Either implement or remove:
packages/rcp/intelligence/ # Empty
packages/rcp/interfaces/ # Empty
packages/rcp/system/ # Missing3. Fix Deprecation Warnings:
# Replace deprecated IRCP embedder usage
# Use dlm.core.embeddings.IRCPEmbedder insteadShort-Term (To Make IRCP Functional):
4. Train IRCP Models:
# Use the training scripts we just created
./scripts/train_ircp_sentence_transformer.sh your_database.db5. Integrate Trained Models:
# Update config to use trained IRCP embeddings
config = {
"model_name": "./models/ircp_sentence_transformer",
"freeze_encoder": False,
}6. Connect IRCP to RCP:
# Make reply_chain_builder actually use IRCP coordinates
# Currently it's often NoneLong-Term (To Build Planned Features):
7. Implement RCP System Architecture:
- Build `system/knowledge_base/`
- Build `system/message_consolidation/`
- Build `system/context_assembly/`
- Build `system/continuous_learning/`
8. Build Intelligence Engines:
- `intelligence/similarity_engine/`
- `intelligence/clustering_engine/`
- `intelligence/retrieval_engine/`
9. Build User Interfaces:
- `interfaces/query_interface/`
- `interfaces/response_builder/`
---
7. Key Insights
### What RCP Is:
A production conversation management system that builds reply chains from conversation history.
### What IRCP Is:
A research ML framework for predicting conversation coordinates and enhancing similarity with topological understanding.
### The Disconnect:
- RCP is used in production (dlm/response/)
- IRCP has infrastructure but no trained models
- RCP System (packages/rcp/system/) was planned but never built
- Intelligence/Interfaces are empty placeholders
### The Reality:
You have two separate packages:
1. `packages/rcp/` - Mostly empty, architectural plans
2. `packages/dlm/response/` - Actual working RCP implementation
They should probably be consolidated or one should be removed.
---
8. Decision Matrix
| Component | Status | Action Needed |
|---|---|---|
| RCP (dlm/response/) | โ Working | Keep, document better |
| IRCP Models | โ ๏ธ Exists, not trained | Train using new scripts |
| RCP Intelligence | โ Empty | Remove or implement |
| RCP Interfaces | โ Empty | Remove or implement |
| RCP System | โ Missing | Remove README or implement |
| IRCP Integration | โ ๏ธ Partial | Complete integration |
| TPO-IRCP Bridge | โ ๏ธ Theoretical | Test and validate |
---
Summary
What you actually have:
- โ
Working RCP conversation system in `dlm/response/`
- โ ๏ธ IRCP ML framework with untrained models
- โ Lots of planned architecture that was never built
What you should do:
1. Train IRCP models with the new scripts
2. Remove or implement empty RCP directories
3. Consolidate RCP implementations (dlm/response vs packages/rcp)
4. Document what's production vs research vs planned
Bottom line: You have a solid foundation, but there's confusion between:
- What's implemented vs documented
- What's production vs research
- What's RCP (conversation) vs IRCP (ML coordinates)
Would you like me to create a cleanup plan or help integrate the IRCP training pipeline into your production flow?
Promotion Decision
Promote into a technical note or architecture paper with implementation anchors.
Source Anchor
Comp-Core/backend/cc-trajectory/legacy/cc-tpo-original/cc-tpo/docs/RCP_IRCP_ARCHITECTURE_STATUS.md
Detected Structure
Method ยท Evaluation ยท Code Anchors ยท Architecture