-
-
Notifications
You must be signed in to change notification settings - Fork 238
Closed
Description
Is your feature request related to a problem? Please describe.
We want to extend the OWASP Nest AI application to introduce NestBot AI Assistant functionality. This will require a new model for storing contexts, which are generated text entries that can optionally be linked to specific OWASP entities (e.g., Projects, Chapters, Committees).
Describe the solution you'd like
Currently, this relationship is handled directly in the Chunk model using a generic foreign key:
content_object = GenericForeignKey("content_type", "object_id")
content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE, blank=True, null=True)Proposed Changes
Create a new Context model to store:
- Generated text
- Optional relation to OWASP entities via
GenericForeignKey - Metadata (timestamps, source, etc.)
- Update the
Chunkmodel to link to the newContextmodel instead of handling entity relations directly. - Migrate existing data from
ChunktoContextto ensure backward compatibility.
Goals
- Centralize the management of AI-generated contexts.
- Provide a scalable foundation for NestBot AI Assistant to handle context-aware responses.
- Decouple content chunks from OWASP entities to improve maintainability and future extension.
Tasks
- Define
Contextmodel with required fields and generic relation to OWASP entities. - Update
Chunkmodel to referenceContext. - Write migration to move existing
content_typeandobject_idfromChunktoContext. - Update any code paths that rely on
Chunk.content_objectto useChunk.context. - Add tests to ensure data integrity and backward compatibility.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done