# bhagyesh-074/oasis architecture

> Architecture diagram of the GitHub repository bhagyesh-074/oasis, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bhagyesh-074/oasis
- Repository: https://github.com/bhagyesh-074/oasis

## Overview

OASIS is a framework-agnostic supervisory layer for agent teams. Its documented workflow sizes a team from task complexity, reduces it to fit a run budget, executes it through a framework adapter, enforces budgets on model calls, and supports agent replacement; runtime model-call records and automated decisions provide observability. The README also identifies retrieval/context management, runtime verification, and evaluation as product capabilities. Several of these modules were not sampled, so their presence is shown without inferred call paths; edges reflect only shown code references or README statements.

Main entry points: [`src/oasis/adapters/base.py`](https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/adapters/base.py) (Adapter contract), [`src/oasis/gateway/litellm_hooks.py`](https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/gateway/litellm_hooks.py) (LLM gateway), [`src/oasis/rbe/admission.py`](https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/rbe/admission.py) (Call admission), [`src/oasis/eval/runner.py`](https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/eval/runner.py) (Evaluation runner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_planning["Team planning"]
  node_tce["Task complexity<br/>[heuristic.py]"]
  node_planner["Team planner<br/>[llm_planner.py]"]
  node_reducer["Team reducer<br/>[reducer.py]"]
end

subgraph group_runtime["Execution and control"]
  node_budget["Budget model<br/>[budget.py]"]
  node_admission["Call admission<br/>[admission.py]"]
  node_gateway["LLM gateway<br/>[litellm_hooks.py]"]
  node_adapters["Adapter contract<br/>[base.py]"]
  node_langgraph["LangGraph adapter"]
  node_autogen["AutoGen adapter<br/>[autogen_adapter.py]"]
  node_crewai["CrewAI adapter stub<br/>[crewai_stub.py]"]
  node_replacement["Agent replacement<br/>[engine.py]"]
  node_fake["Scripted LLM<br/>[fake_llm.py]"]
  node_hash["Prompt hashing<br/>[_hash.py]"]
  node_sink["Request log<br/>[jsonl_sink.py]"]
end

subgraph group_insight["Context and verification"]
  node_cm["Context retrieval<br/>[retrieval.py]"]
  node_rtpm["Runtime verification<br/>[l1_embed.py]"]
  node_decision["Decision logging"]
  node_store[("Context store<br/>[store.py]")]
end

subgraph group_evaluation["Evaluation"]
  node_eval["Evaluation runner<br/>[runner.py]"]
  node_oracle["Oracle sweep<br/>[oracle_sweep.py]"]
  node_stats["Evaluation statistics<br/>[stats.py]"]
end

subgraph group_service["API and records"]
  node_api["OASIS API<br/>[app.py]"]
  node_db[("Application database<br/>[models.py]")]
end

node_user(("Run initiator"))

node_user -.->|"submits run"| node_api
node_api -.->|"serves runs"| node_eval
node_tce -.->|"guides sizing"| node_planner
node_planner -.->|"proposes team"| node_reducer
node_budget -->|"constrains team"| node_reducer
node_reducer -->|"logs decisions"| node_decision
node_gateway -->|"checks calls"| node_admission
node_admission -->|"checks limits"| node_budget
node_admission -->|"logs decisions"| node_decision
node_adapters -->|"implemented by"| node_langgraph
node_adapters -->|"implemented by"| node_autogen
node_adapters -->|"stub adapter"| node_crewai
node_adapters -.->|"supports replacement"| node_replacement
node_gateway -->|"writes records"| node_sink
node_gateway -.->|"supports replay"| node_fake
node_fake -->|"hashes requests"| node_hash
node_cm -.->|"retrieves context"| node_store
node_eval -.->|"sweeps outcomes"| node_oracle
node_eval -.->|"summarizes results"| node_stats
node_api -.->|"uses records"| node_db

click node_api "https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/api/app.py"
click node_tce "https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/tce/heuristic.py"
click node_planner "https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/tce/llm_planner.py"
click node_budget "https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/rbe/budget.py"
click node_reducer "https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/rbe/reducer.py"
click node_admission "https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/rbe/admission.py"
click node_gateway "https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/gateway/litellm_hooks.py"
click node_adapters "https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/adapters/base.py"
click node_langgraph "https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/adapters/langgraph_adapter.py"
click node_autogen "https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/adapters/autogen_adapter.py"
click node_crewai "https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/adapters/crewai_stub.py"
click node_replacement "https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/replacement/engine.py"
click node_fake "https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/gateway/fake_llm.py"
click node_hash "https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/gateway/_hash.py"
click node_sink "https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/gateway/jsonl_sink.py"
click node_cm "https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/cm/retrieval.py"
click node_rtpm "https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/rtpm/l1_embed.py"
click node_decision "https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/rbe/decision_log_client.py"
click node_store "https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/cm/store.py"
click node_eval "https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/eval/runner.py"
click node_oracle "https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/eval/oracle_sweep.py"
click node_stats "https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/eval/stats.py"
click node_db "https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/db/models.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_tce,node_planner,node_reducer toneBlue
class node_budget,node_admission,node_gateway,node_adapters,node_langgraph,node_autogen,node_crewai,node_replacement,node_fake,node_hash,node_sink toneAmber
class node_cm,node_rtpm,node_decision,node_store toneMint
class node_eval,node_oracle,node_stats toneRose
class node_api,node_db,node_user toneIndigo
```

## Components

### Team planning

- [Task complexity](https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/tce/heuristic.py): `src/oasis/tce/heuristic.py`
- [Team planner](https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/tce/llm_planner.py): `src/oasis/tce/llm_planner.py`
- [Team reducer](https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/rbe/reducer.py): `src/oasis/rbe/reducer.py`

### Execution and control

- [Budget model](https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/rbe/budget.py): `src/oasis/rbe/budget.py`
- [Call admission](https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/rbe/admission.py): `src/oasis/rbe/admission.py`
- [LLM gateway](https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/gateway/litellm_hooks.py): `src/oasis/gateway/litellm_hooks.py`
- [Adapter contract](https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/adapters/base.py): `src/oasis/adapters/base.py`
- [LangGraph adapter](https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/adapters/langgraph_adapter.py): `src/oasis/adapters/langgraph_adapter.py`
- [AutoGen adapter](https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/adapters/autogen_adapter.py): `src/oasis/adapters/autogen_adapter.py`
- [CrewAI adapter stub](https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/adapters/crewai_stub.py): `src/oasis/adapters/crewai_stub.py`
- [Agent replacement](https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/replacement/engine.py): `src/oasis/replacement/engine.py`
- [Scripted LLM](https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/gateway/fake_llm.py): `src/oasis/gateway/fake_llm.py`
- [Prompt hashing](https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/gateway/_hash.py): `src/oasis/gateway/_hash.py`
- [Request log](https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/gateway/jsonl_sink.py): `src/oasis/gateway/jsonl_sink.py`

### Context and verification

- [Context retrieval](https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/cm/retrieval.py): `src/oasis/cm/retrieval.py`
- [Runtime verification](https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/rtpm/l1_embed.py): `src/oasis/rtpm/l1_embed.py`
- [Decision logging](https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/rbe/decision_log_client.py): `src/oasis/rbe/decision_log_client.py`
- [Context store](https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/cm/store.py): `src/oasis/cm/store.py`

### Evaluation

- [Evaluation runner](https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/eval/runner.py): `src/oasis/eval/runner.py`
- [Oracle sweep](https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/eval/oracle_sweep.py): `src/oasis/eval/oracle_sweep.py`
- [Evaluation statistics](https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/eval/stats.py): `src/oasis/eval/stats.py`

### API and records

- [OASIS API](https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/api/app.py): `src/oasis/api/app.py`
- [Application database](https://github.com/bhagyesh-074/oasis/blob/main/src/oasis/db/models.py): `src/oasis/db/models.py`

### Other components

- **Run initiator**

## Connections

- Run initiator → OASIS API: submits run (evidence: `README.md`)
- OASIS API → Evaluation runner: serves runs
- Task complexity → Team planner: guides sizing (evidence: `README.md`)
- Team planner → Team reducer: proposes team (evidence: `README.md`)
- Budget model → Team reducer: constrains team (evidence: `src/oasis/rbe/reducer.py`)
- Team reducer → Decision logging: logs decisions (evidence: `src/oasis/rbe/reducer.py`)
- LLM gateway → Call admission: checks calls (evidence: `src/oasis/gateway/litellm_hooks.py`)
- Call admission → Budget model: checks limits (evidence: `src/oasis/rbe/admission.py`)
- Call admission → Decision logging: logs decisions (evidence: `src/oasis/rbe/admission.py`)
- Adapter contract → LangGraph adapter: implemented by (evidence: `src/oasis/adapters/langgraph_adapter.py`)
- Adapter contract → AutoGen adapter: implemented by (evidence: `src/oasis/adapters/autogen_adapter.py`)
- Adapter contract → CrewAI adapter stub: stub adapter (evidence: `src/oasis/adapters/crewai_stub.py`)
- Adapter contract → Agent replacement: supports replacement (evidence: `README.md`)
- LLM gateway → Request log: writes records (evidence: `src/oasis/gateway/litellm_hooks.py`)
- LLM gateway → Scripted LLM: supports replay (evidence: `README.md`)
- Scripted LLM → Prompt hashing: hashes requests (evidence: `src/oasis/gateway/fake_llm.py`)
- Context retrieval → Context store: retrieves context
- Evaluation runner → Oracle sweep: sweeps outcomes
- Evaluation runner → Evaluation statistics: summarizes results
- OASIS API → Application database: uses records
