This week’s news about the gap between cutting-edge AI models and the tools developers actually use highlights a deeper issue: the infrastructure that supports AI applications is often as critical as the models themselves. As we build tools for real-world use cases, we find that the right data architecture can make or break the effectiveness of even the most sophisticated models.
We’re building a regulatory technology (regtech) tool for Nigerian microfinance banks - a space where AI must be both accurate and explainable. One of the key challenges we faced was ensuring that the AI systems we deployed could be audited, versioned, and queried in a way that met the strict compliance requirements of the financial sector. This led us to a critical architectural decision: choosing a data substrate over a traditional vector database or RAG (Retrieval-Augmented Generation) system built on top of file storage.
A data substrate is a versioned, citable, and queryable layer that sits beneath AI systems. It ensures that every piece of data used to train or run AI is traceable and auditable. This is especially valuable in regulated industries where accountability is non-negotiable. In contrast, vector databases and RAG systems are optimized for speed and relevance in query-based tasks, like search or content generation. They are excellent for applications like chatbots or recommendation engines, but they lack the fine-grained control and auditability required in our use case.
For example, when a bank in Lagos needs to verify whether an AI model’s decision to approve a loan was based on the latest version of a regulatory guideline, a data substrate makes that possible. The model can reference a specific version of the guideline, and the system can log that reference. This is not easily achievable with a vector database, which typically indexes data in a way that obscures its lineage and versioning.
Here’s a concrete example from our stack. We use a PostgreSQL-based data substrate that stores all regulatory documents, their versions, and metadata about when and how they were used by AI models. When a model generates a recommendation, it can pull from the latest version of a document, and the system logs that version in the database:
from sqlalchemy import create_engine, Column, Integer, String, ForeignKey
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
Base = declarative_base()
class DocumentVersion(Base):
__tablename__ = 'document_versions'
id = Column(Integer, primary_key=True)
document_id = Column(Integer, ForeignKey('documents.id'))
version_number = Column(String)
content = Column(String)
effective_date = Column(String)
document = relationship("Document", back_populates="versions")
class Document(Base):
__tablename__ = 'documents'
id = Column(Integer, primary_key=True)
name = Column(String)
versions = relationship("DocumentVersion", order_by=DocumentVersion.version_number, back_populates="document")
# Example usage
engine = create_engine('postgresql://user:password@localhost/dbname')
Base.metadata.create_all(engine)
This setup allows us to track document changes over time, ensure that AI systems are using the correct version, and audit decisions with full traceability - something a vector database cannot provide out of the box.
That said, there are tradeoffs. A data substrate adds complexity and latency compared to a vector DB. It requires more storage and careful schema design. It’s also not the right choice for every use case. If you need to power a chatbot that responds to user queries in milliseconds, a vector database or a RAG system built on top of files is likely the better choice. But when you need auditability, versioning, and a solid foundation for AI systems that must be trusted and explained, a data substrate is the way to go.
We’re now exploring how to integrate this data substrate with AI models that need to reason over structured and unstructured data. One of our next steps is to build a hybrid system where a vector database is used for fast retrieval of unstructured data, while the data substrate ensures that every retrieved piece of information is citable and versioned. We’re also evaluating how to make this architecture more scalable for the thousands of microfinance institutions across Africa that could benefit from such tools. What do you think - is there a use case where this hybrid approach could be overkill, or is it the future of responsible AI?
Top comments (0)