How oriserveai/orichain works
Project type and purpose
• Type: This is an open-source Python library (not a full-stack app) designed to simplify Retrieval-Augmented Generation (RAG) workflows.
• Purpose: Provide a unified, asynchronous, and hot-swappable interface for:
• Embedding creation across multiple cloud and local providers
• Vector-database knowledge-base interactions
• Invocation of various LLM endpoints
• Optional language detection
File structure
• Top-level
• .github/workflows/publish.yml – CI/CD pipeline for publishing to PyPI
• docs/ – Sphinx documentation source
• src/orichain/ – Core library code
• pyproject.toml – Build and dependency configuration
• Core modules under src/orichain/
• embeddings/ – Provider-specific embedding clients (OpenAI, AWS Bedrock, GCP Vertex, etc.)
• knowledge_base/ – Vector DB adapters (ChromaDB, Pinecone)
• lang_detect/ – Language‐detection adapter(s)
• llm/ – Provider-specific LLM clients (OpenAI, Anthropic, AWS Bedrock, GCP, Azure)
• Patterns
• Each subpackage implements a common interface (e.g., AsyncEmbeddingModel delegates to openai_embeddings.py when provider="OpenAI")
• Entire codebase is asynchronous and threaded
README for additional insights
• Confirms support matrix (providers & features)
• Shows typical usage: a FastAPI app instantiates three high-level classes: AsyncEmbeddingModel, AsyncKnowledgeBase, AsyncLLM
• Emphasizes hot-swappable components and async/threaded design
Detailed component breakdown (suggested grouping)
• Layer 1: Client App
• Layer 2: Orichain Core
• Embeddings
– AWSBedrockEmbeddings
– OpenAIEmbeddings
– …
• KnowledgeBase
– PineconeKnowledgeBase
– ChromaDBKnowledgeBase
• LLM
– OpenAI_LLM
– AWSBedrock_LLM
– …
• LangDetect (if used)
• Layer 3: External
• AWS Bedrock API
• OpenAI API
• GCP Vertex/Gemini
• Pinecone DB
• ChromaDB
Essentials
• all RAG stages as separate components