Skip to content
Zakariae Fakhri/ Software Developer

Open to freelance projects

Hi, I'm Zakariae, software developer.

I build AI systems that turn messy workflows into reliable software.

I work where backend engineering, document processing and modern AI meet: systems that extract, validate and integrate data, and keep working when the input isn't perfect.

  • Document intelligence
  • RAG & AI agents
  • Workflow automation

01Selected Projects

Things I've built.

Real projects, described as they are. Internal tools were built in my job: their code and data aren't public, so the diagrams show the architecture, not internal details.

contract-analysis.pipelineArchitecture
  1. 01 · IngestContracts in any format
    • PDF
    • Scans
    • Docling OCR
  2. 02 · ExtractSchema-based, then checked
    • Mastra AI
    • LLM
    • Validation
  3. 03 · IndexSearchable by meaning
    • NLP
    • Embeddings
    • OpenSearch
  4. 04 · ChatChatbot with its own MCP tools
    • MCP server
    • Tool calls
    • Dynamic export
Internal toolDocument intelligenceInternal tool · not public

Contract analysis system

An internal system that reads contracts, extracts the key terms into validated, structured data and makes the whole contract base searchable by meaning. On top sits a chatbot that works with the contracts through its own MCP server.

  • Docling
  • OCR
  • Mastra AI
  • LLMs
  • NLP
  • Embeddings
  • OpenSearch
  • MCP
  • Chatbot
  • Python
  • TypeScript
Show details
  • Docling turns scanned and digital contracts into clean, structured text, with OCR, layout and table recognition.
  • Extraction and validation run as Mastra AI workflows: the model fills a defined schema, and checks run before anything is stored.
  • NLP steps clean and segment the text before it is embedded with a large embedding model.
  • OpenSearch serves as the vector database, combining semantic search with classic keyword search.
  • A chatbot on top, backed by an MCP server I built from scratch: several tools the model can call, including a dynamic export of contract data.
log-to-pr.lifecycleArchitecture
  1. 01 · DetectErrors from production logs
    • Grafana
    • Logs
  2. 02 · AnalyseError plus code context
    • Error context
    • Codebase
  3. 03 · FixProposed change
    • LLM agent
    • Patch
  4. 04 · ReviewPull request for a person
    • Pull request
    • Merge

After merge, monitoring continues and the loop starts again

Internal toolAutomation agentInternal tool · not public

From error log to pull request

An automation that closes the loop from error to fix: it reads logs from Grafana, finds the likely cause in the codebase and opens a pull request with a proposed fix.

  • Grafana
  • Log analysis
  • LLM agents
  • Code analysis
  • Git
  • Pull requests
Show details
  • Pulls error logs and their context from Grafana instead of waiting for someone to notice them.
  • Analyses each error together with the relevant code to narrow down the likely cause.
  • Writes a fix and opens a pull request, so a developer reviews a proposal instead of starting from zero.
  • The whole lifecycle runs automatically: detect, analyse, fix, pull request, and back to monitoring.
chunkguard.picArchitecture
  1. 01 · SplitSentences with offsets
    • sentencex
    • Abbreviations
  2. 02 · SummariseOne LLM call per document
    • Any LLM
    • PIC prompt
  3. 03 · CompareEvery sentence vs. the summary
    • Embeddings
    • Cosine similarity
  4. 04 · ChunkCore content and side details
    • Mean threshold
    • Length limits
Usage
$ pip install chunkguard from chunkguard import PICChunker chunker = PICChunker(complete=llm, embed=embed)chunks = chunker.split("doc-1", text, "en")
Own projectOpen-source Python packagePublic on PyPI and GitHub · MIT licence

chunkguard

A Python package for document chunking in RAG. It is an independent implementation of PIC (Pseudo-Instruction for document Chunking) from an ACL 2025 paper, and works with any LLM and any embedding model.

  • Python
  • Pydantic
  • sentencex
  • LiteLLM
  • tiktoken
  • Embeddings
  • LLMs
  • RAG
  • PyPI
  • GitHub Actions
Show details
  • Chunk boundaries follow the document's topic: an LLM summary stands in for the questions users will ask, and every sentence is compared with it rather than only with its neighbour.
  • Order is kept, no sentence is cut and nothing is dropped. Each chunk carries exact character offsets, a relevance flag and its similarity score.
  • Additions for production use: splitting long chunks, merging short ones, token-based limits, and excerpting long documents for the summary.
  • Careful sentence splitting for German and English, including abbreviations, ordinals and house numbers, plus custom abbreviations for domain texts.
  • Bring your own model functions or use 100+ providers through LiteLLM, sync or async; LiteLLM is pinned past the compromised March 2026 releases.

More projects

Internal toolRetrieval and agentsInternal tool · not public

