Prompt Context Separator
Reproducible system prompt for use in agentic AI pipelines for preprocessing prompts to deconstruct them into prompt(s) and contextual data subelements
About This Project
Prompt-Context-Separator is a collection of system prompts, prompt variants, and a gold-standard reference dataset for splitting a user message into two structured fields: prompts, which are the discrete asks the user wants answered or performed, and context, which is background such as prior reasoning, motivation, constraints, and references to past work. A small prompt processing agent placed in front of a main model produces this separation, returning a JSON object with prompts and context arrays. The context chunks are written in the third person, prefixed with {{user}}, and kept to one idea per chunk. The repository includes zero-shot, one-shot, and few-shot structured-output prompts, a natural-language markdown variant, and specialised variants for targeted inference, vector memory, and dictated input, along with a shared schema definition.
The project is built around prompt engineering patterns for agentic AI pipelines. Its design routes the separated context to two destinations: the answering model, to focus its attention on the actual asks, and a vector database, where self-contained third-person facts can be embedded and retrieved as persistent memory. The included data/gold.csv and data/gold.jsonl files contain ten human-annotated rows derived from the Prompt-Separation dataset on Hugging Face, serving as canonical examples of correct separation. The JSONL form uses prompts and context lists that match the agent's output shape.
This project may be useful to developers building LLM routing, retrieval-augmented generation, or long-term memory features, and to prompt engineers evaluating how input decomposition affects response quality. It is released under the MIT license for code and prompts, with gold rows retaining the CC-BY-4.0 license of their upstream source.