SciPhi-AI / R2R

The most advanced Retrieval-Augmented Generation (RAG) system, containerized and RESTful
https://r2r-docs.sciphi.ai/
MIT License
3.65k stars 270 forks source link

V3 graph implmentations #1593

Closed shreyaspimpalgaonkar closed 2 days ago

shreyaspimpalgaonkar commented 3 days ago

[!IMPORTANT] Refactor and enhance knowledge graph functionality by renaming triples to relationships, updating models, handlers, and API endpoints, and adjusting tests accordingly.

  • Behavior:
    • Renamed getTriples to getRelationships in r2rV2ClientIntegrationSuperUser.test.ts and r2rV2ClientIntegrationUser.test.ts.
    • Updated KGCreationSettings in models.tsx to use kg_relationships_extraction_prompt and max_knowledge_relationships.
    • Modified get_triples to get_relationships in kg.py.
    • Changed API endpoints in kg_router.py and graph_router.py to handle relationships instead of triples.
  • Models:
    • Replaced Triple with Relationship in __init__.py and other related files.
    • Updated CommunityReport to Community in abstractions/__init__.py.
  • Handlers:
    • Introduced PostgresRelationshipHandler and PostgresEntityHandler in kg.py.
    • Added methods for creating, updating, and deleting entities and relationships.
  • Pipes:
    • Renamed KGTriplesExtractionPipe to KGRelationshipsExtractionPipe in pipes/__init__.py.
    • Updated logic in community_summary.py and deduplication.py to handle relationships.
  • Prompts:
    • Updated graphrag_relationships_extraction_few_shot.yaml to reflect relationship extraction changes.
  • Tests:
    • Adjusted tests in test_kg_community_summary_pipe.py and test_kg_logic.py to align with new relationship handling.

This description was created by Ellipsis for 1cb66cf2e248280dd0ff47c55e086f3299519bc4. It will automatically update as commits are pushed.