# harishsg993010/hawkinsdb architecture

> Architecture diagram of the GitHub repository harishsg993010/hawkinsdb, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/harishsg993010/hawkinsdb
- Repository: https://github.com/harishsg993010/hawkinsdb

## Overview

##### Main Components

a) Core System Components:
- HawkinsDB Core Engine
- Memory Management System
- LLM Interface Layer
- Storage Backend
- Enrichment System

b) Memory Types Layer:
- Semantic Memory
- Episodic Memory
- Procedural Memory

##### Specific Component Details

a) Client Interface Layer:
- LLM Interface connection
- OpenAI API integration point

b) Core Processing Layer:
- Reference Frames Manager
- Cortical Columns Processor
- Query Processing Engine

c) Memory Management Layer:
- Three distinct memory type handlers
- Memory routing system
- Context management

d) Storage Layer:
- SQLite Backend
- JSON Storage Option
- Connection pooling

e) Integration Layer:
- ConceptNet Integration
- External LLM Services
- RAG Integration Points

##### Important Elements to Highlight

a) Key Features:
- Reference Frames system
- Cortical Columns architecture
- Memory type separation
- Knowledge enrichment pipeline

b) Integration Points:
- OpenAI API connection
- ConceptNet integration
- Storage backend options

##### Specific Implementation Notes

- Relationship between hawkinsdb/core.py and other components
- How enrichment.py interfaces with external services
- Demonstrate the storage abstraction layer
- Type system (types.py)

##### Component Relationships

- LLM interface and core processing
- Storage backend and memory management
- Enrichment system and external services
- Query processing and memory types

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and Classes
    classDef core fill:#2196F3,stroke:#1565C0,color:white
    classDef storage fill:#4CAF50,stroke:#2E7D32,color:white
    classDef external fill:#FF9800,stroke:#EF6C00,color:white
    classDef memory fill:#9C27B0,stroke:#6A1B9A,color:white
    classDef client fill:#FDD835,stroke:#F9A825,color:black
    classDef planned fill:none,stroke:#666,stroke-dasharray: 5 5

    %% Client Layer
    subgraph ClientLayer
        API[API Interface]:::client
        LLM[LLM Interface]:::client
        RAG[RAG System]:::client
    end

    %% Core Processing Layer
    subgraph CoreLayer
        Core[HawkinsDB Core]:::core
        Base[Base System]:::core
        Types[Type System]:::core
        Config[Configuration]:::core
        RefFrames[Reference Frames]:::core
        CorticalCols[Cortical Columns]:::core
    end

    %% Memory Management Layer
    subgraph MemoryLayer
        SemanticMem[Semantic Memory]:::memory
        EpisodicMem[Episodic Memory]:::memory
        ProceduralMem[Procedural Memory]:::memory
        MemRouter[Memory Router]:::memory
        Context[Context Manager]:::memory
    end

    %% Storage Layer
    subgraph StorageLayer
        Storage[Storage Backend]:::storage
        SQLite[SQLite Implementation]:::storage
        JSON[JSON Storage]:::storage
        ConnPool[Connection Pool]:::storage
    end

    %% External Integration Layer
    subgraph IntegrationLayer
        OpenAI[OpenAI API]:::external
        ConceptNet[ConceptNet]:::external
        Enrichment[Enrichment System]:::external
    end

    %% Planned Features
    MultiModal[Multimodal Processing]:::planned
    AdvQuery[Advanced Querying]:::planned

    %% Connections
    API --> LLM
    LLM --> Core
    RAG --> Core
    Core --> Base
    Core --> Types
    Core --> Config
    Core --> RefFrames
    Core --> CorticalCols
    Core --> MemRouter
    MemRouter --> SemanticMem
    MemRouter --> EpisodicMem
    MemRouter --> ProceduralMem
    SemanticMem --> Storage
    EpisodicMem --> Storage
    ProceduralMem --> Storage
    Storage --> SQLite
    Storage --> JSON
    Storage --> ConnPool
    Core --> Enrichment
    Enrichment --> ConceptNet
    LLM --> OpenAI
    Core -.-> MultiModal
    Core -.-> AdvQuery

    %% Click Events
    click Core "https://github.com/harishsg993010/HawkinsDB/blob/main/hawkinsdb/core.py"
    click Base "https://github.com/harishsg993010/HawkinsDB/blob/main/hawkinsdb/base.py"
    click Types "https://github.com/harishsg993010/HawkinsDB/blob/main/hawkinsdb/types.py"
    click Config "https://github.com/harishsg993010/HawkinsDB/blob/main/hawkinsdb/config.py"
    click LLM "https://github.com/harishsg993010/HawkinsDB/blob/main/hawkinsdb/llm_interface.py"
    click OpenAI "https://github.com/harishsg993010/HawkinsDB/blob/main/hawkinsdb/openai_interface.py"
    click Storage "https://github.com/harishsg993010/HawkinsDB/blob/main/hawkinsdb/storage/__init__.py"
    click SQLite "https://github.com/harishsg993010/HawkinsDB/blob/main/hawkinsdb/storage/sqlite.py"
    click Enrichment "https://github.com/harishsg993010/HawkinsDB/blob/main/hawkinsdb/enrichment.py"
    click RAG "https://github.com/harishsg993010/HawkinsDB/blob/main/examples/HawkinDB_RAG.py"
    click ConceptNet "https://github.com/harishsg993010/HawkinsDB/blob/main/docs/conceptnet_guide.md"
    click LLM "https://github.com/harishsg993010/HawkinsDB/blob/main/docs/llm_interface_guide.md"
    click SQLite "https://github.com/harishsg993010/HawkinsDB/blob/main/docs/sqlite_backend.md"
```
