Skip to main content

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

Project description

Perpetua

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 crucial for making 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 is a 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 help.

Agent Tools

Our agent is equipped with the following tools to answer your 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 privilege 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 a graph with the codebase's 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

Run pip install perpetua or brew tap samikh-git/tools and then brew install perpetua.

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: perpetua-0.1.4.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.4.tar.gz
Algorithm Hash digest
SHA256 b8dc7ddfb55ee2e1216aba3288d11d2607a6ea3eeee84558116ecf71115d896d
MD5 2b8ba17b3809c0274e8f4543f3e3ab00
BLAKE2b-256 93f2aa1b3cfc4c77e4cf5bb748bd39dc2b534ab0889f527836a675676af2bc3d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: perpetua-0.1.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 80c54d620490809ba4d2c800b84c8f8d755588e15804c15a8b74ed9fe99007c3
MD5 b66cd9560d8872ad8688abde06b7ad34
BLAKE2b-256 1c00e8d4ad1cc6295e3d472965e0c801caf7cc6918c79e2b0deb5cddbf1252ea

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