Post Processors
Process and enhance memory retrieval results with reranking, filtering, and AI-generated summaries
Post Processors
Post processors are the final stage in GoodMem's memory retrieval pipeline. They take the raw results from vector search and transform them into useful, contextual responses for your application.
What Post Processors Do
After GoodMem's vector search finds relevant memory chunks, post processors handle the additional steps listed below:
- Reranking - Reorder results using more sophisticated relevance models
- Filtering - Remove results below quality thresholds
- Chronological sorting - Organize results by creation time when helpful
- AI summarization - Generate contextual abstracts using LLMs
Think of post processors as a layer of computation that turns raw search results into useful answers.
Built-in Post Processor
GoodMem includes the ChatPostProcessor designed for conversational AI applications. It's optimized for:
- Question-answering scenarios
- Contextual memory retrieval
- AI assistant applications
- Chat-based interfaces
The ChatPostProcessor can rerank results, filter by relevance, sort chronologically, and generate conversational summaries using your choice of LLM.
How to Use Post Processors
Post processors are configured in your retrieve requests. You can use either the simple GET endpoint with query parameters or the advanced POST endpoint with JSON configuration.
Simple GET Request
curl -X GET "https://api.goodmem.ai/v1/memories:retrieve?message=What+is+GoodMem?&spaceIds=<space-id>&pp_llm_id=<llm-id>" \
-H "Authorization: Bearer <your-api-key>"Advanced POST Request
curl -X POST "https://api.goodmem.ai/v1/memories:retrieve" \
-H "Authorization: Bearer <your-api-key>" \
-H "Content-Type: application/json" \
-d '{
"message": "What is GoodMem?",
"spaceKeys": [{"spaceId": "<space-id>"}],
"postProcessor": {
"name": "com.goodmem.retrieval.postprocess.ChatPostProcessorFactory",
"config": {
"llm_id": "<llm-id>",
"relevance_threshold": 0.7
}
}
}'Custom Post Processors
Advanced users can implement custom post processors using Java and the ServiceLoader pattern. Custom processors must implement the PostProcessor interface and provide a corresponding PostProcessorFactory.
This enables specialized processing logic for:
- Domain-specific reranking algorithms
- Custom output formats
- Specialized filtering rules
- Integration with external services
Next Steps
- ChatPostProcessor Reference - Complete configuration guide with examples
- Memory Retrieval API - API reference for retrieve endpoints