Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Basic Tool Library for Storing and Retrieving Generated Code #97

Open
matiasmolinas opened this issue Jan 10, 2025 · 0 comments

Comments

@matiasmolinas
Copy link

Description
We need a lightweight “tool library” to manage the code snippets (i.e., “tools”) that an agent generates on demand. This library will keep track of each tool’s description, code, and basic usage stats, making it easy to retrieve and update existing tools without scattering them across the codebase.

Key Requirements

  1. CRUD Operations (Create, Read, Update, Delete)

    • A mechanism to insert new code snippets (e.g., from an LLM prompt).
    • Ability to read or search for existing tools by ID or metadata.
    • Ability to update an existing tool’s code or metadata (e.g., increment success counters, mark it deprecated, etc.).
    • Ability to remove outdated or broken tools.
  2. Data Model

    • Each tool entry should have at least:
      • id (unique identifier)
      • description (plaintext describing the tool’s purpose)
      • code (the actual script/snippet)
      • timestamp (when it was created or last updated)
      • success/fail counters (or similar usage metrics)
  3. Storage Options

    • For now, a simple JSON file, SQLite DB, or in-memory data structure is sufficient.
    • We should keep the design flexible so future enhancements can move this to a more robust storage layer if needed.
  4. Retrieval by Metadata

    • Provide methods to query or filter by tool name, version tags, or success/fail counters.
    • Return a consistent data structure that can be consumed by the agent or a developer interface.

Acceptance Criteria

  • A tool library implementation (class, module, or service) that offers create_tool, get_tool, update_tool, and delete_tool methods.
  • Each tool is stored with the required metadata fields (at least id, description, code, timestamp, success/fail counters).
  • Option to retrieve a tool by ID or by partial metadata (e.g., tool_name, tags), returning the relevant entries in a structured format.
  • Simple logs or console output for each CRUD action (e.g., “Created tool with ID=xyz at 12:34 PM”).

Additional Context

  • In later stages, this library can be integrated with more advanced governance, version control, or multi-agent scenarios.
  • If we’re building a minimal “proof of concept,” a local JSON or SQLite-based approach might be enough. It’s straightforward to extend or replace later.

If this approach looks good, I’ll start drafting a PR to implement a small, self-contained tool library that meets these requirements!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant