potpie icon indicating copy to clipboard operation
potpie copied to clipboard

Implement inference caching while knowledge graph generation

Open dhirenmathur opened this issue 11 months ago • 4 comments

Implement Hash-Based Caching for Knowledge Graph Nodes

Objective

Optimize knowledge graph generation across branches by implementing hash-based caching for node inference and embeddings.

Current Behavior

  • Complete knowledge graph regeneration for each new branch
  • Redundant inference generation for unchanged nodes

Proposed Solution

  • Calculate and store hash for each node in graph
  • Compare node hashes between branches
  • Reuse inference and embeddings for matching hashes
  • Generate new inference only for modified nodes

Implementation

  1. Add hash generation for nodes
  2. Store hashes in graph structure
  3. Implement hash comparison system
  4. Add cache lookup before inference
  5. Copy matching node data from cache

Success Criteria

  • [ ] Hash generation working correctly
  • [ ] Cache hit/miss working as expected
  • [ ] Faster graph generation for similar branches
  • [ ] No loss in inference quality

dhirenmathur avatar Jan 09 '25 09:01 dhirenmathur

/bounty 10

dhirenmathur avatar Jan 09 '25 09:01 dhirenmathur

💎 $10 bounty • potpie.ai

Steps to solve:

  1. Start working: Comment /attempt #223 with your implementation plan
  2. Submit work: Create a pull request including /claim #223 in the PR body to claim the bounty
  3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

Thank you for contributing to potpie-ai/potpie!

Add a bountyShare on socials

Attempt Started (GMT+0) Solution
🟢 @onyedikachi-david Jan 26, 2025, 3:46:53 AM #231

algora-pbc[bot] avatar Jan 09 '25 09:01 algora-pbc[bot]

/attempt #223

Algora profile Completed bounties Tech Active attempts Options
@onyedikachi-david 14 bounties from 7 projects
TypeScript, Python,
JavaScript & more
Cancel attempt

onyedikachi-david avatar Jan 26 '25 03:01 onyedikachi-david

💡 @onyedikachi-david submitted a pull request that claims the bounty. You can visit your bounty board to reward.

algora-pbc[bot] avatar Jan 26 '25 03:01 algora-pbc[bot]