# kulkarnishub377/omnisight architecture

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

- Interactive diagram: https://gitdiagram.com/kulkarnishub377/omnisight
- Repository: https://github.com/kulkarnishub377/omnisight

## Overview

OmniSight is a multi-modal incident-intelligence backend. Sensors and operators submit events through the API; events are validated, stored, and processed into incidents. Investigations retrieve document evidence, generate hypotheses and recommended actions, and apply safety checks before results are presented or actions are dispatched. The graph includes the documented ingestion, agent, memory, and action capabilities; some integrations are documented but their runtime wiring is not shown in the excerpts.

Main entry points: [`backend/app/services/agent_service.py`](https://github.com/kulkarnishub377/omnisight/blob/main/backend/app/services/agent_service.py) (Agent Investigation), [`backend/app/main.py`](https://github.com/kulkarnishub377/omnisight/blob/main/backend/app/main.py) (FastAPI Gateway), [`backend/app/services/event_service.py`](https://github.com/kulkarnishub377/omnisight/blob/main/backend/app/services/event_service.py) (Event Ingestion), [`backend/app/routers/events.py`](https://github.com/kulkarnishub377/omnisight/blob/main/backend/app/routers/events.py) (Event Endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingress["API and Ingress"]
  node_api["FastAPI Gateway<br/>[main.py]"]
  node_event_api["Event Endpoints<br/>[events.py]"]
  node_auth["Authentication<br/>[security.py]"]
  node_connectors["Source Connectors"]
end

subgraph group_incident["Events and Incidents"]
  node_event_service["Event Ingestion<br/>[event_service.py]"]
  node_processor["Event Processing<br/>[event_processor.py]"]
  node_incident_api["Incident Endpoints<br/>[incidents.py]"]
  node_database[("Relational Store<br/>[session.py]")]
  node_models["Domain Records<br/>[models.py]"]
end

subgraph group_intelligence["Knowledge and Investigation"]
  node_documents_api["Document Endpoints<br/>[documents.py]"]
  node_documents["Document Ingestion"]
  node_search["Semantic Search<br/>[search_service.py]"]
  node_agent["Agent Investigation<br/>[agent_service.py]"]
end

subgraph group_operations["Actions and Operations"]
  node_actions["Action Execution<br/>[action_service.py]"]
  node_audit["Audit Logging<br/>[audit_service.py]"]
  node_console["Operator Console"]
  node_external_actions["External Action Targets"]
end

node_sensors(("Edge Sensors"))
node_operators(("Operators"))

node_sensors -->|"submit signals"| node_api
node_operators -->|"use API"| node_api
node_api -->|"routes requests"| node_event_api
node_api -->|"routes requests"| node_incident_api
node_api -->|"routes requests"| node_documents_api
node_event_api -->|"ingests events"| node_event_service
node_event_api -->|"checks access"| node_auth
node_incident_api -->|"starts investigation"| node_agent
node_incident_api -->|"checks access"| node_auth
node_documents_api -->|"uploads documents"| node_documents
node_documents_api -->|"searches evidence"| node_search
node_connectors -.->|"provide signals"| node_event_api
node_event_service -->|"processes event"| node_processor
node_event_service -->|"persists event"| node_database
node_processor -.->|"updates state"| node_database
node_agent -->|"retrieves evidence"| node_search
node_documents -->|"indexes chunks"| node_search
node_search -->|"reads chunks"| node_database
node_agent -->|"reads and writes"| node_database
node_event_service -->|"records ingestion"| node_audit
node_documents -->|"records upload"| node_audit
node_agent -->|"records completion"| node_audit
node_agent -.->|"presents findings"| node_console
node_agent -.->|"dispatches approved actions"| node_actions
node_actions -.->|"calls integrations"| node_external_actions

click node_api "https://github.com/kulkarnishub377/omnisight/blob/main/backend/app/main.py"
click node_event_api "https://github.com/kulkarnishub377/omnisight/blob/main/backend/app/routers/events.py"
click node_auth "https://github.com/kulkarnishub377/omnisight/blob/main/backend/app/core/security.py"
click node_connectors "https://github.com/kulkarnishub377/omnisight/tree/main/backend/app/connectors"
click node_event_service "https://github.com/kulkarnishub377/omnisight/blob/main/backend/app/services/event_service.py"
click node_processor "https://github.com/kulkarnishub377/omnisight/blob/main/backend/app/services/event_processor.py"
click node_incident_api "https://github.com/kulkarnishub377/omnisight/blob/main/backend/app/routers/incidents.py"
click node_database "https://github.com/kulkarnishub377/omnisight/blob/main/backend/app/db/session.py"
click node_models "https://github.com/kulkarnishub377/omnisight/blob/main/backend/app/models/models.py"
click node_documents_api "https://github.com/kulkarnishub377/omnisight/blob/main/backend/app/routers/documents.py"
click node_documents "https://github.com/kulkarnishub377/omnisight/blob/main/backend/app/services/document_service.py"
click node_search "https://github.com/kulkarnishub377/omnisight/blob/main/backend/app/services/search_service.py"
click node_agent "https://github.com/kulkarnishub377/omnisight/blob/main/backend/app/services/agent_service.py"
click node_actions "https://github.com/kulkarnishub377/omnisight/blob/main/backend/app/services/action_service.py"
click node_audit "https://github.com/kulkarnishub377/omnisight/blob/main/backend/app/services/audit_service.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_api,node_event_api,node_auth,node_connectors toneBlue
class node_event_service,node_processor,node_incident_api,node_database,node_models toneAmber
class node_documents_api,node_documents,node_search,node_agent toneMint
class node_actions,node_audit,node_console,node_external_actions toneRose
class node_sensors,node_operators toneIndigo
```

## Components

### API and Ingress

- [FastAPI Gateway](https://github.com/kulkarnishub377/omnisight/blob/main/backend/app/main.py): `backend/app/main.py`
- [Event Endpoints](https://github.com/kulkarnishub377/omnisight/blob/main/backend/app/routers/events.py): `backend/app/routers/events.py`
- [Authentication](https://github.com/kulkarnishub377/omnisight/blob/main/backend/app/core/security.py): `backend/app/core/security.py`
- [Source Connectors](https://github.com/kulkarnishub377/omnisight/tree/main/backend/app/connectors): `backend/app/connectors`

### Events and Incidents

- [Event Ingestion](https://github.com/kulkarnishub377/omnisight/blob/main/backend/app/services/event_service.py): `backend/app/services/event_service.py`
- [Event Processing](https://github.com/kulkarnishub377/omnisight/blob/main/backend/app/services/event_processor.py): `backend/app/services/event_processor.py`
- [Incident Endpoints](https://github.com/kulkarnishub377/omnisight/blob/main/backend/app/routers/incidents.py): `backend/app/routers/incidents.py`
- [Relational Store](https://github.com/kulkarnishub377/omnisight/blob/main/backend/app/db/session.py): `backend/app/db/session.py`
- [Domain Records](https://github.com/kulkarnishub377/omnisight/blob/main/backend/app/models/models.py): `backend/app/models/models.py`

### Knowledge and Investigation

- [Document Endpoints](https://github.com/kulkarnishub377/omnisight/blob/main/backend/app/routers/documents.py): `backend/app/routers/documents.py`
- [Document Ingestion](https://github.com/kulkarnishub377/omnisight/blob/main/backend/app/services/document_service.py): `backend/app/services/document_service.py`
- [Semantic Search](https://github.com/kulkarnishub377/omnisight/blob/main/backend/app/services/search_service.py): `backend/app/services/search_service.py`
- [Agent Investigation](https://github.com/kulkarnishub377/omnisight/blob/main/backend/app/services/agent_service.py): `backend/app/services/agent_service.py`

### Actions and Operations

- [Action Execution](https://github.com/kulkarnishub377/omnisight/blob/main/backend/app/services/action_service.py): `backend/app/services/action_service.py`
- [Audit Logging](https://github.com/kulkarnishub377/omnisight/blob/main/backend/app/services/audit_service.py): `backend/app/services/audit_service.py`
- **Operator Console**
- **External Action Targets**

### Other components

- **Edge Sensors**
- **Operators**

## Connections

- Edge Sensors → FastAPI Gateway: submit signals
- Operators → FastAPI Gateway: use API
- FastAPI Gateway → Event Endpoints: routes requests (evidence: `backend/app/main.py`)
- FastAPI Gateway → Incident Endpoints: routes requests (evidence: `backend/app/main.py`)
- FastAPI Gateway → Document Endpoints: routes requests (evidence: `backend/app/main.py`)
- Event Endpoints → Event Ingestion: ingests events (evidence: `backend/app/routers/events.py`)
- Event Endpoints → Authentication: checks access (evidence: `backend/app/routers/events.py`)
- Incident Endpoints → Agent Investigation: starts investigation (evidence: `backend/app/routers/incidents.py`)
- Incident Endpoints → Authentication: checks access (evidence: `backend/app/routers/incidents.py`)
- Document Endpoints → Document Ingestion: uploads documents (evidence: `backend/app/routers/documents.py`)
- Document Endpoints → Semantic Search: searches evidence (evidence: `backend/app/routers/documents.py`)
- Source Connectors → Event Endpoints: provide signals
- Event Ingestion → Event Processing: processes event (evidence: `backend/app/services/event_service.py`)
- Event Ingestion → Relational Store: persists event (evidence: `backend/app/services/event_service.py`)
- Event Processing → Relational Store: updates state
- Agent Investigation → Semantic Search: retrieves evidence (evidence: `backend/app/services/agent_service.py`)
- Document Ingestion → Semantic Search: indexes chunks (evidence: `backend/app/services/document_service.py`)
- Semantic Search → Relational Store: reads chunks (evidence: `backend/app/services/search_service.py`)
- Agent Investigation → Relational Store: reads and writes (evidence: `backend/app/services/agent_service.py`)
- Event Ingestion → Audit Logging: records ingestion (evidence: `backend/app/services/event_service.py`)
- Document Ingestion → Audit Logging: records upload (evidence: `backend/app/services/document_service.py`)
- Agent Investigation → Audit Logging: records completion (evidence: `backend/app/services/agent_service.py`)
- Agent Investigation → Operator Console: presents findings
- Agent Investigation → Action Execution: dispatches approved actions
- Action Execution → External Action Targets: calls integrations
