LogoLogo
  • 👋Welcome to Groclake
  • ⏩Jump right in
  • 🗣️Introduction to Groclake
  • 🧠High level Concepts
    • Agent Discovery
    • Agent Registry
    • Agent Communication
      • Agent Text Transfer Protocol - ATTP
    • Agent Security
      • Agent Private Cloud - APC
      • Authentication & Encryption
      • Zero Trust Policy
  • 💽Installation & Guide
  • 🏗️Groclake Use Cases
  • 📰Groclake Records
  • Example Codes
  • GrocAgent
    • What is GrocAgent?
    • Example Chat Agent
    • Reflections in GrocAgent
      • Workflow of Reflection Handler
  • Lakes
    • 💾Data & Model Management
      • Datalake
        • Create Datalake
        • Retrieve Document
        • Upload Documents
        • Datalake Connections
          • Snowflake integration
      • Vectorlake
        • Creating vector
        • Generating Vector
        • Pushing Vector
        • Retrieve Document
        • Searching Vector
      • Modellake
        • Create Modellake
        • Language Translation
        • Conversation AI
        • Text to Speech
        • Chat Completion
      • Knowledgelake
        • Create Knowledge Base
        • Push Documents from a URL
        • Push Documents from Local Storage
        • Searching for Information
    • ⚒️Tool Management & Gateway
      • Toollake
        • Tools
        • Salesforce CRM Integration
        • Slack Communication Module
        • New Relic Integration
        • Google Calendar Integration
          • Check Slot Availability
          • Get Available Slots
          • Delete Event
          • Create new event
          • Create new calendar event
    • 🤖Agent Management & Deployment
      • Agentlake
        • Register your agent
        • Fetch agent details & categories
        • Create Agent Private Cloud (APC)
        • Assign Agent Private Cloud (APC) to an Agent
      • Promptlake
        • Setting Connection & Initializing
        • Storing a Prompt
        • Fetching a Prompt
        • Example API Calls
      • Memorylake
        • Context Component Examples
        • Value Structure
        • Setup & Guide
        • Storing & Retrieving Memory
        • Wildcard Search
        • Updating Memory Quality
    • 🗃️Index Stores
      • Cataloglake
        • Create catalog
        • Generate Product Data
        • Fetch Catalog Data
        • Push Product Data
        • Optimize Data Retrieval with Catalog Caching
        • Search for Products
        • Filter Product Search
        • Update Product Data
        • Recommend Products Based on Product Name
        • Update Inventory in Catalog
        • Fetch Inventory Details from Catalog
        • Fetch Product Price
        • Update Product Price in Catalog
        • Cache Image in Catalog
        • Sync Your Catalog with external ecomm platforms
        • Deleting items
        • Address Parsing and Intent Extraction
        • Creating Mapper
        • Convert Mapper's Metadata
        • Fetching Mapper
        • Updating Mapper
        • Example use case of Cataloglake
      • Joblake
        • Joblake Mapping
        • Creating a Joblake
      • Resumelake
        • Resumelake Mapping
        • Creating a Resumelake
Powered by GitBook
On this page
  • 1. Setting Up the Datalake Connection
  • 2. Initializing Promptlake
  1. Lakes
  2. Agent Management & Deployment
  3. Promptlake

Setting Connection & Initializing

1. Setting Up the Datalake Connection

Before using Promptlake, a MongoDB connection must be established within Datalake.

from config import Config
from dotenv import load_dotenv
from groclake.datalake import Datalake

load_dotenv()

class DatalakeConnection(Datalake):
    def __init__(self):
        super().__init__()
        MONGODB_CONFIG = Config.MONGODB_CONFIG
        MONGODB_CONFIG['connection_type'] = 'mongo'

        self.test_pipeline = self.create_pipeline(name="test_pipeline")
        self.test_pipeline.add_connection(name="mongodb_connection", config=MONGODB_CONFIG)
        self.execute_all()

        self.connections = {
            "mongodb_connection": self.get_connection("mongodb_connection")
        }

    def get_connection(self, connection_name):
        return self.test_pipeline.get_connection_by_name(connection_name)

# Initialize the connection
datalake_connection = DatalakeConnection()
mongodb_connection = datalake_connection.connections["mongodb_connection"]

What This Does

  • Initializes a Datalake instance.

  • Sets up MongoDB as a connection inside a data pipeline.

  • Executes all configured connections and stores them in a dictionary for easy access.


2. Initializing Promptlake

After setting up the Datalake connection, Promptlake can be initialized.

class Promptlake:
    def __init__(self):
        self.mongodb_connection = mongodb_connection
  • This class provides structured methods for storing and retrieving prompts.

  • It directly interacts with the MongoDB connection from Datalake.

PreviousPromptlakeNextStoring a Prompt

Last updated 2 months ago

🤖