Chapter 04

AI-assisted IFC editing preparation

Prepare the information that the AI editing workflow needs: the failed IDS context, structured model knowledge, project documents, embedded vector chunks, and retrieved evidence for generation.

Understand the AI editing workflow

AI-assisted editing starts from a checked IDS result. Select or inspect the failed requirement first, then prepare the knowledge that explains the model, the rule, and the project context before asking the LLM to generate an edit.

Check before editing. Treat generated edits as draft operations. Review the failed IDS row, the selected model object, and the generated command list before running a script against the IFC model.

Detailed requirement and value comparison view used as AI editing context

  • Failure context. The selected IDS row identifies what should be fixed.
  • Model context. Entity, attribute, property, relation, and GUID information connects the failure to an IFC object.
  • Knowledge context. Structured files and project documents provide the material used in the prompt.

Understand the two knowledge areas

The Generation tab contains two different kinds of knowledge. Keep them separate when reading the interface.

Generation tab with project knowledge and structure generation knowledge panels

  • Project Knowledge. Uploaded project documents such as specifications, inspection notes, or other project files.
  • Structure Generation Knowledge. Extracted files created from IFC definitions, model properties, IDS segments, pruned checking results, tips, and IfcOpenShell API definitions.
  • Chat with LLM. The area that consumes selected knowledge and produces generation requests.

Review structure generation knowledge

The structure generation table lists system-generated knowledge files. Select the files that are relevant to the current IDS failure before previewing or sending a request.

Structure generation knowledge table with selected knowledge files

  • Checkboxes. Include or exclude individual knowledge files.
  • Eye icon. Open the selected file in a preview panel.
  • Delete icon. Remove a file from the current session.
  • IFC Definitions and IfcOpenShell Definitions. Add more reference knowledge through pop-up dialogs.

Preview the files when you are unsure what will be sent to the LLM. The preview is especially useful for long definition files.

Preview panel for a selected knowledge file

Upload project documents

Project documents are uploaded by the user. They can be embedded into the vector database and later retrieved through RAG.

API key reminder. If embedding reports that an API key is missing, open Load the LLM and set a temporary key before trying again.

Project Knowledge table with uploaded documents

  • Add Files. Upload project documents to the current browser session.
  • Database icon. Embed the selected document into a vector database.
  • Eye icon. Preview a document.
  • Delete and Delete All. Remove individual files or clear the list.

Select the document row before embedding or previewing it. Uploaded files are isolated to the current browser session.

Selected project document ready to embed or preview

Embed project documents

Embedding turns an uploaded document into vector chunks that can be searched later. Open the embedder settings from the database icon in Project Knowledge.

Embedder settings dialog

  • Chunk Size. Controls the maximum text length per chunk.
  • Chunk Overlap. Keeps context across adjacent chunks.
  • Embedding Model. Chooses the embedding model.
  • Vector Dimensionality. Uses the model's vector size.
  • Target database. Sends project documents to the Project Knowledge database and API definitions to the IfcOpenShell API database.

A successful embed reports the processed file and the number of chunks written. If embedding fails, the toast shows the returned error; a missing OpenAI key is the most common cause when using OpenAI embeddings.

Toast showing embedding success for a project document

Toast confirming document processed into chunks

Toast showing embed failure because OpenAI API key is required

Verify the vector database

After embedding, open the RAG Vector Database tab and refresh the table. The embedded document should appear with its chunk count.

RAG Vector Database table listing embedded document and chunks

  • FileName. The embedded document name.
  • Date. When the document was embedded.
  • Chunks. Number of vector chunks available for retrieval.
  • Action icons. Preview metadata or delete a database entry.

The preview action opens database metadata. Use it to confirm document hashes, chunk information, and original source paths.

Preview panel showing vector database metadata JSON

Retrieve knowledge with RAG

Retrieval should be done after the table confirms that the document exists in the vector database. Use a focused query tied to the IDS failure or project specification.

RAG retrieval query and returned knowledge chunks

  1. Select the Project Knowledge database when querying uploaded project documents.
  2. Refresh the table if it was open before embedding.
  3. Enter a focused query related to the IDS failure or project specification.
  4. Choose the number of documents and chunks to retrieve.
  5. Run retrieval and inspect the returned chunks before generating a request.