Support chatbot for 1st and 2nd level

A chatbot that answers support questions about internal tools, first from the documentation and, when that isn't enough, from the code itself.

Flow: AskRouteRetrieveAnswer

  • LLMs
  • Tool routing
  • opencode
  • RAG
  • Embeddings
  • PostgreSQL
  • +1 more
Show details
  • A routing step first decides which internal tool a question is about, so retrieval only searches the right sources.
  • opencode analyses the codebases and their documentation, so second-level answers reflect how a tool actually behaves.
  • Documentation is embedded automatically and stored in PostgreSQL with pgvector, without manual re-indexing.
  • One entry point for both levels: quick answers from the docs, deeper answers grounded in the code.
Own projectFull-stack productPrivate repository · demo on request

ZUGFeRD e-invoicing app

A web app for German e-invoicing. It issues ZUGFeRD 2.5 / Factur-X invoices (PDF/A-3 with embedded EN 16931 XML) and XRechnung 3.0, checks e-invoices you receive, and covers the work around them, from quote to dunning letter.

  • Python
  • FastAPI
  • SQLite
  • CII XML
  • PDF/A-3
  • veraPDF
  • +7 more
Show details
  • Validation with XSD, EN 16931 and KoSIT Schematron, veraPDF, Mustang and its own PDF/XML consistency check. If a check can't run, the result is “incomplete”, never “passed”.
  • Advance and final invoices, credit notes and corrected invoices, across standard, reduced, mixed and zero rates, reverse charge, intra-EU supply, export and the small-business exemption.
  • Inbox for received e-invoices (ZUGFeRD PDF, XRechnung, CII, UBL): validated, shown in readable form and stored unchanged.
  • Customer and article records, quotes that turn into invoices, recurring invoices, payments, reminders and dunning levels, sent through your own SMTP server.
  • DATEV export, invoice journals, a GoBD-oriented archive with checksums and an immutable log, and backups that reject tampered files on restore.
  • Versioned REST API with scoped, expiring API keys, idempotency, signed webhooks, an OpenAPI spec and a sandbox that needs no key.
  • Production setup with Caddy (HTTPS, HSTS), hardened containers, Auth0 login, nightly snapshots and CI.
Own projectWebsiteBuilt with Next.js 16

This portfolio

The site you're on: a fast, accessible portfolio with interactive demos, shipped as a self-contained Docker image.

  • Next.js 16
  • React 19
  • TypeScript
  • Tailwind CSS 4
  • Cache Components
  • Docker
Show details
  • Lighthouse on a production build: 95+ performance and 100 for accessibility, best practices and SEO on mobile; 100 across the board on desktop.
  • Interactive demos that run entirely in the browser, so no visitor data leaves the page.
  • Contact form through a server action, with validation and honest delivery states.
  • Scroll-driven animations in pure CSS that respect the reduced-motion setting.
Own projectInteractive demoTry it below

Invoice extraction and routing sandbox

Two browser tools: one turns invoice text into validated JSON, the other routes invoices through approval rules you set yourself. A use-case playground adds human-in-the-loop review.

  • TypeScript
  • React
  • SVG
Show details
  • Parses German and English number and date formats.
  • Checks IBAN checksums (ISO 13616), VAT ID formats, totals and due dates, and flags conflicting totals.
  • Rule engine that re-routes invoices live across four lanes.
  • Playground with scenarios, an adjustable confidence threshold and an audit trail.

02Interactive Demos

Try what I build.

Two small sandboxes that run entirely in your browser. Paste your own text, change the rules, and see what an engineered workflow does with it, including the cases that should not go through automatically.

Open the use-case playground
Try a sample:

Runs entirely in your browser. Nothing you type is sent or stored. Please still avoid real personal data.

Ready to post: all checks passed

invoice.jsonhighmediumlow
{
"supplier": "Example Components GmbH", (medium confidence)"invoice_number": "RE-2026-0412", (high confidence)"invoice_date": "2026-10-14", (high confidence)"due_date": "2026-11-13", (high confidence)"po_number": "77120", (high confidence)"currency": "EUR", (high confidence)"net": "15,478.99", (high confidence)"vat": "2,941.01", (high confidence)"total": "18,420.00", (high confidence)"vat_id": "DE123456789", (high confidence)"iban": "DE89 3704 0044 0532 0130 00" (high confidence)}

Validation

  • Passed: Required fields present
  • Passed: Net + VAT = total
  • Passed: VAT rate plausible · 19.0%
  • Passed: IBAN checksum
  • Passed: VAT ID format
  • Passed: Due date after invoice date

The extraction sandbox uses transparent rules so it can run without a server. Production systems use language models for extraction; the validation layer works the same way.

03Focus Areas

What I work on.

