Knowledge pipeline
Converted MySQL records and Markdown files into separately indexed, searchable knowledge.
A source-grounded legal assistant for finding regulations through natural-language conversation.

JDIH chatbot answering a question about minimum wage regulations
Screenshot 1 of 3
Legal search without exact keywords
The JDIH Jawa Timur Chatbot is a production legal assistant on the JDIH Jawa Timur website. It helps people find regulations, legal documents, and institutional information through everyday questions, even when they do not know a document's official title, category, or terminology.
Each request is routed according to intent. Regulation searches combine semantic retrieval, BM25, metadata filters, and Reciprocal Rank Fusion. Questions about services, procedures, organizational structure, and contacts use a separate knowledge collection. The chatbot answers from retrieved context and returns document references when relevant.
I built the system end to end, from ingesting MySQL records and Markdown content to deploying the FastAPI and LangGraph workflow. I also implemented CMS synchronization, SSE responses, rate limits, retries, timeouts, and LangWatch monitoring for production use.
The existing keyword search worked when users knew a regulation's exact title, category, or terminology. It could not interpret conversational questions or retrieve documents based on meaning.
General information about services, procedures, organizational structure, and contacts was also distributed across separate parts of the website.
People often knew the topic they needed, but not the official name of the regulation.
Legal records and general JDIH guidance required different search behavior.
I made the main architecture decisions and independently implemented the system from ingestion through deployment. My work covered retrieval, LangGraph orchestration, API delivery, CMS synchronization, production safeguards, and LangWatch monitoring.
Converted MySQL records and Markdown files into separately indexed, searchable knowledge.
Combined semantic search, BM25, metadata filters, Reciprocal Rank Fusion, query rewriting, and LangGraph routing.
Implemented FastAPI endpoints, SSE streaming, CMS synchronization, rate limiting, timeouts, retries, and production monitoring with LangWatch.
The system keeps regulations intact as structured documents, while longer general-information files are split into overlapping chunks. Query rewriting preserves conversational context before LangGraph routes each request to the appropriate retrieval strategy.
MySQL + Markdown
Legal records and general JDIH information
Titan Embeddings v2
Structured records and recursive chunks
ChromaDB
Separate regulation and information collections
FastAPI + SSE
Receives and streams the conversation
Query rewriter
Restores context from earlier turns
LangGraph router
Regulation, general information, or chat
Hybrid retrieval
Semantic + BM25 + metadata + RRF
Amazon Bedrock
Generates from retrieved context
Grounded response
Answer with JDIH document references
Semantic and lexical rankings are fused at a default 60:40 weighting. Exact regulation identifiers shift more weight toward BM25.
Regulations retain complete metadata, while Markdown content uses 1,000-character chunks with 200-character overlap.
686
production traces analyzed
February 20 to August 11, 2026
84.4%
routed to regulation or JDIH retrieval
640 traces with identifiable routes
5.8s
median end-to-end latency
75% completed within about 7.9s
96.5%
of traces completed without a top-level error
across all observed traces
6.0% errors
February
1.6% errors
March
0% errors
April to August
198 observed traces
Trace findings informed changes to timeout handling, asynchronous execution, database connections, Bedrock retries, and TCP keepalive settings.
Most observed interactions matched the chatbot's intended purpose: retrieving regulations or JDIH information. Of 164 identified sessions, 53.7% contained at least two turns, so multi-turn use was common in the observed sessions.
These results describe routing, usage, latency, and recorded runtime errors. They do not claim factual-answer accuracy or user satisfaction.
53.7% of 164 identified sessions contained at least two turns.
8 of 10 regulation-oriented queries in the latest structured subset returned concrete JDIH references.
After a user discussed a proposed regulation, the query rewriter reconstructed the missing subject before retrieval.
terkait rancangan no 1, siapa pemrakarsa nya?
Terkait Rancangan Peraturan Daerah Provinsi Jawa Timur tentang Pelindungan dan Pemberdayaan Pembudi Daya Ikan dan Petambak Garam Nomor 1, siapa pemrakarsa nya?
Legal records change through CMS updates, and answers need traceable sources. Keeping this knowledge retrievable makes updates and document references easier to manage.
Embeddings handle conversational intent, while BM25 and metadata preserve sensitivity to regulation numbers, years, categories, and legal terminology.
LangWatch traces let me inspect routing, retrieval, latency, and failures. That evidence guided changes to timeout handling, database connections, and Bedrock retries.
Next project
A video pipeline that finds promising moments, reframes them for social formats, and renders animated subtitles.