Skip to content

Architecture

ContextUnity is a service mesh of modular Python services communicating over gRPC. Each service has a single responsibility and shares types through ContextCore.

Ecosystem Map

architecture-ecosystem

Communication Pattern

All inter-service communication uses the ContextUnit protocol. Every RPC call carries a typed Pydantic envelope with:

  • Payload — domain-specific data (google.protobuf.Struct)
  • Provenance — ordered trace of processing stages
  • Security — scopes for access control
  • Tracingtrace_id and parent_unit_id for distributed observability

architecture-sequence

Service Roles

ServiceRoleProtocolLicense
ContextCoreShared kernel — types, protos, tokens, configdependencyApache 2.0
ContextRouterAgent orchestration — LangGraph, tool dispatchgRPC serverApache 2.0
ContextBrainKnowledge — vectors, memory, taxonomy, RAGgRPC serverApache 2.0
ContextWorkerWorkflows — Temporal, schedules, agentsgRPC serverApache 2.0
ContextShieldSecurity — token signing, prompt filteringgRPC serverCommercial
ContextZeroPrivacy — PII masking, persona enginemiddlewareCommercial
ContextCommerceE-commerce — PIM, product matching, enrichmentDjango appCommercial
ContextViewObservability — dashboard, traces, adminDjango appCommercial

Technology Stack

  • Language: Python 3.13+
  • Inter-service: gRPC with Protocol Buffers
  • Agent Framework: LangGraph (LangChain)
  • Database: PostgreSQL 16+ with pgvector and ltree extensions
  • Task Engine: Temporal.io
  • LLM Providers: OpenAI, Anthropic Claude, Google Vertex AI, Groq, Perplexity
  • Package Management: uv
  • Configuration: Pydantic BaseModel with load_shared_config_from_env()