# datascienceworld-kan/aucodb architecture

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

- Interactive diagram: https://gitdiagram.com/datascienceworld-kan/aucodb
- Repository: https://github.com/datascienceworld-kan/aucodb

## Overview

1. **Overall shape**
   AucoDB is a Python package, not a single application. The repository is organized around one core JSON document store, with two optional extensions: an HTTP server/client wrapper over the same store, and adapters for vector and graph backends. The main architectural boundary is between **local file-backed document storage** and the **integrations layer** for retrieval/graph workflows.

2. **Core document database subsystem**
   The `aucodb/database` package is the primary persistence layer. It exposes `AucoDB`, plus collection/record abstractions used to manage MongoDB-like collections and JSON documents. This layer is responsible for reading/writing a JSON file on disk, maintaining collection state, and supporting CRUD-style operations directly without HTTP.

3. **Storage model and data flow**
   The native data flow is: application code → `AucoDB` → collection/record logic → JSON file on disk. The README and examples indicate the DB persists a single named dataset at a configured `data_path`, with collections holding records and supporting add/get/update/delete/find/sort operations. This is the lowest-level trusted boundary in the repo.

4. **HTTP access layer**
   The `aucodb/server/auco_server.py` module provides a built-in server that exposes the same database operations over HTTP. This turns the local JSON store into a remotely accessible service. The `aucodb/client/auco_client.py` module is the corresponding client, translating application-level CRUD calls into HTTP requests. Architecturally, the server/client pair is a transport layer over the core database, not a separate storage engine.

5. **Client-server boundary**
   The HTTP path is distinct from direct file access: `AucoClient` talks to `auco_server`, while `AucoDB` operates on files directly. That means the repo has two modes of use:
   - **embedded/local mode**: direct file I/O through `AucoDB`
   - **service mode**: remote CRUD through `AucoClient` and the server
   This separation is important for diagramming because the same logical data model is reachable through two entry points.

6. **Vector database extension**
   The `aucodb/vectordb` package is an adapter/factory layer for multiple vector stores. `factory.py` and `providers/` abstract over backends such as Chroma, FAISS, Milvus, PGVector, Pinecone, Qdrant, and Weaviate. The architecture here is “one interface, many providers,” with backend-specific implementations hidden behind a common factory/provider contract.

7. **Vector data pipeline**
   The vector path has a clear pipeline: document input → `DocumentProcessor` → embeddings model → backend-specific vector store. The `processor` package handles chunking/preprocessing, while the factory coordinates storage and querying. The key boundary is that AucoDB itself does not appear to own embedding generation or retrieval logic; it orchestrates external embedding models and backend vector databases.

8. **Graph extension**
   The `aucodb/graph` package is a separate knowledge-graph pipeline. `LLMGraphTransformer` converts unstructured text into graph entities/relationships, and `neo4j_client.py` writes and queries that graph in Neo4j. This is an LLM-to-graph ingestion path, aimed at knowledge extraction and GraphRAG-style workflows rather than tabular CRUD.

9. **Graph data flow**
   The graph subsystem flows as: text/document → LLM transformer → graph representation → Neo4j storage → Cypher queries/visualization. The repo includes a sample `data.jsonl` and HTML assets/docs for visualization output, indicating the graph module also supports inspection/export, not just persistence.

10. **Optional integrations and deployment**
   The repository is structured as a core package plus optional extras. The README references `aucodb[vectordb]` and `aucodb[graph]`, suggesting dependency-gated features. `docker-compose.yaml` is used for local infrastructure setup, especially Neo4j and vector DB demos, so the repo expects external services to be provisioned separately.

11. **Configuration and environment**
   Configuration is split across `.env.example`, `aucodb/vectordb/configs.yaml`, and the docs/examples. That implies runtime behavior is driven by environment variables for service credentials and YAML/config files for backend selection. This matters architecturally because the system is designed to swap storage backends without changing the app-level API.

12. **Repo-level support files**
   `tests/` contains coverage for the client and database layers, which suggests the core contract is the document CRUD API and HTTP client behavior. CI/lint tooling (`.github/workflows/black.yaml`, `.pre-commit-config.yaml`) indicates a small library-style codebase rather than a long-running distributed system with many services.

13. **How to draw the architecture**
   A good diagram would center on the core `AucoDB` document store, then show two outward-facing paths:
   - **Direct file access path**: app code → database package → JSON file
   - **HTTP path**: app code → client → server → same database package → JSON file
   Then show two optional integration branches off the package:
   - **Vector branch**: docs → processor → embeddings → vector backend adapters
   - **Graph branch**: text → LLM transformer → Neo4j client → Neo4j
   These are parallel extensions, not tightly coupled subsystems.

