Memory library for building stateful agents
Go to file
Vineeth Voruganti 9ea87cdb71 Fly.io test 2024-01-18 08:37:43 -08:00
api Fly.io test 2024-01-18 08:37:43 -08:00
archive Merge branch 'main' into restification-v 2024-01-18 07:23:02 -08:00
example Postgres Support - Fixes DEV-86 2024-01-18 08:14:04 -08:00
sdk Documentation 2024-01-18 07:15:00 -08:00
.dockerignore Fly Deployment 2023-09-11 12:46:36 -04:00
.gitignore Postgres Support - Fixes DEV-86 2024-01-18 08:14:04 -08:00
LICENSE Initial commit 2023-09-10 17:29:55 -04:00
README.md Fly.io test 2024-01-18 08:37:43 -08:00
poetry.lock Update dependency and move to gpt-4-turbo 2023-12-12 17:39:34 -05:00

README.md

Honcho

Static Badge Discord GitHub License GitHub Repo stars X (formerly Twitter) URL

A User context management solution for building AI Agents and LLM powered applications.

Read about the motivation of this project here.

Project Structure

The Honcho repo is a monorepo containing the server/API that manages database interactions and storing data about an application's state along with the python sdk for interacting with the API.

The folders are structured as follows:

  • api/ - contains a FastAPI application that provides user context management routes
  • sdk/ - contains the code for the python sdk and package hosted on PyPI
  • example/ - contains example code for different use cases of honcho

This project utilizes poetry for dependency management

A separate changelog is managed for the sdk and api in their respective directories.

Usage

API

The API can be run either by installing the necessary dependencies and then specifying the appropriate environment variables.

  1. Create a virtualenv and install the API's dependencies
cd honcho/api/
source $(poetry run poetry env info --path)/bin/activate
poetry install
  1. Edit the .env.template file to specify the type of database and connection_uri. For testing sqlite is fine.

Honcho has been tested with Postgresql and SQLite

DATABASE_TYPE=sqlite
CONNECTION_URI=sqlite:///./honcho.db
  1. Run the API via uvicorn
cd honcho/api
source $(poetry run poetry env info --path)/bin/activate
python -m uvicorn src.main:app --reload

Docker

Alternatively there is also a Dockerfile included to run the API server from a docker container.

The .env file is not loaded into the docker container and should still be configured from outside.

cd honcho/api
docker build -t honcho-api .
docker run --env-file .env -p 8000:8000 honcho-api:latest

Deploy on Fly

The API can also be deployed on fly.io with the following commands:

cd honcho/api
fly launch

You can also add your secrets with the following shortcut command:

cat .env | fly secrets import

Client SDK

Install the honcho client sdk from a python project with the following command:

pip install honcho-ai

alternatively if you are using poetry run:

poetry add honcho-ai

checkout the example folder for examples of how to use the sdk

Build Locally

For local development of the sdk you can build the sdk using poetry with the following commands.

cd honcho/sdk
poetry build

This will generate a dist/ folder within the honcho/sdk directory. The dist/ will contain a wheel file. You can install the sdk in another local project by specifiying the path to the wheel file in your installation command.

pip install ./dist/honcho-ai-0.0.1-py3-none-any.whl

Contributing

This project is completely open source and welcomes any and all open source contributions. The workflow for contributing is to make a fork of the repository. You can claim an issue in the issues tab or start a new thread to indicate a feature or bug fix you are working on.

Once you have finished your contribution make a PR pointed at the staging branch, and it will be reviewed by a project manager. Feel free to join us in our discord to discuss your changes or get help.

Once your changes are accepted and merged into staging they will undergo a period of live testing before entering the upstream into main

License

Honcho is licensed under the AGPL-3.0 License. Learn more at the License file