Metadata-Version: 2.4
Name: perpetua
Version: 0.1.2
Summary: Perpetua is a python package that creates agents that are context aware of your codebase.
Author: Sami Khayatei Houssaini
Author-email: sami_houssaini@berkeley.edu
Requires-Python: >=3.10,<=3.14
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: langchain (>=1.1.0,<2.0.0)
Requires-Dist: langchain-community (>=0.0.20,<1.0.0)
Requires-Dist: langchain-core (>=1.1.0,<2.0.0)
Requires-Dist: langchain-google-genai (>=3.2.0,<4.0.0)
Requires-Dist: langchain-milvus (>=0.3.0,<0.4.0)
Requires-Dist: langchain-ollama (>=0.1.0)
Requires-Dist: langchain-tavily (>=0.2.13,<0.3.0)
Requires-Dist: langchain-text-splitters (>=1.0.0,<2.0.0)
Requires-Dist: langgraph (>=1.0.4,<2.0.0)
Requires-Dist: langmem (>=0.0.30,<1.0.0)
Requires-Dist: networkx (>=3.0.0,<4.0.0)
Requires-Dist: python-dotenv (>=1.0.0,<2.0.0)
Requires-Dist: rich (>=14.2.0,<15.0.0)
Requires-Dist: tree-sitter (>=0.21.0,<0.22.0)
Requires-Dist: tree-sitter-languages (>=1.9.0,<1.10.0)
Requires-Dist: typer (>=0.20.0,<0.21.0)
Description-Content-Type: text/markdown

# 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](docs.md)

### Configuring the package for your personal use.

```bash
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
```bash
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

```bash
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

```bash
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

```bash
perpetua status
```

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

### Removing file from staging area

```bash
perpetua rm path\to\file
```

This will remove the file from the staging area.

### Prompting the LLM

```bash
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

```bash
perpetua reset
```

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

```bash
perpetua ls
```

It lists all files currently being tracked by the project

```bash
perpetua diff
```

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

```bash
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.

```bash
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

```py
# 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: 

```bash
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.