Main entry points: [`aucodb/database/aucodb.py`](https://github.com/datascienceworld-kan/aucodb/blob/main/aucodb/database/aucodb.py) (Database), [`aucodb/vectordb/providers/base.py`](https://github.com/datascienceworld-kan/aucodb/blob/main/aucodb/vectordb/providers/base.py) (Providers), [`docker-compose.yaml`](https://github.com/datascienceworld-kan/aucodb/blob/main/docker-compose.yaml) (Compose), [`aucodb/client/auco_client.py`](https://github.com/datascienceworld-kan/aucodb/blob/main/aucodb/client/auco_client.py) (Client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Core store"]
  node_aucodb_pkg["AucoDB<br/>[__init__.py]"]
  node_db_engine[("Database<br/>document store<br/>[aucodb.py]")]
  node_collections["Collections<br/>model layer<br/>[aucodb.py]"]
  node_json_file["JSON file<br/>on-disk store"]
end

subgraph group_http["HTTP access"]
  node_client["Client<br/>[auco_client.py]"]
  node_server["Server<br/>http api<br/>[auco_server.py]"]
  node_http_api(("CRUD API<br/>transport contract"))
end

subgraph group_vector["Vector adapter"]
  node_vectordb_factory["Vector factory<br/>adapter factory<br/>[factory.py]"]
  node_vector_processor["Processor<br/>preprocess pipeline<br/>[processor.py]"]
  node_vector_providers["Providers<br/>backend adapters<br/>[base.py]"]
  node_embeddings(("Embeddings<br/>model dependency"))
  node_vector_store[("Vector DBs<br/>external backends")]
end

subgraph group_graph["Graph pipeline"]
  node_graph_transformer["Graph transformer<br/>llm extractor"]
  node_neo4j_client["Neo4j client<br/>graph client<br/>[neo4j_client.py]"]
  node_graph_store[("Neo4j<br/>external graph store")]
end

subgraph group_ops["Repo support"]
  node_docs_assets["Docs & assets<br/>examples<br/>[my_graph.html]"]
  node_compose["Compose<br/>deployment"]
end

node_aucodb_pkg -->|"exports"| node_db_engine
node_db_engine -->|"uses"| node_collections
node_collections -->|"persists"| node_json_file
node_client -->|"calls"| node_http_api
node_server -->|"serves"| node_http_api
node_http_api -->|"forwards"| node_db_engine
node_vector_processor -->|"prepares"| node_embeddings
node_embeddings -->|"indexes"| node_vector_providers
node_vectordb_factory -->|"selects"| node_vector_providers
node_vector_providers -->|"targets"| node_vector_store
node_graph_transformer -->|"emits"| node_neo4j_client
node_neo4j_client -->|"stores"| node_graph_store
node_docs_assets -.->|"shows"| node_graph_transformer
node_compose -.->|"provisions"| node_graph_store
node_compose -.->|"provisions"| node_vector_store
node_db_engine -.->|"mirrors"| node_client

click node_aucodb_pkg "https://github.com/datascienceworld-kan/aucodb/blob/main/aucodb/__init__.py"
click node_db_engine "https://github.com/datascienceworld-kan/aucodb/blob/main/aucodb/database/aucodb.py"
click node_collections "https://github.com/datascienceworld-kan/aucodb/blob/main/aucodb/database/aucodb.py"
click node_client "https://github.com/datascienceworld-kan/aucodb/blob/main/aucodb/client/auco_client.py"
click node_server "https://github.com/datascienceworld-kan/aucodb/blob/main/aucodb/server/auco_server.py"
click node_vectordb_factory "https://github.com/datascienceworld-kan/aucodb/blob/main/aucodb/vectordb/factory.py"
click node_vector_processor "https://github.com/datascienceworld-kan/aucodb/blob/main/aucodb/vectordb/processor/processor.py"
click node_vector_providers "https://github.com/datascienceworld-kan/aucodb/blob/main/aucodb/vectordb/providers/base.py"
click node_graph_transformer "https://github.com/datascienceworld-kan/aucodb/blob/main/aucodb/graph/llm_graph_transformer.py"
click node_neo4j_client "https://github.com/datascienceworld-kan/aucodb/blob/main/aucodb/graph/neo4j_client.py"
click node_docs_assets "https://github.com/datascienceworld-kan/aucodb/blob/main/docs/my_graph.html"
click node_compose "https://github.com/datascienceworld-kan/aucodb/blob/main/docker-compose.yaml"

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_aucodb_pkg,node_db_engine,node_collections,node_json_file toneBlue
class node_client,node_server,node_http_api toneAmber
class node_vectordb_factory,node_vector_processor,node_vector_providers,node_embeddings,node_vector_store toneMint
class node_graph_transformer,node_neo4j_client,node_graph_store toneRose
class node_docs_assets,node_compose toneIndigo
```

## Components

### Core store

Local JSON document database and its record/collection model.

- [AucoDB](https://github.com/datascienceworld-kan/aucodb/blob/main/aucodb/__init__.py): package · Top-level Python package entrypoint. · `aucodb/__init__.py`
- [Database](https://github.com/datascienceworld-kan/aucodb/blob/main/aucodb/database/aucodb.py): document store · Core local persistence and CRUD logic. · `aucodb/database/aucodb.py`
- [Collections](https://github.com/datascienceworld-kan/aucodb/blob/main/aucodb/database/aucodb.py): model layer · Collection and record abstractions for JSON documents. · `aucodb/database/aucodb.py`
- **JSON file**: on-disk store · Single file-backed dataset persisted by the database.

### HTTP access

Remote API layer over the same database engine.

- [Client](https://github.com/datascienceworld-kan/aucodb/blob/main/aucodb/client/auco_client.py): http client · Application-facing HTTP wrapper for CRUD operations. · `aucodb/client/auco_client.py`
- [Server](https://github.com/datascienceworld-kan/aucodb/blob/main/aucodb/server/auco_server.py): http api · HTTP server exposing the database operations. · `aucodb/server/auco_server.py`
- **CRUD API**: transport contract · Remote request/response boundary for the store.

### Vector adapter

Embeddings pipeline and provider abstraction for vector backends.

- [Vector factory](https://github.com/datascienceworld-kan/aucodb/blob/main/aucodb/vectordb/factory.py): adapter factory · Selects and constructs vector backend providers. · `aucodb/vectordb/factory.py`
- [Processor](https://github.com/datascienceworld-kan/aucodb/blob/main/aucodb/vectordb/processor/processor.py): preprocess pipeline · Chunks and prepares documents for embedding. · `aucodb/vectordb/processor/processor.py`
- [Providers](https://github.com/datascienceworld-kan/aucodb/blob/main/aucodb/vectordb/providers/base.py): backend adapters · Common interface to Chroma, FAISS, Milvus, PGVector, Pinecone, Qdrant, and Weaviate. · `aucodb/vectordb/providers/base.py`
- **Embeddings**: model dependency · External embedding model used before vector storage.
- **Vector DBs**: external backends · Backend vector databases selected through the provider layer.

### Graph pipeline

LLM-driven graph extraction and Neo4j integration.

- [Graph transformer](https://github.com/datascienceworld-kan/aucodb/blob/main/aucodb/graph/llm_graph_transformer.py): llm extractor · Turns text into graph entities and relationships. · `aucodb/graph/llm_graph_transformer.py`
- [Neo4j client](https://github.com/datascienceworld-kan/aucodb/blob/main/aucodb/graph/neo4j_client.py): graph client · Writes and queries graphs in Neo4j. · `aucodb/graph/neo4j_client.py`
- **Neo4j**: external graph store · External graph database used by the graph pipeline.

### Repo support

Docs, examples, and deployment/configuration support files.

- [Docs & assets](https://github.com/datascienceworld-kan/aucodb/blob/main/docs/my_graph.html): examples · Rendered graph examples and supporting documentation assets. · `docs/my_graph.html`
- [Compose](https://github.com/datascienceworld-kan/aucodb/blob/main/docker-compose.yaml): deployment · Local infrastructure setup for optional external services. · `docker-compose.yaml`

## Connections

- AucoDB → Database: exports · Top-level package exposes the core database.
- Database → Collections: uses · Database coordinates collection and record operations.
- Collections → JSON file: persists · Collections read and write the backing JSON dataset.
- Client → CRUD API: calls · Client translates local CRUD calls into HTTP requests.
- Server → CRUD API: serves · Server implements the remote CRUD boundary.
- CRUD API → Database: forwards · HTTP requests are mapped onto the same database engine.
- Processor → Embeddings: prepares · Document chunks are sent to an embedding model.
- Embeddings → Providers: indexes · Embedded vectors are stored through provider adapters.
- Vector factory → Providers: selects · Factory chooses a backend implementation.
- Providers → Vector DBs: targets · Providers connect to external vector databases.
- Graph transformer → Neo4j client: emits · Extracted graph structure is passed to the Neo4j client.
- Neo4j client → Neo4j: stores · Client persists and queries the Neo4j graph.
- Docs & assets → Graph transformer: shows · Documentation includes graph output and examples.
- Compose → Neo4j: provisions · Compose supports local external service setup.
- Compose → Vector DBs: provisions · Compose supports vector backend demos and services.
- Database → Client: mirrors · Client exposes the same CRUD semantics as direct access.
