How beruk-ggg/buffy-searchbar works
Buffy Search Bar builds a searchable CTF-writeup index and serves semantic, lexical, and hybrid results through a small API. The main workflow is fetch → heading-based chunk → embed → cluster and generate RDF → load the built index → query and return matching writeups. The README also documents similarity, cluster and experimental concept endpoints. Relationships below follow the sampled build, search and service code; unsampled subsystems are represented only where the README supports them.
Main entry points: build.py Build orchestrator · app.py FastAPI service · search.py Search index · fetch.py Writeup fetch
Components 18
Index building
- Build orchestrator
pipeline/build.py - Writeup fetch
pipeline/fetch.py - Heading chunking
pipeline/chunk.py - Embedding and cache
pipeline/embed.py - Built index files
pipeline/build.py
Knowledge enrichment
- Technique clustering
pipeline/cluster.py - RDF graph builder
pipeline/rdf.py - CTF vocabulary
ontology/ctf.ttl
Search runtime
- Search index
pipeline/search.py - Hybrid retrieval
pipeline/search.py - Concept lookup
pipeline/search.py - Similar writeups
pipeline/search.py - Search evaluation
pipeline/evaluate.py
API and observability
- FastAPI service
service/app.py - Prometheus metrics
service/app.py
Other components
- Search user
- Site Drive proxy
- Metrics scraper
Connections 21
- Search user → FastAPI service: queries
README.md - FastAPI service → Search index: loads index
service/app.py - Build orchestrator → Writeup fetch: fetches
pipeline/build.py - Writeup fetch → Site Drive proxy: downloads writeups
pipeline/fetch.py - Build orchestrator → Heading chunking: chunks documents
pipeline/build.py - Build orchestrator → Embedding and cache: embeds chunks
pipeline/build.py - Build orchestrator → Technique clustering: clusters chunks
pipeline/build.py - Build orchestrator → RDF graph builder: builds graph
pipeline/build.py - RDF graph builder → CTF vocabulary: parses vocabulary
pipeline/rdf.py - Build orchestrator → Search evaluation: evaluates index
pipeline/build.py - Build orchestrator → Built index files: writes artifacts
pipeline/build.py - Search index → Built index files: loads artifacts
pipeline/search.py - Search index → Hybrid retrieval: runs search
pipeline/search.py - FastAPI service → Hybrid retrieval: searches query
service/app.py - FastAPI service → Concept lookup: requests concepts
service/app.py - FastAPI service → Similar writeups: requests neighbors
README.md - FastAPI service → Search index: lists clusters
service/app.py - Search index → Embedding and cache: embeds query
pipeline/search.py - Search evaluation → Search index: scores rankings
pipeline/evaluate.py - FastAPI service → Prometheus metrics: records requests
service/app.py - Metrics scraper → Prometheus metrics: scrapes metrics
README.md