Skip to main content

Perpetua is a python package that creates agents that are context aware of your codebase.

Project description

Perpetua v. 0.1.0

Saturday, November 29, 2025

Perpetua is a command line tool that allows you to use an LLM to ask questions about the codebase in which you have initialized the Perpetua project.

Commands

Commands for this CLI have been copied from git, so they should be fairly intuitive for anyone who has operated with git. For exact documentation of the commands, please check this file

Configuring the package for your personal use.

perpetua config

This will allow you to set up your environment for the project. Make sure to run this before running any other command as they will not work.

You will be prompted for some API keys or names of the local models you want to use for this package.

Initializing the project

perpetua init

This initializes the .rag directory. This directory is curcial for naking Perpetua work as all of the files are kept here. Please do not modify the .rag directory unless you know what you are doing.

Adding files to the staging area

perpetua add path\to\file

Adds a file/directory to the staging area. This copies the file to the staging directory in the .rag directory. It will take a little time.

Committing

perpetua commit

This will vectorize each file you added to the staging area. It will then add the vectorized file to a milvus database in the .rag directory. You must execute this command before being able to interact with the LLM.

Status

perpetua status

This will give you a status of what files are currently staged.

Removing file from staging area

perpetua rm path\to\file

This will remove the file from the staging area.

Prompting the LLM

perpetua ask

This will open up chatting service that will allow you to query the LLM about your project. The LLM does not stream its response back so it will take some time before you see a response.

Currently, only Gemini is supported as the LLM. You will need to create a .env file with your Gemini API key in the folder for this package. Future versions will try to support more enterprise models as well as locally run models.

Miscellaneous commands

perpetua reset

This clears the staging area. With the --hard optional argument, it will reinitialize the project.

perpetua ls

It lists all files currently being tracked by the project

perpetua diff

It shows if there difference between staged files and their tracked versions. Ideally, more information can be provided in the future.

perpetua search "query"

Allows the user to query the vector store directly. This should be used as a sanity check or if you want to see some source code.

perpetua help

Provides a link to documentation to get helped.

Agent Tools

Our agent is equipped with the following tools to answer you questions:

  1. Vector store retrieval: this is classic RAG using a Milvus vector store contained within the .rag directory. Using this tool, the LLM is able to answer questions directly about your codebase. The agent is designed to privelege this tool over the others.
  2. Web Search: this tool is used by the LLM to search the web to answer your questions. As of now, it will answer any question by using this but it is intended to get documentation or most up-to-date information about the tools you are using.
  3. Knowledge Graph Search: this tool allows the agent to create create a graph with the codebases' structure. This should allow it to understand interdependencies between the different files and packages.

Tools in development:

  • database search: a tool that allows the agent to query any database given the URI to the database. This would be helpful for users to ask questions about their databases in the project without having to query it themselves.
  • file writing: cursor capability to edit files and make appropriate changes to files. This is probably too ambitious and will take time to be implemented.

Notes about the package

Dependencies

# Core dependencies
typer>=0.20.0,<0.21.0
rich>=13.0.0
python-dotenv>=1.0.0

# LangChain ecosystem
langchain>=0.1.0
langchain-core>=0.1.0
langchain-community>=0.0.20
langchain-text-splitters>=0.0.1
langchain-google-genai>=1.0.0
langchain-milvus>=0.1.0
langchain-tavily>=0.2.13,<0.3.0

# LangGraph
langgraph>=1.0.4,<2.0.0

You should also have a .env file with the following API keys:

GOOGLE_API_KEY=

TAVILY_API_KEY=

LOCAL= #True or False if you want to use a local model
LOCAL_MODEL= #the name of your local model you want to use. Make sure it is supported by langchain for tool calling!

# Optional: For evaluation and tracing
LANGSMITH_API_KEY=
LANGSMITH_TRACING=true
LANGSMITH_PROJECT=perpetua

The optional ones are recommended if you want to evaluate/debug the agent if you make any modifications.

Installation

Use the wheel in dist. This is the best way to use this project. Additionally, you can download it via pip.

Next steps

In order of importance

  • Explore Neo4J Graph RAG: maybe a graph is better suited for this project... Will look into this soon for next versions.
  • Adding more tools to the agent: ideally, some cursor capabilities would be great to be able to rewrite code.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

perpetua-0.1.2.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

perpetua-0.1.2-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

Details for the file perpetua-0.1.2.tar.gz.

File metadata

  • Download URL: perpetua-0.1.2.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.12.12 Darwin/25.0.0

File hashes

Hashes for perpetua-0.1.2.tar.gz
Algorithm Hash digest
SHA256 314d9780929a49efe088d86a1b3bb7144c6a541d966f45226f572a90237ea846
MD5 3936f335b226dd6a52ec1f0647ec6884
BLAKE2b-256 0f74574fd5147d047e1aa4b8dcd328b432e5b6577533257c0c994ccc0e2da7aa

See more details on using hashes here.

File details

Details for the file perpetua-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: perpetua-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 18.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.12.12 Darwin/25.0.0

File hashes

Hashes for perpetua-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6213857ad846a80369523f0b3674045dae465a0bbfb2d6d37c61566fdbdbd9bc
MD5 d88e7dbc5c799b2425172e78db6a96a3
BLAKE2b-256 c1d92622798da155081efd26c0f7a666f2d709688234b5218c60874f3b8d6448

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page