Three areas I keep coming back to, whether in a team or on a freelance project.

Focus 01

Document intelligence

Turn contracts, invoices and scans into validated, structured data.

In practice

  • OCR and layout parsing with Docling
  • Schema-based extraction, validated before anything is stored
  • Standards-compliant e-invoices: ZUGFeRD, Factur-X and XRechnung

Capabilities

  • Docling
  • OCR
  • Mastra AI
  • LLMs
  • Structured outputs
  • Python

Where I've done this

Focus 02

Knowledge systems & chatbots

Make documentation, code and contracts answerable through retrieval and tools.

In practice

  • RAG over documentation and contracts with pgvector and OpenSearch
  • Topic-aware document chunking, published as an open-source package
  • Chatbots that call their own tools through MCP
  • Routing a question to the right source before retrieval

Capabilities

  • Embeddings
  • OpenSearch
  • pgvector
  • MCP
  • opencode
  • Retrieval pipelines

Where I've done this

Focus 03

Automation & agents

Automate multi-step work end to end, with a person where it matters.

In practice

  • Agents that go from an error log to a pull request
  • Rules and human review for cases that shouldn't run automatically
  • Integration through REST APIs, webhooks and pull requests

Capabilities

  • AI agents
  • Grafana
  • REST APIs
  • Webhooks
  • Pull-request automation
  • TypeScript

Where I've done this

04How I Build

Beyond the happy path.

A demo works when the input is clean. A production workflow has to cope with messy documents, flaky APIs and answers that are almost right. These principles are what separate the two.

  • Structured outputs and validation

    Model output is parsed into typed schemas and checked against business rules before anything downstream uses it.

  • Retry logic and failure handling

    Timeouts, rate limits and API errors are expected. Calls retry with backoff, and failures are surfaced instead of silently dropped.

  • Observability and traceability

    Each run records its inputs, decisions and outcome, so you can see what happened, and why, when something needs explaining.

  • Secure handling of data

    Least-privilege access, secrets kept out of code, and data flows designed around what actually needs to leave a company’s systems.

  • Governance and audit trail

    Automated decisions, model versions and approvals are logged, so compliance and internal audit can trace every step.

  • Your identity and access model

    Access follows your existing roles and single sign-on, and each user only reaches data they are already allowed to see.

  • Human review for uncertain decisions

    When rules fail or confidence is low, the case goes to a person, together with the context needed to decide quickly.

  • Maintainable architecture

    Clear module boundaries, tests for critical paths, and documentation the next developer can work with.

process_document.pyPseudocode
# 1. Never trust raw model output
result = extract(document, schema=Invoice)

# 2. Uncertain? A person decides.
if not result.valid or result.confidence < THRESHOLD:
    return review_queue.add(document, result.issues)

# 3. Expect the API to fail sometimes
with retry(attempts=3, backoff="exponential"):
    erp.create_invoice(result.data)

# 4. Leave a trace for every run
log.info("invoice.processed", run_id=run.id)
No system is error-free. The goal is to make failures visible, contained and recoverable.

05About

Software engineering first. AI where it adds value.

Zakariae Fakhri

Software Developer

Based in Germany

I combine software engineering, backend development and modern AI to build systems that solve concrete operational problems.

At work I build internal AI tools: a contract analysis system with its own MCP-based chatbot, a support chatbot that reads code and documentation, and an agent that turns error logs into pull requests. On my own I published chunkguard, an open-source package for RAG chunking, and built a complete e-invoicing app, where the hard part wasn't generating a PDF but making every result verifiable.

My approach is pragmatic: understand the workflow, choose the right tools, validate the output, and integrate the result into the systems people already use.

Open to freelance projects.

Skills

Languages
PythonTypeScript
Open source
chunkguard (PyPI)
AI & agents
LLM integrationMastra AIMCP serversRAGChunkingEmbeddingsLiteLLMStructured outputsopencode
Documents
DoclingOCRZUGFeRD / Factur-XXRechnungPDF/A-3XSD & Schematron
Data & search
PostgreSQLpgvectorOpenSearchSQLite
Backend
FastAPIPydanticREST APIsWebhooks
Frontend
Next.jsReactTailwind CSS
Ops
DockerDocker ComposeGrafanaGitHub ActionsCaddyAuth0

06Contact

Let's work together.

Have a project you want to get off the ground? Tell me about it, and I'll get back to you with how I would approach it.

  • A project? Describe the workflow, the systems involved and the goal.
  • Not sure yet? Describe the problem, and we can work out the approach together.
  • Just curious? Questions about my work are welcome too.

Prefer email?

hello@zak-fa.tech
What's it about? (optional)

Please do not include confidential information or sensitive personal data in your initial inquiry. Details on how your data is processed are in the privacy policy.

Fields marked * are required.