Skip to main content

A Machine With Human-Like Memory Systems

Project description

humemai

DOI PyPI version

Image
  • Built on a cognitive architecture
    • Functions as the brain 🧠 of your own agent
    • It has human-like short-term and long-term memory
  • The memory is represented as a knowledge graph
    • A graph database (JanusGraph + Cassandra) is used for persistence and fastgraph traversal
    • The user does not have to know graph query languages, e.g., Gremlin, since HumemAI handles read from / write to the database
  • The interface of HumemAI is natural language, just like a chatbot.
    • This requires the Text2Graph and Graph2Text modules, which are part of HumemAI
  • Everything is open-sourced, including the database

Installation

Python Package

The humemai Python package is available on the PyPI server. You can install it using pip:

pip install humemai

For development purposes, use:

pip install 'humemai[dev]'

Supported Python Versions: Python >= 3.10

Docker Compose

To set up Docker Compose, follow these steps:

Update package lists

sudo apt-get update

Install Docker Compose

sudo apt-get install -y docker-compose

Text2Graph and Graph2Text

These two modules are critical in HumemAI. At the moment, they are achieved with LLM prompting, which is not ideal. They'll be replaced with Transformer and GNN based neural networks.

Example

  • example-janus-agent.ipynb: This Jupyter Notebook reads the Harry Potter book paragraph by paragraph and turns it into a knowledge graph. Text2Graph and Graph2Text are achieved with LLM prompting.
  • More to come ...

Docker Compose for JanusGraph with Cassandra and Elasticsearch

This project uses a docker-compose-cql-es.yml file to set up a JanusGraph instance with Cassandra, Elasticsearch, and other supporting services.

Key Points

  1. Unless you instantiate the Humemai class with a specified compose_file_path, it will always use the default docker-compose-cql-es.yml provided in the repository.
  2. Port numbers, container names, and other configurations are currently fixed. Future updates will make these configurable for running multiple instances on the same machine.
  3. The Docker Compose file starts four Docker containers:
    • janusgraph: The main JanusGraph instance.
    • cassandra: The backend storage for JanusGraph.
    • elasticsearch: The index/search backend for JanusGraph.
    • janusgraph-visualizer: A visualization tool for JanusGraph.
  4. Not all Docker images are the latest versions. Future work includes updating to the latest compatible versions.

Instructions

Start the Containers

Run the following command in the same directory as the docker-compose-cql-es.yml file:

docker-compose -f docker-compose-cql-es.yml up -d

Check the Status of Containers

Verify the running containers:

docker ps

You should see containers named:

  • jce-janusgraph
  • jce-cassandra
  • jce-elastic
  • jce-visualizer

Access the Services

  • JanusGraph Gremlin Server: Accessible at localhost:8182.
  • Elasticsearch: Accessible at localhost:9200.
  • Visualizer: Accessible at http://localhost:3000.

Stop the Containers

To stop the services:

docker-compose -f docker-compose-cql-es.yml down

Clean Up

If you want to remove the containers and associated volumes:

docker-compose -f docker-compose-cql-es.yml down --volumes

Future Work

  • Make port numbers, container names, and other configurations customizable.
  • Update Docker images to the latest compatible versions.
  • Add support for running multiple instances on the same machine.

Visualizaing Graph

HumemAI runs four docker containers with docker-compose and one of them is visualizer. Open your browser and type http://localhost:3001/. Rename "host" to jce-janusgraph and query the graph.

Work in progress

Currently this is a one-man job. Click here to see the current progress.

pdoc documentation

Click on this link to see the HTML rendered docstrings

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Run make test && make style && make quality in the root repo directory, to ensure code quality.
  4. Commit your Changes (git commit -m 'Add some AmazingFeature')
  5. Push to the Branch (git push origin feature/AmazingFeature)
  6. Open a Pull Request

Authors

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

humemai_research-2.5.1.post2.tar.gz (41.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

humemai_research-2.5.1.post2-py3-none-any.whl (43.9 kB view details)

Uploaded Python 3

File details

Details for the file humemai_research-2.5.1.post2.tar.gz.

File metadata

  • Download URL: humemai_research-2.5.1.post2.tar.gz
  • Upload date:
  • Size: 41.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for humemai_research-2.5.1.post2.tar.gz
Algorithm Hash digest
SHA256 ada65d792f07ffae71f26da29a76c06cb5ed18336a29a65f3f2a722bfb8679d6
MD5 e416d18b37ee03ecaaef2f21611d286b
BLAKE2b-256 7af02a60424d4703b8fb887f81129906d4ffd8060a10ae7325a0a88452949caa

See more details on using hashes here.

Provenance

The following attestation bundles were made for humemai_research-2.5.1.post2.tar.gz:

Publisher: publish-pypi.yml on humemai/humemai-research

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file humemai_research-2.5.1.post2-py3-none-any.whl.

File metadata

File hashes

Hashes for humemai_research-2.5.1.post2-py3-none-any.whl
Algorithm Hash digest
SHA256 5ab12a50749e6d5c601f0804b7cc1a7d24b2a08486c6f850f9cbda16349f6e50
MD5 81f2f7329a82cc1b96c15e8b1e55d35d
BLAKE2b-256 e7bdff33a076ddc07f63eecd1b52fe40b40009da9d86b9d8c924be718c3ba20f

See more details on using hashes here.

Provenance

The following attestation bundles were made for humemai_research-2.5.1.post2-py3-none-any.whl:

Publisher: publish-pypi.yml on humemai/humemai-research

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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