# kinght-code/osintgpt architecture

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

- Interactive diagram: https://gitdiagram.com/kinght-code/osintgpt
- Repository: https://github.com/kinght-code/osintgpt

## Overview

OSINT GPT is a Python toolkit for analyzing text with OpenAI models, generating embeddings, finding semantically similar documents, and storing conversation history or vectors. A typical workflow submits text or a query to the package, which can embed it, search a dataframe or Qdrant, and return ranked results; GPT chat interactions can also be persisted in SQLite. The README documents interactive chat and Qdrant collection/vector management. Some source excerpts are partial, so uncertain implementation wiring is omitted.

Main entry points: [`osintgpt/llms/openai_gpt.py`](https://github.com/kinght-code/osintgpt/blob/main/osintgpt/llms/openai_gpt.py) (GPT interface), [`osintgpt/semantic_operations/operations.py`](https://github.com/kinght-code/osintgpt/blob/main/osintgpt/semantic_operations/operations.py) (Semantic operations), [`osintgpt/embeddings/openai_embeddings.py`](https://github.com/kinght-code/osintgpt/blob/main/osintgpt/embeddings/openai_embeddings.py) (Embedding generator), [`osintgpt/vector_store/qdrant.py`](https://github.com/kinght-code/osintgpt/blob/main/osintgpt/vector_store/qdrant.py) (Qdrant adapter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_analysis["Text analysis"]
  node_gpt["GPT interface<br/>[openai_gpt.py]"]
  node_semantic["Semantic operations<br/>[operations.py]"]
  node_embed["Embedding generator"]
end

subgraph group_vector["Vector search"]
  node_base["Vector engine interface<br/>[base.py]"]
  node_qdrant_adapter["Qdrant adapter<br/>[qdrant.py]"]
  node_dataframe["Document dataframe"]
end

subgraph group_conversation["Chat and storage"]
  node_sql_manager["SQL manager<br/>[sql_manager.py]"]
  node_sqlite[("SQLite database")]
end

subgraph group_services["External services"]
  node_openai["OpenAI API"]
  node_qdrant_service[("Qdrant service")]
end

node_user(("Package user"))

node_user -->|"submits prompts"| node_gpt
node_user -->|"requests search"| node_semantic
node_user -->|"submits text"| node_embed
node_gpt -->|"sends chat requests"| node_openai
node_embed -->|"requests embeddings"| node_openai
node_gpt -->|"embeds query"| node_embed
node_gpt -->|"searches vectors"| node_qdrant_adapter
node_qdrant_adapter -->|"manages and searches"| node_qdrant_service
node_semantic -->|"runs similarity searches"| node_gpt
node_semantic -->|"searches documents"| node_dataframe
node_gpt -->|"persists conversations"| node_sql_manager
node_sql_manager -->|"reads and writes"| node_sqlite

click node_gpt "https://github.com/kinght-code/osintgpt/blob/main/osintgpt/llms/openai_gpt.py"
click node_semantic "https://github.com/kinght-code/osintgpt/blob/main/osintgpt/semantic_operations/operations.py"
click node_embed "https://github.com/kinght-code/osintgpt/blob/main/osintgpt/embeddings/openai_embeddings.py"
click node_base "https://github.com/kinght-code/osintgpt/blob/main/osintgpt/vector_store/base.py"
click node_qdrant_adapter "https://github.com/kinght-code/osintgpt/blob/main/osintgpt/vector_store/qdrant.py"
click node_sql_manager "https://github.com/kinght-code/osintgpt/blob/main/osintgpt/databases/sql_manager.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_gpt,node_semantic,node_embed,node_user toneBlue
class node_base,node_qdrant_adapter,node_dataframe toneAmber
class node_sql_manager,node_sqlite toneMint
class node_openai,node_qdrant_service toneRose
```

## Components

### Text analysis

- [GPT interface](https://github.com/kinght-code/osintgpt/blob/main/osintgpt/llms/openai_gpt.py): `osintgpt/llms/openai_gpt.py`
- [Semantic operations](https://github.com/kinght-code/osintgpt/blob/main/osintgpt/semantic_operations/operations.py): `osintgpt/semantic_operations/operations.py`
- [Embedding generator](https://github.com/kinght-code/osintgpt/blob/main/osintgpt/embeddings/openai_embeddings.py): `osintgpt/embeddings/openai_embeddings.py`

### Vector search

- [Vector engine interface](https://github.com/kinght-code/osintgpt/blob/main/osintgpt/vector_store/base.py): `osintgpt/vector_store/base.py`
- [Qdrant adapter](https://github.com/kinght-code/osintgpt/blob/main/osintgpt/vector_store/qdrant.py): `osintgpt/vector_store/qdrant.py`
- **Document dataframe**

### Chat and storage

- [SQL manager](https://github.com/kinght-code/osintgpt/blob/main/osintgpt/databases/sql_manager.py): `osintgpt/databases/sql_manager.py`
- **SQLite database**

### External services

- **OpenAI API**
- **Qdrant service**

### Other components

- **Package user**

## Connections

- Package user → GPT interface: submits prompts
- Package user → Semantic operations: requests search
- Package user → Embedding generator: submits text
- GPT interface → OpenAI API: sends chat requests
- Embedding generator → OpenAI API: requests embeddings
- GPT interface → Embedding generator: embeds query
- GPT interface → Qdrant adapter: searches vectors
- Qdrant adapter → Qdrant service: manages and searches
- Semantic operations → GPT interface: runs similarity searches
- Semantic operations → Document dataframe: searches documents
- GPT interface → SQL manager: persists conversations
- SQL manager → SQLite database: reads and writes
