ARCHITECTURE · cogito

cogito architecture

cogito is an LLM-based ingest pipeline that classifies any file — a PDF, a Markdown note, an unstructured scrap — into an entity whoami can use. It's a separate gRPC service so it can remove whoami's rigid directory-structure requirement, and it's the shared foundation behind report pipelines like jaso (resume), bizplan, and company — including the resume PDF content referenced elsewhere on this site.

Why

When generating responses with an LLM, output quality turned out to be lower and less consistent than expected. To fix both the quality and consistency problems, this project integrates a question pipeline, a verification pipeline, and a composition pipeline together, aiming to improve reliability through more consistent, higher-quality responses.

01

How the internals are decomposed

cogito-structure.yaml

whoami enters over gRPC (cogito_service · prechunk_sink); the worker (runner · sink_coordinator · sweeper) hands off asynchronously to pipelines (taxonomy · jaso · bizplan · company), which call agents for LLM invocations. A Postgres-backed registry tracks processing state.

cogito component structure: whoami calls cogito_service and prechunk_sink over gRPC, which hand off to worker, then pipelines, then agents for LLM calls, writing to a Postgres registry and reaching gopedia

cogito / structure.yaml

02

How it deploys, and what it depends on

cogito-infra.yaml

Scale-to-zero by default — the ArgoCD Image Updater auto-scales it when it detects a new registry digest. LLM inference calls Ollama on a bare-metal GPU node; knowledge search calls gopedia-svc; entity storage calls whoami-api.

cogito infra: toji-cd ArgoCD Image Updater watches artifacts.toji.homes for a new digest and syncs the cogito-svc Deployment, which calls Ollama, gopedia-svc, whoami-api, and otel-collector

cogito / infra.yaml

03

What path a single file takes

cogito-what.yaml

Text is extracted from the uploaded file, an LLM classifies it into a selector, then frontmatter is generated/merged. Content-hash based, so re-uploads upsert into whoami without creating duplicates.

cogito ingest pipeline: file upload flows through text extraction, LLM classification, frontmatter generation/merge, then handoff to whoami

cogito / what.yaml

04

How a commit becomes a deployment

cogito-ops.yaml

A git push webhook triggers toji-ci (Tekton), which delegates the build to dagger-engine and pushes the image to the registry. The ArgoCD Image Updater polls the registry directly for the digest change — unlike goquest/lymphhub's manifest-writeback flow, no PR is needed for the deploy to land.

cogito CI/CD: git push triggers toji-ci Tekton, which delegates to dagger-engine, pushes an image to the registry, and ArgoCD Image Updater detects the digest change and syncs the cogito-svc Application

cogito / ops.yaml

rendered via archview · d2lang/d2 · ELK layout