-
-
Notifications
You must be signed in to change notification settings - Fork 195
Open
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
Chunk
model to link to the newContext
model instead of handling entity relations directly. - Migrate existing data from
Chunk
toContext
to 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
Context
model with required fields and generic relation to OWASP entities. - Update
Chunk
model to referenceContext
. - Write migration to move existing
content_type
andobject_id
fromChunk
toContext
. - Update any code paths that rely on
Chunk.content_object
to useChunk.context
. - Add tests to ensure data integrity and backward compatibility.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
In progress