Skip to main content

CLARA: Code Language Assistant & Repository Analyzer 📜🔍🤖

Python 3.10 Code style: black

Clara is a tool to help developers understand and work with a code repository.

Note that creation of the vector database from the code is done only the first time you open the chat in the code repository. Subsequent chats will use the preloaded database, ensuring faster response times."

https://user-images.githubusercontent.com/538203/232823179-586ef7be-370c-4e65-8cf7-913d066ad2c3.mp4

This project is currently in its early stages of development and is considered a work in progress. You may encounter some issues, or incomplete features. We appreciate your understanding and patience as we continue to refine and enhance the project. Your feedback will help us improve and shape this project.

Overview

Clara is an AI-driven solution created to help developers effortlessly explore new or unfamiliar code repositories. It proves especially beneficial during the onboarding phase for new projects or when decoding legacy code.

Moving forward, Clara aims to offer assistance in various tasks, including documentation, auditing, and feature development, among others.

Features

  • Intelligent code and documentation analysis.
  • Integrated Database
    • Utilizes local storage through ChromaDB.
    • Maintains data persistence for individual code repositories.
    • Offers optional in-memory storage without persistence.
  • Context-aware short-term memory: Gathers information from ongoing conversations.

Install

With:

pipx install clara-ai

Or:

pip3 install clara-ai

Usage

Firstly, set an environment variable with your OpenAI API key:

export OPENAI_API_KEY="XXXXXX"

Then, use the command:

$ clara chat [PATH]

If the path is omitted then '.' will be used.

To exit use CTRL-D, or commands /quit or /exit.

All commands:

     ask
       Ask a question about the code from the command-line.

     chat
       Chat about the code.

     clean
       Delete vector DB for a given path.

     config
       Show config for a given path.

Chat commands

During chat you can also use this commands:

/context -- show the context for the last answer

/edit    -- open editor to edit the message

/quit
/exit    -- exit (you can use also CTRL-C or CTRL-D)

/help    -- show this message

Configuration

Run clara config to know from where the program is going to read the configuration. Usually this path is going to be /.config/clara/clara.yaml.

For now, there is only a couple of parameters. This is a sample configuration with the default values:

llm:
  model: gpt-3.5-turbo
index:
  # similarity or mmr
  search: similarity
  k: 5

Change the model for gpt-4 if you have access to it.

Cache

Vector DB and chat history are stored in a cache directory, per code analyzed. Use clara config to know the path to this directory.

You can remove manually this directory, if you want to refresh the data stored, or simply use the command clara clean.

If you want to chat with the code without reading/storing the vector DB (using the DB in memory), use the command clara [PATH] --memory-storage.

Roadmap

  • Short-term history
  • Configurable LLM
  • Agent
    • Access to filesystem
  • Features
    • Work with remote Git repositories
    • Document code with docstrings
    • Test creation
    • Audit code
    • Refactoring

Release files for clara-ai 0.0.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for clara-ai 0.0.10
File Size Uploaded
clara_ai-0.0.10.tar.gz 11.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for clara-ai 0.0.10
File Interpreter ABI Platform
clara_ai-0.0.10-py3-none-any.whl Python 3 none any Details

Total release size: 23.9 kB

Release files / clara_ai-0.0.10.tar.gz

Download URL clara_ai-0.0.10.tar.gz
Size 11.6 kB
Tags Source
SHA-256 checksum
How to use checksums
50810ae816f5880f8f2b1093950f7c4cff6f0a35302c8340c0dab02b583d3eaa
BLAKE2b-256 checksum
How to use checksums
efa05bdd7e9a2cc1d7c9cc0f815f64ca131bbc920fe3ac6c927c382e90b5a3b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.10.12 Linux/5.15.0-1040-azure

Release files / clara_ai-0.0.10-py3-none-any.whl

Download URL clara_ai-0.0.10-py3-none-any.whl
Size 12.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
49825941aa98980cbd5c67f4190e0883087ee93b1cca9d687072ed6fca2881e4
BLAKE2b-256 checksum
How to use checksums
ee3096265cf9ef5f10c903885637f037ffc6f6568aee19acc79fa06c669f67a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.10.12 Linux/5.15.0-1040-azure

Release history Release notifications | RSS feed

This release

0.0.10 This release

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page