The Agentic Business Operating System
Chat, automate, and query your business data with a single, intelligent platform.
MiraOS is built with a decoupled architecture designed for scale and agentic autonomy.
graph TD
User((User)) -->|Natural Language| Frontend[Frontend: React/Vite]
Frontend -->|REST API| Backend[Backend: FastAPI]
subgraph "NL2SQL Engine"
Backend --> Service[NL2SQL Service]
Service --> Agent[Agentic Loop]
Agent -->|Thought-Action| Tools[Schema/Join/Data Tools]
Tools -->|Metadata| MongoDB[(MongoDB)]
Agent -->|Execute| Engine[Execution Engine]
Engine -->|Query| Postgres[(Business DB: Postgres)]
end
subgraph "Indexing Pipeline"
Backend -->|Trigger| Celery[Celery Worker]
Celery -->|Crawl| Discovery[Discovery Service]
Discovery -->|Schema| MongoDB
Discovery -->|Enrich| LLM[LLM: Ollama]
LLM -->|Descriptions| MongoDB
end
Backend -->|Cache/Queue| Redis[(Redis)]
Unlike traditional text-to-SQL systems, MiraOS uses a Thought-Action-Observation loop:
- Thought: The agent reasons about the user's question and what schema info it needs.
- Action: It uses tools to fetch relevant table schemas, find join paths, or sample data.
- Observation: It analyzes the tool output to refine its understanding or generate the final SQL.
- Self-Correction: If the SQL fails, the agent receives the error and attempts to fix it.
To handle complex schemas, MiraOS implements a multi-stage indexing pipeline:
- Stage 1: Crawl: Rapidly extracts tables, columns, types, and foreign key constraints.
- Stage 2: Enrich: Uses LLMs to generate semantic descriptions for every table based on sample data.
- Stage 3: Graph Construction: Builds a
NetworkXrelation graph for real-time join path discovery. - Stage 4: Embed (WIP): Generates vector embeddings for semantic table retrieval.
| Layer | Technology |
|---|---|
| Frontend | React, Vite, TypeScript, TailwindCSS |
| Backend | FastAPI (Python 3.11+), Pydantic |
| Task Queue | Celery + Redis |
| Databases | MongoDB (Metadata/State), Postgres (Business Data) |
| AI/LLM | Ollama (qwen3:4b), LangChain/Custom Agent |
- Docker & Docker Compose
- Ollama (running locally with
qwen3:4bpulled)
# Clone the repository
git clone https://github.com/smithagon/miraos.git
cd miraos
# Start all services
docker compose up --build- Frontend → http://localhost:3001
- Backend API → http://localhost:8000
mira/
├── frontend/ # React/Vite TypeScript app
├── fastapi-backend/ # Python FastAPI server
│ ├── core/ # Database & App config
│ ├── services/ # NL2SQL, LLM, and Indexing services
│ └── routes/ # API Endpoints
└── docker-compose.yml # Orchestration
