Applied Artificial Intelligence in our projects

← Home
AI & Automation

Applied Artificial Intelligence in our projects

We integrate AI where it adds real value: automating repetitive processes, extracting information from documents, generating contextualised content and intelligent user assistance. We make implementation decisions based on ROI, not trends.

LLM integration — Claude API and OpenAI

We use Claude (Anthropic) as the primary model for complex reasoning tasks, document analysis and long-form content generation — the 200k token context window allows processing an entire legal file or financial report in a single call. GPT-4o is chosen for multimodal tasks (image + text) and when the OpenAI ecosystem (Whisper, DALL-E) is needed.

Tool use (function calling) allows the LLM to interact with internal APIs: search the database, trigger actions in existing systems, return structured data validated with Pydantic. Streaming responses reduce perceived latency for conversational interfaces — the user sees text appearing progressively, not waiting 5-10 seconds.

  • Prompt caching (Anthropic) reduces cost by 90% for repetitive context (system prompts, reference documents)
  • Structured outputs (JSON mode) for type-safe responses without regex on free text
  • Automatic Claude → GPT-4o → Gemini fallback on availability errors
  • Per-user and per-feature cost tracking — LLM usage visible in admin dashboard

RAG — AI with knowledge from client data

Retrieval-Augmented Generation (RAG) allows the LLM to respond based on client-specific documents (contracts, manuals, legislation, emails) without retraining. Documents are chunked, embedded with text-embedding-3-large (OpenAI) or embed-english-v3 (Cohere), stored in pgvector (PostgreSQL extension) and retrieved via cosine similarity.

The RAG pipeline includes: document ingestion (PDF, DOCX, HTML), intelligent chunking (with overlap for context), re-ranking with Cohere Rerank for increased relevance, injection into LLM context and source citation with page numbers. The result is a chatbot that responds accurately based on real documents with verifiable sources.

  • pgvector for vector similarity search directly in PostgreSQL — no Pinecone/Weaviate
  • Hybrid search: dense vectors + sparse BM25 (keyword) → RRF fusion
  • RAG evaluation with RAGAS — precision, recall, faithfulness measured automatically
  • Metadata filtering for multi-tenant: user A does not see user B's documents

Computer Vision and document processing

For extracting data from scanned or photographed documents (invoices, contracts, IDs) we use a combined pipeline: image pre-processing (deskew, noise reduction with OpenCV), OCR with Google Document AI or Amazon Textract (structured, not raw OCR), post-processing with LLM for normalisation and validation. >98% accuracy on typical business documents.

Image classification (products, categories, NSFW detection) is done with fine-tuned models on CLIP or EfficientNet, deployed as FastAPI microservices with optional GPU inference (CUDA). For projects without GPU budget, cloud APIs (Google Vision, AWS Rekognition) offer 95%+ accuracy at marginal cost.

  • Product description generation from specs — hundreds of products, consistent brand tone
  • Automatic product categorisation at catalog import
  • Review and user-generated content moderation with cloud APIs + LLM fallback
  • Automatic data extraction from PDF/image supplier invoices → updated stock

Pros and cons

Pros

  • Automates repetitive processes: data extraction, classification, support.
  • RAG answers from client documents, with verifiable sources.
  • Prompt caching cuts cost by up to 90% on repetitive context.
  • Model fallback (Claude → GPT-4o → Gemini) for availability.

Limitations

  • LLMs can hallucinate — any critical output needs validation and sources.
  • Per-token cost grows fast at high volume without careful caching.
  • Sensitive data sent to third-party APIs raises privacy concerns.
  • Latency of a generated answer can reach several seconds.

Quick verdict

Integrate AI where it adds real ROI: automation, document RAG, data extraction. Avoid AI for AI's sake on tasks where a simple rule or classic search is enough.

Specifications table

CapabilityLimit / thresholdTypical use
LLM contextUp to 200k tokens (Claude)Large context raises cost and latencyLong-document analysis, reports
RAGpgvector, hybrid search, re-rankingQuality depends on chunking and sourcesChatbot over own documents
Computer visionStructured OCR, > 98% accuracyGPU inference increases costInvoice extraction, ID verification
Typical costBilled per token / per API callGrows with volume without cachingFrom chatbot to full pipeline

RAG vs fine-tuning

CriterionRAGFine-tuning
Knowledge updateInstant (add documents)Requires retraining
Verifiable sourcesYes, with citationNo
Upfront costLowHigh (data + GPU)

Frequently asked questions

What is RAG and when do I use it?

RAG (Retrieval-Augmented Generation) lets the AI answer from your documents (contracts, manuals, legislation) without retraining. Use it when you want accurate, sourced answers based on your own data.

RAG or fine-tuning?

RAG for frequently-changing knowledge and verifiable sources — you update it by adding documents. Fine-tuning for fixed style or format, with higher upfront cost. For most business cases, RAG is the choice.

How do you control AI hallucinations?

We use RAG with source citation, structured outputs (JSON) validated with Pydantic and human validation for critical output. The AI answers from real documents, not from memory, and every claim has an attached source.

Does my data stay confidential?

Sensitive data can be isolated per tenant and, if needed, processed with self-hosted models or APIs with no-training clauses. For regulated cases, we pick providers that do not use data for training.