Xilin Zhu
ContactAvailable for work
← AI Digital Twin

AI Digital Twin

Engineering log

From the original chat agent to a persistent document knowledge base

The original agent is now extended with document ingestion, multilingual retrieval, cited answers, and daily knowledge management. Local model training continues as a separate experiment; the public agent answers through DeepSeek.

Phase status

PhaseWhat it deliveredStatus
0 · SkeletonConfiguration, application structure, and a deployable LLM serviceComplete
1 · PersonaAn approved identity and speaking style for a first-person personal agentComplete
2 · BackendJSON and SSE replies, cancellation, retries, rate limiting, and cost controlsComplete
3 · FrontendAn embeddable Web Component with stream handling, retry, state recovery, and accessibilityComplete
4 · LaunchA working website deployment, readiness checks, and an actual rollback exerciseComplete
5 · ObservabilityAnonymous request metrics without storing raw conversationsComplete
6 · Local inferenceQuantised llama.cpp inference through the same provider interfaceCode and local verification complete; private trial
7 · Training from scratchSmall-model training experiments and the training-to-serving pipelineIn progress
8 · Knowledge basePersistent document ingestion, retrieval, citations, publication management, and background operationComplete for the local service and public website setup

What the RAG phase added

The management page accepts MD, TXT, PDF, and DOCX, identifies metadata, and submits background processing jobs. Text extraction preserves source locations; passages and locally generated embeddings are stored persistently. Hybrid semantic and keyword retrieval selects evidence from permitted current document versions.

The persona retains identity and style while documents hold changing project facts. JSON and streaming replies use the same evidence and citations. Visitors can expand the supporting passages on the website. Private preview and explicit publication are separate, with a public mirror for visitor answers.

Replacement, withdrawal, deletion, job retries, and fixed-password management make this usable beyond a demo upload. The static Render website connects through Tailscale Funnel to the local service, which starts silently after Windows login. DeepSeek serves public answers.

How completion was checked

The project page’s headline scores use a fixed fictional acceptance set in Chinese, English, and German. Retrieval is scored against document version, source location, and text. Answer quality comes from manual review of DeepSeek replies; the latest retrieval regression did not regenerate the whole answer set.

Offline backend tests were supplemented by isolated database checks for file formats, retries, versions, permissions, citations, and the public mirror. Real website calls, source interfaces, background startup, timed PDF processing, and restoration of an actual cold backup were checked separately.

Final fixes made technical questions about undergraduate projects reach the knowledge base, kept measured results ahead of background passages for result questions, and restored homepage controls when a stream ended without a completion event.

Model experiments continue

The local llama.cpp path with quantised Qwen3-4B works for private trials. The public service uses DeepSeek; the local model still needs better answer quality for that role.

Small decoder-only GPT training experiments are under way. Quantised export and integration into the serving interface remain later steps; the full training-to-production chain is still in progress.