Interviewed by: Mehadi Hasan
Developer: Uglypear Data
Role: Leader, Uglypear Data
Website: uglypear.com
When Better AI Isn't the Answer
When an AI system produces an incorrect answer, the instinct is often to blame the model. Developers experiment with different language models, rewrite prompts, adjust temperatures, or increase model capabilities. But sometimes, none of these changes solve the underlying problem.
For Uglypear Data, this observation sits at the centre of a much broader engineering challenge: the quality of an AI system depends heavily on the quality of the documents it receives.
Working across document compression, AI data engineering, and Retrieval-Augmented Generation (RAG), Uglypear Data focuses on a layer that is frequently overlooked in AI development. Before a language model can retrieve information or generate a reliable answer, the documents behind that information must be accessible, readable, structured, and prepared correctly.
The company's journey began with a practical problem. Business documents were becoming increasingly difficult to store, transfer, search, and process. Large scanned contracts, reports, and archives created operational difficulties, while their confidential contents made uploading them to third-party online tools an unacceptable option for many organizations.
Rather than treating compression and document intelligence as separate concerns, Uglypear Data began building an approach that connects them. Its products now cover local document compression, AI-ready data preparation, and private deployment environments for organizations that need greater control over their information.
From Document Compression to AI Infrastructure
Uglypear Data did not begin by trying to become an AI infrastructure company. Its direction developed from problems encountered while working with real business documents.
Large scanned files were difficult to email, archive folders were nearly impossible to search, and existing online compression tools introduced privacy concerns. Organizations needed a way to reduce document sizes without exposing confidential information to external services.
The response was to develop an independent compression engine with local processing as a foundational principle. Documents could become smaller while remaining on the user's own machine. This engineering direction eventually led to SmartSlim and its accompanying compression SDK.
The arrival of large language models introduced another dimension to the same problem.
Customers began using their documents as inputs for AI applications, but discovered that large files were not simply storage and transfer problems anymore. They also increased processing costs and created opportunities for inaccurate extraction.
Scanned documents often contain redundant image information, visual noise, and inconsistently extracted text. When these documents enter an AI pipeline without proper preparation, the resulting answers can reflect those defects.
Uglypear Data measured that carefully compressing scanned document images while preserving their text could reduce the number of tokens an AI system needed to process by approximately 86 percent.
That finding changed how the company viewed compression. It was no longer just about saving storage space. It could also become an important part of controlling AI processing costs and improving the quality of information supplied to language models.
Today, the company's work connects three areas:
- Document compression: SmartSlim Desktop, SmartSlim Server, SmartSlim Enterprise, and the Rust Compression SDK.
- RAG data engineering: Document parsing, cleaning, sensitive-information redaction, chunking, and evaluation.
- Private infrastructure: Local, self-hosted, and on-premises deployment for organizations with strict data requirements.
Each area builds on the same underlying idea: documents must be prepared properly before they can become reliable inputs for other systems.
One of the most technically demanding parts of Uglypear Data's work has been developing its own compression engine in Rust.
The choice of Rust reflects two requirements that are particularly important for document-processing infrastructure: high performance and memory safety.
A batch compression operation might process thousands of documents overnight without anyone monitoring it continuously. Under those conditions, a memory-management problem several hours into a job can undermine confidence in the entire system.
Rust's ownership model provides a way to pursue native-level performance while maintaining stronger guarantees around memory management.
However, the most difficult engineering decisions were not necessarily about compression algorithms. They involved how the engine interacted with the environments in which it was expected to run.
The team encountered a particularly challenging issue when moving from a standalone command-line tool to an embedded engine inside another application.
As a standalone program, the engine could process thousands of files over extended periods without failures. But when embedded into a desktop application, it began corrupting memory within minutes.
The same engine was processing the same files on the same machine. Yet its behaviour changed dramatically.
The investigation revealed that the problem was related to the difference between owning an entire process and operating inside a host application. The file-scanning layer was making assumptions about process memory and resource ownership that were valid in the standalone environment but not in the embedded one.
Several approaches were considered, including restricting embedded use cases and adding heavier isolation layers. Neither addressed the underlying problem satisfactorily.
Ultimately, the team rebuilt the file-scanning layer from scratch, giving it strictly bounded ownership of its resources and removing assumptions that depended on the surrounding process.
The crashes disappeared.
The experience also established an important engineering principle for the company: a component that works independently cannot automatically be considered reliable when embedded elsewhere.
As the engine continues to be used in additional contexts, every new embedding environment must be tested independently.
For Uglypear Data, reliability is not simply a property of the code. It is also a property of the environment in which that code operates.
One Engine, Four Different Product Requirements
Uglypear Data's compression ecosystem demonstrates how the same underlying technology can serve different operational requirements.
Rather than forcing every customer into one product format, the company developed several ways to use its engine.
SmartSlim Desktop is designed for individual professionals who want to compress documents directly on their computers. Its priorities are simplicity, speed, and minimal setup.
SmartSlim Server addresses a different requirement. Teams that need to process documents collectively benefit from centralized batch processing, consistent settings, and unattended operation without requiring separate installations on every workstation.
SmartSlim Enterprise is intended for organizations that need administrative control and deployment within their own infrastructure. Access control, auditability, and governance become as important as compression performance.
The Rust Compression SDK serves software developers who want to integrate the compression engine into their own applications. This introduces particularly demanding requirements around memory boundaries, predictable behaviour, and compatibility with unfamiliar host environments.
Although the products serve different workflows, they share the same engineering foundation.
The reasoning behind this approach is straightforward: people do not adopt software simply because its underlying technology is impressive. They adopt it because it fits the way they already work.
A desktop application, a shared processing service, an enterprise deployment, and an embedded SDK solve related problems, but they require different product experiences.
Why Document Quality Matters More Than Compression Ratios
Reducing file size is an obvious way to measure a compression engine, but Uglypear Data considers that metric insufficient on its own.
A smaller document is not necessarily a better document if its text becomes unreadable, its structure is damaged, or its content can no longer be searched.
The company treats quality as a constraint rather than something to sacrifice for better compression results.
The appropriate quality requirements depend on the document's intended purpose.
For AI applications, extracted text must remain intact. For human readers, visual readability matters. For archival documents, searchability and long-term accessibility are important.
Scanned documents have been particularly challenging because their redundant information often exists in the image layer rather than the text layer.
One of the company's public benchmarks involves a 443-page scanned OFD document compressed in 124 seconds while remaining readable and searchable.
This type of result requires more than achieving a favourable compression ratio. The processing must preserve the information that makes the document useful.
The same philosophy applies to the company's engineering process.
Uglypear Data maintains a stable collection of real-world test documents and reruns them whenever the compression engine changes. These tests help identify regressions before they reach customers.
The company also evaluates actual extraction quality instead of assuming that a smaller output automatically means a successful result.
For infrastructure software, measurable quality is more valuable than an impressive claim without supporting conditions.
Preparing Documents for Reliable RAG Systems
The relationship between document preparation and AI reliability becomes particularly important in Retrieval-Augmented Generation systems.
RAG applications depend on retrieving relevant information from external documents before supplying it to a language model. However, the quality of the retrieval process depends on what happened to those documents before indexing.
Uglypear Data approaches RAG preparation as a connected pipeline in which each stage addresses a different potential source of failure.
Parsing: Preserving the Original Meaning
The first stage converts documents into structured text and layout information.
This is more complicated than extracting words from a file. Tables, headings, sections, and other structural elements carry meaning that can easily disappear during parsing.
A table separated from its explanatory text, for example, may become difficult for an AI system to interpret correctly.
The objective is not simply to extract content but to preserve the information needed by subsequent processing stages.
Business documents frequently contain repeated headers, footers, duplicated sections, broken characters, and other forms of redundancy.
Cleaning removes content that should not unnecessarily reach the language model.
This improves the usefulness of the resulting dataset while reducing the number of redundant tokens processed during AI queries.
Sensitive-information redaction is another essential part of the pipeline.
Uglypear Data places this stage before chunking and indexing. The reason is practical: removing sensitive information before it enters a vector store is considerably easier than attempting to remove it after it has been embedded and distributed across other system components.
Chunking: Preserving Context
Chunking determines how documents are divided into units that an AI system can retrieve.
Chunks that are too large can contain excessive unrelated information, while chunks that are too small can separate information that needs to be understood together.
The company favours document-structure-aware chunking, using headings, sections, and tables to establish meaningful boundaries instead of relying entirely on fixed character counts.
Evaluation: Measuring the Complete Pipeline
The final stage is evaluation.
Uglypear Data uses held-out sets of real questions with known correct source material to assess whether the document pipeline produces useful retrieval results.
Whenever an upstream stage changes, the evaluation set can be rerun to identify whether the improvement in one area has created a problem elsewhere.
The important principle is that each stage must produce a verified output for the next stage.
A collection of PDFs does not become a reliable AI knowledge base simply because its contents have been converted into embeddings.
The Weekend That Changed How They Debug RAG
One of the most interesting lessons from Uglypear Data's experience comes from an earlier article, Spent a Weekend Fixing My "Dumb" RAG and the Model Was Never the Problem.
The central experience was familiar to many developers working with RAG applications: the system produced poor answers, and the initial instinct was to investigate the language model.
The team experimented with different models, prompts, and temperature settings. However, the results barely improved.
The breakthrough came when they examined the document-processing and retrieval pipeline rather than continuing to modify the model.
Several concrete problems emerged:
- Chunks separated tables from the explanations needed to understand them.
- Duplicated boilerplate introduced unnecessary noise into retrieval.
- A parsing stage had silently damaged the very section required to answer a test question.
These were not problems that a more capable language model could reliably solve.
The team then changed its approach, beginning with a small evaluation set containing real questions and their correct source documents.
This provided a measurable way to assess whether each modification actually improved the system.
They also prioritized parsing before chunking, introduced semantic boundaries based on document structure, and removed redundant information at the data layer instead of trying to compensate through prompt instructions.
The experience led to a broader debugging methodology.
When an AI system produces an incorrect answer, the investigation should move through the pipeline in order:
- Check the source: Does the correct information exist in the document collection?
- Inspect parsing: Was the relevant information extracted correctly?
- Test retrieval: Can the system retrieve the correct content for the question?
- Examine the model: If the correct information reaches the model but the answer remains incorrect, investigate the prompt, model, and context assembly.
This approach helps identify the first stage where the output becomes incorrect.
It also prevents developers from repeatedly changing downstream components when the original problem exists much earlier in the data pipeline.
As Uglypear Data's experience demonstrates, a RAG system can have a capable language model and still produce unreliable results because the information supplied to it is incomplete, corrupted, or poorly structured.
Privacy as an Architectural Decision
For organizations working with contracts, financial records, legal documents, and other confidential information, document processing introduces an important question: where does the data actually go?
Uglypear Data treats this as an architectural requirement rather than a policy statement.
Its local-first approach means that the core compression, parsing, and cleaning operations can happen on the customer's own hardware without requiring documents to be uploaded to the company's servers.
For enterprise and server deployments, the software can operate within infrastructure controlled by the organization, including air-gapped environments.
This creates additional engineering responsibilities.
Features cannot assume that internet connectivity, external model APIs, or cloud services will always be available. Dependencies must be evaluated against the requirements of organizations operating inside restricted environments.
The company also emphasizes redaction before indexing and auditability within enterprise deployments.
Administrators need to understand who processed documents, when processing occurred, and which settings were used. These requirements make auditability a product feature rather than simply another technical log.
There is an intentional trade-off.
Local-first and on-premises deployments sacrifice some of the convenience associated with cloud-connected workflows. However, for customers handling sensitive documents, maintaining control over where their information is processed is often more important than that convenience.
The company's position is that data boundaries should be enforced by the architecture itself, not left entirely to promises about how information will be handled.
Choosing a Technology Stack Around Responsibilities
Uglypear Data's technology stack reflects its separation of concerns across desktop applications, server infrastructure, and document-processing systems.
Rust powers the compression engine, where performance and memory safety are central requirements.
Tauri provides the desktop application shell, allowing SmartSlim to maintain a lightweight footprint. React handles the user interfaces across desktop and web applications.
On the server side, FastAPI works with Celery and Redis to manage asynchronous processing. This architecture allows large document batches to be queued and processed by workers without requiring users to monitor every operation.
MySQL stores durable application state, including jobs, settings, and audit records.
Docker and Kubernetes support deployment within server and enterprise environments.
Connecting these components introduces its own challenges.
The integration between a native Rust engine and its host applications requires careful memory ownership. Asynchronous processing also introduces operational responsibilities: workers must be monitored, queue depth must be managed, and stuck jobs must be visible.
On-premises deployment adds another constraint. Infrastructure cannot depend on cloud conveniences when customers need software to operate without internet access.
The company's experience reinforces an important architectural lesson: selecting individual technologies is only part of building a reliable system. The boundaries between those technologies deserve equally careful engineering.
Building a Bootstrapped Product Business
Turning technically demanding software into a sustainable product has also influenced how Uglypear Data approaches development.
The company describes itself as bootstrapped, meaning product decisions must be justified by practical customer needs rather than an abundance of external funding.
One of the biggest lessons has been that technically impressive software does not automatically attract users.
As the company operates across different markets, its website is available in nine languages, and it publishes practical articles about document workflows and data privacy daily.
This reflects a change in perspective: customers are not looking to download a compression engine simply because it exists. They are looking for a solution to a specific problem, such as oversized documents, inaccessible archives, or confidential information that cannot be uploaded to an external service.
Product development is therefore closely connected to understanding how customers actually work.
One example came from a user asking whether their AI assistant could perform document compression directly.
Rather than treating this as an unusual request, the company explored the possibility of allowing AI assistants to drive compression through the tools people already use.
That question helped shape another product direction.
The lesson is that useful product ideas do not always come from an internal feature roadmap. Sometimes they emerge from understanding how customers want to accomplish their existing tasks.
For a bootstrapped company, constraints can also improve product decisions. Features that do not solve sufficiently important problems are less likely to survive prioritization.
Uglypear Data's approach combines engineering quality, practical usability, and a focus on problems customers consider valuable enough to pay to solve.
What's Next: Agentic Document Workflows and Measurable AI Quality
Looking ahead, Uglypear Data sees several opportunities at the intersection of document intelligence, compression, and AI infrastructure.
The first is treating compression as a measurable AI cost-reduction capability rather than only a storage optimization technique.
The company's experience with token reduction has encouraged it to explore document preparation as a first-class operation in AI workflows.
The second direction is agentic document processing.
The company has already explored allowing AI assistants to drive compression through open protocols. The larger opportunity is to connect document arrival, preparation, routing, and question answering into more integrated AI-driven workflows.
However, this introduces an important challenge: verification.
When an AI assistant processes a contract or another sensitive document, users need a reliable way to confirm that the system performed the intended operation correctly.
The third direction is evaluation as a product capability.
Many RAG development teams eventually build internal tools to measure retrieval quality and answer reliability. Uglypear Data is interested in whether this evaluation layer can become accessible to non-specialist teams as well.
The common requirement across these directions remains the same: keeping processing local or within the customer's infrastructure.
For the company, the intelligence layer is only trustworthy when its data boundaries remain trustworthy too.
Five Engineering Lessons from Building AI Infrastructure
Uglypear Data's experience offers several practical lessons for developers working on specialized infrastructure and AI-powered applications.
1. Chase the problem, not the technology stack.
Technologies change frequently, particularly in AI development. The ability to identify an expensive, recurring problem and turn it into something measurable and solvable has longer-term value than becoming attached to a particular framework.
2. Measure before making promises.
A benchmark is meaningful only when its methodology and conditions are clear. Publishing the conditions behind a performance claim helps others understand what the result actually demonstrates.
3. Document difficult failures.
The memory-corruption problem encountered while embedding the compression engine changed how the company approaches testing. Recording failures and turning them into repeatable tests helps prevent similar problems from returning.
4. Build evaluation before building the feature.
Whether the goal is better compression or more reliable RAG retrieval, developers should establish how success will be measured before making changes. Without a defined evaluation process, improvements can easily become subjective.
5. Treat reliability as part of the product.
Demonstrating that software works once is different from proving that it behaves consistently across thousands of files, different environments, and long-running workloads.
For infrastructure products, reliability is not an optional improvement. It is part of the reason customers choose the software in the first place.
Conclusion: Reliable AI Begins Before the Model
Uglypear Data's journey highlights an important aspect of modern AI engineering: the language model is only one component in a much larger information-processing system.
Documents must be compressed without losing useful information, parsed without damaging their structure, cleaned of unnecessary content, protected against sensitive-data exposure, and divided into meaningful retrieval units.
These requirements become even more important when systems operate on confidential business information or inside environments where external cloud services are not an option.
The company's work connects these challenges through a consistent engineering philosophy: build around real problems, verify results with measurable tests, and make reliability a requirement at every stage.
Its experience with compression, RAG, and local-first software also offers a useful reminder for developers: when an AI application produces an incorrect answer, changing the model should not always be the first response.
Sometimes the most important engineering work happens long before the model receives its first token.
And sometimes, the model was never the problem.
About Uglypear Data
Uglypear Data focuses on high-performance document compression and AI data engineering, helping organizations transform large, unstructured business documents into smaller, searchable, and AI-ready information sources.
Its product ecosystem includes SmartSlim Desktop, SmartSlim Server, SmartSlim Enterprise, and a Rust-based Compression SDK. The company also works on RAG data engineering, including document parsing, cleaning, sensitive-information redaction, semantic chunking, and evaluation.
With an emphasis on local processing, privacy, and private infrastructure, Uglypear Data develops solutions for individuals, development teams, and organizations that need greater control over their document workflows.
Developer Stories is a CoderLegion interview series highlighting the people, ideas, and engineering decisions behind software development.
Interview conducted by Mehadi Hasan for CoderLegion.