How datascienceworld-kan/aucodb works
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.py Database · base.py Providers · docker-compose.yaml Compose · auco_client.py Client
Components 17
Core store
Local JSON document database and its record/collection model.
- AucoDB · Top-level Python package entrypoint.
aucodb/__init__.py - Database · Core local persistence and CRUD logic.
aucodb/database/aucodb.py - Collections · Collection and record abstractions for JSON documents.
aucodb/database/aucodb.py - JSON file · Single file-backed dataset persisted by the database.
HTTP access
Remote API layer over the same database engine.
Vector adapter
Embeddings pipeline and provider abstraction for vector backends.
- Vector factory · Selects and constructs vector backend providers.
aucodb/vectordb/factory.py - Processor · Chunks and prepares documents for embedding.
aucodb/vectordb/processor/processor.py - Providers · Common interface to Chroma, FAISS, Milvus, PGVector, Pinecone, Qdrant, and Weaviate.
aucodb/vectordb/providers/base.py - Embeddings · External embedding model used before vector storage.
- Vector DBs · Backend vector databases selected through the provider layer.
Graph pipeline
LLM-driven graph extraction and Neo4j integration.
- Graph transformer · Turns text into graph entities and relationships.
aucodb/graph/llm_graph_transformer.py - Neo4j client · Writes and queries graphs in Neo4j.
aucodb/graph/neo4j_client.py - Neo4j · External graph database used by the graph pipeline.
Repo support
Docs, examples, and deployment/configuration support files.
- Docs & assets · Rendered graph examples and supporting documentation assets.
docs/my_graph.html - Compose · Local infrastructure setup for optional external services.
docker-compose.yaml
Connections 16
- 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.