Skip to content

feat: Create an additional ingest function with selective output for performance optimization #401

Open
@yogur

Description

@yogur

What?

Create a new ingest function that returns a single selectable output, that's one of summary, tree, or content.

For example:

summary = selective_ingest("/some/path", output="summary")
tree = selective_ingest("/some/path", output="tree")
content= selective_ingest("/some/path", output="content")

Why?

This optimizes performance, especially if you are calling the ingest function over and over.

One use case I have in mind is configuring gitingest as an LLM tool for an AI agent that parses source code. If the agent wants to optimize for its context window, it can decide what sections of the code to grab based on fetching the summary and tree multiple times on the parent directory and sub-directories to explore the code. It can then finally fetch content selectively.

With the current ingest function, all three outputs are always computed and returned in the Tuple, which could affect performance for large code bases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    suggestionNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions