A Machine With Human-Like Memory Systems
Project description
humemai
- 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
- Unless you instantiate the
Humemaiclass with a specifiedcompose_file_path, it will always use the defaultdocker-compose-cql-es.ymlprovided in the repository. - Port numbers, container names, and other configurations are currently fixed. Future updates will make these configurable for running multiple instances on the same machine.
- 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.
- 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-janusgraphjce-cassandrajce-elasticjce-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.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Run
make test && make style && make qualityin the root repo directory, to ensure code quality. - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Authors
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file humemai_research-2.4.1.post2.tar.gz.
File metadata
- Download URL: humemai_research-2.4.1.post2.tar.gz
- Upload date:
- Size: 40.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fcb0b3fe30f291dfee7a2856514388bb0d05ac0fa4be8e641a59e34bcfeafef5
|
|
| MD5 |
8a243006ca1444b53ac26073ef81b78f
|
|
| BLAKE2b-256 |
3d41bef4f5cefdf711c545620c774d86fd8c9eb0060cf14be1e3dff920c9aac3
|
Provenance
The following attestation bundles were made for humemai_research-2.4.1.post2.tar.gz:
Publisher:
publish-pypi.yml on humemai/humemai-research
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
humemai_research-2.4.1.post2.tar.gz -
Subject digest:
fcb0b3fe30f291dfee7a2856514388bb0d05ac0fa4be8e641a59e34bcfeafef5 - Sigstore transparency entry: 685332648
- Sigstore integration time:
-
Permalink:
humemai/humemai-research@e706b348ee4571d5173005d561b25100351b3b2b -
Branch / Tag:
refs/tags/v2.4.1.post2 - Owner: https://github.com/humemai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@e706b348ee4571d5173005d561b25100351b3b2b -
Trigger Event:
release
-
Statement type:
File details
Details for the file humemai_research-2.4.1.post2-py3-none-any.whl.
File metadata
- Download URL: humemai_research-2.4.1.post2-py3-none-any.whl
- Upload date:
- Size: 43.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be45d94bc694fd99b468f665af6193c230d9e4977038623085b21b729a4133bf
|
|
| MD5 |
39234b7db2e54b42cfaea42e830a0392
|
|
| BLAKE2b-256 |
a9d0354aeb86f41a7fad731358e9c5cf2cfdeeadf52a8eb87d76dd5b0bd861c9
|
Provenance
The following attestation bundles were made for humemai_research-2.4.1.post2-py3-none-any.whl:
Publisher:
publish-pypi.yml on humemai/humemai-research
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
humemai_research-2.4.1.post2-py3-none-any.whl -
Subject digest:
be45d94bc694fd99b468f665af6193c230d9e4977038623085b21b729a4133bf - Sigstore transparency entry: 685332650
- Sigstore integration time:
-
Permalink:
humemai/humemai-research@e706b348ee4571d5173005d561b25100351b3b2b -
Branch / Tag:
refs/tags/v2.4.1.post2 - Owner: https://github.com/humemai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@e706b348ee4571d5173005d561b25100351b3b2b -
Trigger Event:
release
-
Statement type: