MagickMind
PythonModels

Corpus (v1)

Reference for magick_mind.models.v1.corpus.

magick_mind.models.v1.corpus

Corpus models for Magick Mind SDK v1 API.

Provides Pydantic models for corpus (knowledge base) management. Corpus represents a collection of artifacts that can be used for RAG (Retrieval Augmented Generation) workflows.

Corpus

class Corpus(BaseModel)

Canonical corpus model representing a knowledge base.

A corpus is a collection of artifacts (documents, files) that can be used for semantic search and retrieval augmented generation.

CreateCorpusRequest

class CreateCorpusRequest(BaseModel)

Request for creating a new corpus.

ListCorpusResponse

class ListCorpusResponse(BaseModel)

Response for listing corpus.

Matches the API's {data: list[Corpus], paging: PageInfo} structure.

UpdateCorpusRequest

class UpdateCorpusRequest(BaseModel)

Request for updating an existing corpus.

DeleteCorpusResponse

class DeleteCorpusResponse()

Response for deleting a corpus.

The API returns 204 No Content with no response body.

AddArtifactsRequest

class AddArtifactsRequest(BaseModel)

Request for adding artifacts to a corpus.

AddArtifactsResponse

class AddArtifactsResponse(BaseModel)

Response for adding artifacts to a corpus.

ArtifactStatus

class ArtifactStatus(BaseModel)

Status of an artifact in a corpus.

status

PENDING, PROCESSING, PROCESSED, FAILED

ListArtifactStatusesResponse

class ListArtifactStatusesResponse(BaseModel)

Response for listing artifact statuses.

QueryCorpusRequest

class QueryCorpusRequest(BaseModel)

Request for querying a corpus.

Entity

class Entity(BaseModel)

An entity extracted from the knowledge graph.

Relationship

class Relationship(BaseModel)

A relationship between entities in the knowledge graph.

Chunk

class Chunk(BaseModel)

A text chunk retrieved from the corpus.

Reference

class Reference(BaseModel)

A reference to a source document.

QueryMetadata

class QueryMetadata(BaseModel)

Metadata about the query execution.

QueryCorpusResponse

class QueryCorpusResponse(BaseModel)

Response for querying a corpus.

Contains both the legacy JSON result string and structured fields. The structured fields are populated when the server supports them.

IngestionStatus

class IngestionStatus(BaseModel)

Ingestion status for an artifact within a corpus.

Represents the processing state of an artifact after it has been added to a corpus for indexing.

CorpusArtifactItem

class CorpusArtifactItem(BaseModel)

Combined artifact and its ingestion status within a corpus.

Returned by the list_artifacts endpoint, pairing the artifact metadata with its current ingestion state.

IngestResult

class IngestResult(BaseModel)

Result of a corpus ingest operation.

Returned by the convenience ingest methods (ingest, upload_and_ingest, ingest_and_poll). Combines the artifact and corpus identifiers with the current ingestion status so callers have a single object to inspect after any ingest path.

On this page