Skip to content

Add SQLite tools #751

@njhale

Description

@njhale

Overview

Add a set of tools that allow agents to execute SQLite statements and queries against a thread-scoped SQLite database.

Details

(from a conversation with @cjellick)

  • The tool should be structured around the use case of having DB associated to an otto thread.
  • The tool should be loading and/or writing a sqlite file on every tool call. In hosted environments, this will actually be writing all the way to S3. That may cause lag, but that’s where we want to start and see how bad it is.
  • The inputs and output of the tool should be “raw”, meaning we want the tool to accept sql(lite) statements and return sql output. It’ll be up to the calling agent/gptscript to form the query & format the response.
  • Generally, we want markdown tables to be the default way the agent outputs data from queries.
  • The tool’s context should be where the “magic” happens to the calling agent know how to use it. It should do things like:
    • Tell the LLM it can create and modify tables and should do so on demand.
    • Dump the DB schema into the context so the llm knows its form. Maybe even a row from each table?
  • The goal is that the user shouldn’t really see the sql. They should be able to ask things in natural language and should see results as markdown tables.
  • Not too important to the impl, but FYI if we ran this in a SaaS, we might use turso (sqlite saas) to back it
  • Tool should support creating and modifying tables and rows. Probably delete rows and tables too (but that randomly seems scary to me 🤷)
  • A sample user message for this: “List my emails and store them in a table with these columns...”

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions