Parallel Retrieval Orchestrator

U

@

·

Build a parallel retrieval orchestrator with concurrent source queries, timeout handling, fallback chains, and circuit breakers.

98 copies0 forks
Build a parallel retrieval orchestrator for multi-source search.

## Retrieval Sources
{{retrieval_sources}}

## Orchestration Requirements
{{orchestration_requirements}}

## SLA Constraints
- Max latency: {{max_latency}}ms
- Timeout policy: {{timeout_policy}}

Implement orchestration:

```python
class ParallelRetrievalOrchestrator:
    def __init__(self, retrievers: Dict[str, Retriever], timeout_ms: int):
        pass
    
    async def retrieve_parallel(self, query: str, sources: List[str]) -> Dict[str, List[Result]]:
        """
        Execute retrievals in parallel:
        - Concurrent source queries
        - Timeout handling per source
        - Partial result aggregation
        """
        pass
    
    async def retrieve_with_fallback(self, query: str) -> List[Result]:
        """
        Fallback chain:
        - Primary sources
        - Secondary on failure
        - Degraded mode
        """
        pass
```

Include:
- AsyncIO implementation
- Circuit breaker per source
- Latency tracking
- Result merging strategies

Details

Category

Coding

Use Cases

Parallel retrievalMulti-source searchAsync orchestration

Works Best With

claude-sonnet-4-20250514gpt-4o
Created Shared

Create your own prompt vault and start sharing