github run-llama/llama_index v0.5.0

latest releases: v0.11.14, v0.11.13, v0.11.12...
18 months ago

0.5.0 is here! This release contains a full list of breaking changes + migration tool + additional details.

General announcement: https://twitter.com/gpt_index/status/1640792019512745986?s=20
Docs: https://gpt-index.readthedocs.io/en/latest/

Breaking changes:

  • The index constructor now takes in Nodes instead of Documents. If you wish to use the previous API (where you feed in documents directly), you can use the from_documents class method.
  • We now use a ServiceContext container to wrap all these common arguments of passing in custom LLM’s, embedding models, chunk sizes, prompt helpers.
  • We now offer a new Composability API. This new interface better separates responsibilities between our graph objects and index objects.To compose a graph, use ComposableGraph.build_from_indices
  • To set the “id” for an index, please do index.index_struct.index_id = item (no more index.set_doc_id
  • To set the “summary” for an index, either directly specify it when initializing a graph in ComposableGraph.build_from_indices(subindices, summaries). Or, manually specify through index.index_struct.summary = item

Migration tool:

  • We added a tool to help migrated saved index json from 0.4.x to 0.5.0. Use it as python gpt_index/tools/migrate_v1_to_v2.py --v1_path <tree_v1.json> --index_struct_type <tree> --v2_path <tree_v2.json>

Additional details

  • data model
    • Node is now conceptually a chunk of document, unrelated to a specific index struct. This makes it easier to re-use nodes across indices.
    • It models relationship between chunks of document (e.g. chunk B comes after chunk A, image C is from document D), but does not model index struct specific relationships (e.g. parent / child relationship for a tree index).
  • storage: Nodes are now stored in DocumentStore instead of IndexStruct. This helps avoid storing copies when re-using nodes across indices.
  • querying: we introduce a new retrieve and synthesize API for query classes. This helps decouple selecting nodes (from the index struct), and synthesizing an answer. Note that this is not supported by all query classes yet, but will be gradually rolled out.
  • composability: We updated both the API and the internals of the composable graph to be more similar to other indices. It now uses a CompositeIndexStruct to represent the hierarchical index structures.

Don't miss a new llama_index release

NewReleases is sending notifications on new releases.