classifier
Skill0 starsChanged 8 months agoMITView on GitHub
A Retrieval-Augmented Classification system implemented in Go using YZMA (llama.cpp) for local embeddings and PostgreSQL with pgvector as a vector database. The classifier binary supports several subcommands: When running in serve mode, the following tools are available to AI assistants: CLASSIFIER can be configured via config.yaml, environment variables, or CLI flags.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- srinidhis05/agenturatheir own version, first seen Feb 24, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- srinidhis05/agentura★ 9same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 38
When running in serve mode, the following tools are available to AI assistants:
- Distinctive: line 59
Build: No CGo required (yzma uses purego, pgx is pure Go).
- Very specific: line 70
Use get_topic to determine the intent or category of a user's query for routing to specialized agents.
- Distinctive: line 71
When adding entries, use representative phrases for each topic to improve classification accuracy.
- Very specific: line 72
Ensure YZMA_LIB is correctly set and the PostgreSQL server has pgvector enabled.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
classifier Skill
A Retrieval-Augmented Classification system implemented in Go using YZMA (llama.cpp) for local embeddings and PostgreSQL with pgvector as a vector database.
Capabilities
- Local Embeddings: Generates vector embeddings for text using GGUF models via llama.cpp.
- Automatic Prefixing: Prepends
classification:to text if missing for optimal model accuracy. - Topic Classification: Classifies user queries into topic names using vector similarity search in PostgreSQL.
- Vector Search: Performs similarity search using PostgreSQL's
pgvectorextension and HNSW indexing. - OpenAI-Compatible API: Provides a
/v1/chat/completionsendpoint for easy integration with existing LLM tools. - MCP Server: Exposes classification operations as Model Context Protocol (MCP) tools.
- Data Portability: Supports JSONL-based export and import of classification mappings.
Core Components
rag.go: Core RAG logic including embedding generation and PostgreSQL/pgvector operations.mcp_server.go: MCP server implementation and tool definitions.api.go: OpenAI-compatible HTTP API implementation.main.go: CLI entry point and handcrafted command registry.
Usage Guide
CLI Commands
The classifier binary supports several subcommands:
add <topic> <content>: Add a query-to-topic mapping to the classifier.query <text>: Classify the input text and return the best-matching topic.list: List all stored classification entries.delete <hash>: Remove an entry by its unique content hash.export <dir>: Export entries to JSONL files in the specified directory.import <dir>: Import entries from JSONL files in the specified directory.serve: Start both the OpenAI-compatible API and the MCP server.
MCP Tools
When running in serve mode, the following tools are available to AI assistants:
add_entry(topic, content): Adds a new classification mapping.get_topic(query_text): Classifies user input into a topic name.list_entries(): Shows all classification mappings in the database.delete_entry(hash): Removes a mapping from the system.
Configuration
CLASSIFIER can be configured via config.yaml, environment variables, or CLI flags.
Key Environment Variables
CLASSIFIER_MODEL: Path to the GGUF embedding model.YZMA_LIB: Path to thelibllamashared library (required).CLASSIFIER_DATABASE_URL: PostgreSQL connection string (e.g.,postgres://user@localhost:5432/db).CLASSIFIER_DEFAULT_TOPIC: Topic returned when no match is found (default:none).
Development and Build
- Requirements: Go 1.25+.
- Build: No CGo required (yzma uses purego, pgx is pure Go).
go build -o classifier . - Tests:
go test ./...
Best Practices for Agents
- Use
get_topicto determine the intent or category of a user's query for routing to specialized agents. - When adding entries, use representative phrases for each topic to improve classification accuracy.
- Ensure
YZMA_LIBis correctly set and the PostgreSQL server haspgvectorenabled. - For high-accuracy classification, consider using higher-dimensional models like T5Gemma 2-270M (640 dims).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

