Inspiration

In tactical drug enforcement operations led by agencies like the National Drug Law Enforcement Agency (NDLEA), operational teams frequently deploy to remote border corridors, maritime access points, and deep rural sectors. In these environments, standard digital infrastructure completely collapses—there is either a total absence of cellular connectivity or highly unstable, narrow network bands.

Furthermore, traditional cloud-based Artificial Intelligence options pose severe national security risks: transmitting sensitive operational intelligence, suspect profiles, checkpoint locations, and drug seizure logs through third-party commercial web APIs introduces high-risk vectors for interception or external surveillance.

The inspiration for this project was born out of a critical mission: to build an air-gapped, infrastructure-independent computing layer that provides on-the-ground officers with instantaneous legal reference and data-secure incident tracking, proving that high-grade AI can be executed locally without a single byte of active internet telemetry.

What it does

The NDLEA Secure Operational Assistant is a ruggedized, fully decentralized software architecture engineered to operate at the extreme edge. Running entirely within local hardware constraints—specifically optimized for standard 8 GB RAM terminal profiles—the system provides a split-screen analytical hub that gives field officers two core disconnected capabilities:

  1. Legal & Field Guide Framework (RAG): Real-time legal and operational query processing directly out of raw PDF manuals or statutory frameworks. By feeding operational queries into an isolated local context matrix, the application delivers instant analytical cross-referencing without external data network handshakes.
  2. Secure Offline Incident Logger: A secure, structural database that registers incident intelligence and seizure metrics onto the laptop's local hard drive. It utilizes parameterized schema execution to guarantee physical data containment and protection.

How we built it

The application bypasses the traditional client-server architecture, consolidating text extraction, high-dimensional vector math, and large-language-model inference into a unified runtime environment on standard field hardware. The architecture is built across two specialized, concurrent execution pipelines:

A. The Document Ingestion & Local Vector Retrieval Framework

When an official binary file (e.g., the NDLEA Act) is placed inside the directory, text extraction is managed locally on disk via a PyPDFLoader pipeline. To ensure deep semantic parsing without causing CPU memory exhaustion, raw text strings are sliced using a RecursiveCharacterTextSplitter under strict contextual constraints:

$$\text{Chunk Size} = 500 \text{ characters}$$

$$\text{Chunk Overlap} = 50 \text{ characters}$$

These fragments are converted into spatial vector coordinates using a 40 MB offline transformer model (all-MiniLM-L6-v2) and saved directly into a localized, persistent instance of ChromaDB on the laptop's physical drive.

B. Localized Inference & The Relational Ledger

Natural language queries are answered using the Ollama framework running a 3.8-billion parameter small language model (phi3). The model's sampling configuration is systematically restricted to a flat execution space where (\text{Temperature} = 0.1) to eliminate hallucinations. Adjacent to this, a secure, lightweight relational database (SQLite3) captures field parameters through parameterized schema mutations, printing real-time data logs into a clean, intuitive Streamlit split-screen dashboard.

Challenges we ran into

Building an infrastructure-grade AI application inside strict edge hardware boundaries introduced unique engineering challenges:

  1. The RAM Threshold Constraint & Vector Failures: Initially, utilizing a unified Ollama wrapper to process text string embeddings resulted in severe memory bottlenecks and returned empty lists during matrix upserts on Windows. This was overcome by isolating the workflows—swapping out the heavy LLM-based vectorizer for the lightweight, dedicated HuggingFace sentence-transformer model (all-MiniLM-L6-v2), which brought the system's memory overhead well within safe hardware boundaries.
  2. The Environment Path (PATH) Blockade: On standard Windows terminal profiles, native execution of isolated scripts often leads to cmdlet recognition failures (e.g., Windows being unable to find pip or streamlit on its own due to unchecked path variables). This roadblock was engineered around by utilizing explicit Python interpreter module hooks (python -m pip and python -m streamlit), which permanently bypassed path constraints without requiring manual registry configuration by an end-user in the field.
  3. Preventing Hallucinations in Legal Queries: Standard language model behavior tends to lean toward creative generation. Because legal and operational safety bounds require absolute certainty, any speculative answer can compromise an enforcement operation. This was mitigated by enforcing a strict low-temperature ceiling coupled with strict systemic prompts that order the model to refuse an answer if the mathematical context within the local database chunks does not explicitly support it.

Accomplishments that we're proud of

We successfully cracked the baseline code for an infrastructure-grade, completely air-gapped system. We are incredibly proud to show a system that performs deep linguistic context matching and executes safe relational database updates completely in memory and disk on a standard consumer laptop without a network connection. We proved that data sovereignty and automated intelligence can coexist seamlessly in high-risk environments.

What we learned

  1. The Power of Small Language Models (SLMs): Prior to building this, the common consensus was that heavy, multi-billion parameter cloud configurations were necessary for logical reasoning. This project proved that highly compressed, specialized models like Phi-3, when properly isolated and anchored by a solid RAG architecture, deliver elite analytical accuracy while operating effortlessly on low-compute processors.
  2. True Data Sovereignty is Achievable: Security infrastructure doesn't need to choose between intelligence and data protection. By maintaining an uncompromised air-gapped system design, public-sector applications can leverage automated parsing and secure logging with absolute immunity against cloud surveillance or network dropouts.

What's next for NDLEA Secure Operational Assistant

The next evolutionary milestone is building local data synchronization capabilities. When a field terminal re-enters an environment with a secure, official agency server mesh, the local SQLite3 delta logs should automatically run a localized cryptographic sync to update central databases without human intervention. We also plan to optimize quantization methods to run the inference models smoothly on lightweight, ruggedized mobile field tablets.

Built With

Share this project:

Updates