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.1.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.1-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: perpetua-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 ddb975f49e665ebb34778a8f5077961d3ed9939a0fc41993f645be7d674b52e5
MD5 d1e3207babf9b607756f5481d751623c
BLAKE2b-256 762d02f511873186cc3f62bd4b2527fe4af7a97fa9f216f07811594a67e6debf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: perpetua-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 eef6ec5678ff91153dcb0c778a908b7be669083ea8bb6310ba1037a90fda5f21
MD5 559c4c748a8cf7b1b0237e4a92ff9bb8
BLAKE2b-256 65805f8b21912f443c3caa89dcee50edbd149d9511039a638784be65a4f57012

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