Skip to content

Latest commit

 

History

History
140 lines (96 loc) · 2.25 KB

API.md

File metadata and controls

140 lines (96 loc) · 2.25 KB

GraphIntel

Knowledge graph and LLM based system for contextual cyber threat intelligence relevance assessment.

GraphIntel extracts structured CTI from unstructured reports, ingests it into Neo4j, and performs graph-based reasoning to identify reports relevant to a specific organisation.


Features

  • LLM-based CTI extraction from raw text
  • STIX-aligned graph ingestion into Neo4j
  • Multi-hop path discovery between threats and organisations
  • LLM-based path relevance classification
  • Flask REST API
  • Dockerized deployment
  • Optional PostgreSQL persistence for report tracking and analysis

Quickstart

Start the API stack:

docker compose up --build

Services:

Service URL
API http://localhost:8000
Neo4j Browser http://localhost:7474

Example Request

curl -X POST http://localhost:8000/threat_reports \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Example incident report text",
    "url": "https://example.com/report",
    "credibility": 80
  }'

Core Concepts

Text Ingestion

POST /ingest/text

  • Extracts entities and relationships from text
  • Ingests them into Neo4j
  • Does not create a tracked report entry

Use when only graph enrichment is required.


Threat Report Ingestion

POST /threat_reports

  • Creates a persistent report record
  • Extracts and ingests CTI into Neo4j
  • Stores derived paths and relevance analysis

Use when reports need lifecycle tracking and reasoning outputs.


Pipeline

Raw Report
    ↓
LLM Extraction
    ↓
Structured CTI Subgraph
    ↓
Neo4j Graph Merge
    ↓
Path Discovery
    ↓
LLM Path Classification
    ↓
Relevant Threat Paths

Documentation

Resource Location
API reference API.md
UML diagrams system/uml/README.md

Development

Run locally:

cd system

python -m venv .venv
source .venv/bin/activate

pip install -r requirements.txt

flask run

Safety Notes

  • The API is currently unauthenticated
  • Some endpoints are destructive (graph wipe / database wipe)
  • Do not expose publicly without authentication and access control

Tech Stack

  • Flask
  • Neo4j
  • PostgreSQL
  • Docker Compose
  • OpenAI-compatible LLM APIs
  • Pydantic
  • STIX 2.1