Skip to content

Commit

Permalink
Prepare release for experimental kg creation (#112)
Browse files Browse the repository at this point in the history
* Update CHANGELOG

* Update docs

* Update docs

* Update CHANGELOG

---------

Co-authored-by: Alex Thomas <[email protected]>
  • Loading branch information
willtai and alexthomas93 authored Sep 3, 2024
1 parent 378c98d commit 42aa07c
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 14 deletions.
11 changes: 6 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,22 @@

## Next

### Added
- PDF-to-graph pipeline for knowledge graph construction in experimental mode
- Introduced support for Component/Pipeline flexible architecture.
- Added new components for knowledge graph construction, including text splitters, schema builders, entity-relation extractors, and Neo4j writers.
- Implemented end-to-end tests for the new knowledge graph builder pipeline.

### Changed
- When saving the lexical graph in a KG creation pipeline, the document is also saved as a specific node, together with relationships between each chunk and the document they were created from.

## 0.5.0

### Fixed
- Corrected the hybrid retriever query to ensure proper normalization of scores in vector search results.

## 0.4.0

### Added
- Add optional custom_prompt arg to the Text2CypherRetriever class.
- Introduced support for Component/Pipeline flexible architecture.
- Added new components for knowledge graph construction, including text splitters, schema builders, entity-relation extractors, and Neo4j writers.
- Implemented end-to-end tests for the new knowledge graph builder pipeline.

### Changed
- `GraphRAG.search` method first parameter has been renamed `query_text` (was `query`) for consistency with the retrievers interface.
Expand Down
2 changes: 1 addition & 1 deletion docs/source/user_guide_kg_builder.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ They can also be used within a pipeline:
from neo4j_genai.experimental.components.pdf_loader import PdfLoader
pipeline = Pipeline()
my_component = PdfLoader()
pipeline.add("component_name", my_component)
pipeline.add_component(my_component, "component_name")
Document Parser
Expand Down
4 changes: 2 additions & 2 deletions docs/source/user_guide_pipeline.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ Here's how to create a simple pipeline and propagate results from one component
from neo4j_genai.experimental.pipeline import Pipeline
pipe = Pipeline()
pipe.add_component("a", ComponentAdd())
pipe.add_component("b", ComponentAdd())
pipe.add_component(ComponentAdd(), "a")
pipe.add_component(ComponentAdd(), "b")
pipe.connect("a", "b", {"number2": "a.result"})
asyncio.run(pipe.run({"a": {"number1": 10, "number2": 1}, "b": {"number1": 4}))
Expand Down
2 changes: 1 addition & 1 deletion src/neo4j_genai/experimental/components/embedder.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class TextChunkEmbedder(Component):
embedder = OpenAIEmbeddings(model="text-embedding-3-large")
chunk_embedder = TextChunkEmbedder(embedder)
pipeline = Pipeline()
pipeline.add_component("chunk_embedder", chunk_embedder)
pipeline.add_component(chunk_embedder, "chunk_embedder")
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ class LLMEntityRelationExtractor(EntityRelationExtractor):
extractor = LLMEntityRelationExtractor(llm=llm)
pipe = Pipeline()
pipe.add_component("extractor", extractor)
pipe.add_component(extractor, "extractor")
"""

Expand Down
2 changes: 1 addition & 1 deletion src/neo4j_genai/experimental/components/kg_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class Neo4jWriter(KGWriter):
writer = Neo4jWriter(driver=driver, neo4j_database=DATABASE)
pipeline = Pipeline()
pipeline.add_component("writer", writer)
pipeline.add_component(writer, "writer")
"""

Expand Down
2 changes: 1 addition & 1 deletion src/neo4j_genai/experimental/components/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ class SchemaBuilder(Component):
]
pipe = Pipeline()
schema_builder = SchemaBuilder()
pipe.add_component("schema_builder", schema_builder)
pipe.add_component(schema_builder, "schema_builder")
pipe_inputs = {
"schema": {
"entities": entities,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class LangChainTextSplitterAdapter(TextSplitter):
pipeline = Pipeline()
text_splitter = LangChainTextSplitterAdapter(RecursiveCharacterTextSplitter())
pipeline.add_component("text_splitter", text_splitter)
pipeline.add_component(text_splitter, "text_splitter")
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class LlamaIndexTextSplitterAdapter(TextSplitter):
pipeline = Pipeline()
text_splitter = LlamaIndexTextSplitterAdapter(SentenceSplitter())
pipeline.add_component("text_splitter", text_splitter)
pipeline.add_component(text_splitter, "text_splitter")
"""

Expand Down

0 comments on commit 42aa07c

Please sign in to comment.