Skip to content

Commit

Permalink
Merge branch 'master' into issue-166-link-creation-client
Browse files Browse the repository at this point in the history
  • Loading branch information
eddiebrissow authored Jan 29, 2025
2 parents 0ec451a + 5e18cf8 commit 780df6c
Show file tree
Hide file tree
Showing 12 changed files with 82 additions and 333 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ run-attention-broker:
cd src && bash -x scripts/run.sh attention_broker_service 37007

run-link-creation-agent:
cd src && bash -x scripts/run.sh link_creation_server
@bash -x src/scripts/run.sh link_creation_server $(OPTIONS)
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ The following components are included in this repository:

C++ server which perform Pattern Matching queries.

Documentation: [Read more](docs/components/query-agent.md)
Documentation: [Read more](src/cpp/query_engine/README.md)

- **Attention Broker**
A DAS component that tracks atom importance values in different contexts and updates those values based on user queries using context-specific Hebbian networks.

Documentation: [Read more](docs/components/attention-broker.md)
Documentation: [Read more](src/cpp/attention_broker/README.md)

- **Link Creation Agent**
A C++ server that performs pattern-matching queries and creates new links in the Atomspace based on the results.

Documentation: [Read more](docs/components/link-creation-agent.md)
Documentation: [Read more](src/cpp/link_creation_agent/README.md)

- **Inference Control**
C++ server which perform Inference Queries.
Expand All @@ -37,12 +37,12 @@ The following components are included in this repository:
- **Query Engine**
A data manipulation API for Distributed Atomspace (DAS). It allows queries with pattern matching capabilities and traversal of the Atomspace hypergraph.

Documentation: [Read more](docs/components/query-engine.md)
Documentation: [Read more](src/python/hyperon_das/README.md)

- **Atom DB**
A Python library required by Hyperon DAS to interface with DBMSs and other data storage structures.

Documentation: [Read more](docs/components/atomdb.md)
Documentation: [Read more](src/python/hyperon_das_atomdb/README.md)

---

Expand Down
92 changes: 0 additions & 92 deletions docs/components/atomdb.md

This file was deleted.

Empty file.
Empty file.
41 changes: 0 additions & 41 deletions docs/components/query-engine.md

This file was deleted.

File renamed without changes.
40 changes: 31 additions & 9 deletions src/cpp/link_creation_agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,26 +61,40 @@ A custom field must have 3 elements:

## How to build

```
To build the Link Creation Agent, run the following command from the project root:

```bash
make build
```

This will generate the binaries for all components in the `das/src/bin` directory.

## How to run
Running the server

> Before running the Link Creation Agent, you need to start the Query Agent. For more information on how to set up and run the Query Agent, refer to [query-agent.md](../query_engine/README.md).
You might not be able to execute the binary directly from your machine. To simplify this process, we provide a command to run the service inside a container:

```
make run OPTIONS="--type server --config_file <path_to_config_file>"
make run-link-creation-agent OPTIONS="--type server --config_file <path_to_config_file>"
```

The configuration file (`<path_to_config_file>`) must be located in the current directory where the command is executed. This is because we use a volume to mount the file inside the container. If the file is not in the correct location, the command will fail, as the configuration file will not be available inside the container where the binary runs.


#### Config file example

```
default_interval = 10
thread_count = 5
query_node_server_id = localhost:35700
query_node_client_id = localhost:9001
link_creation_server_id = localhost:9080
das_client_id = localhost:9090
requests_interval_seconds = 10
link_creation_agent_thread_count = 5
query_agent_server_id = localhost:35700
query_agent_client_id = localhost:9001
link_creation_agent_server_id = localhost:9080
das_agent_client_id = localhost:9090
das_agent_server_id = localhost:9091
requests_buffer_file = ./buffer
```

* default_interval: The default interval to run requests that repeat one or more times
* thread_count: The number of threads to process Query Agent requests
* query_node_server_id: IP + port of the Query Agent server.
Expand All @@ -96,3 +110,11 @@ requests_buffer_file = ./buffer
make run_client OPTIONS="localhost:1010 localhost:9080 LINK_TEMPLATE Expression 3 NODE Symbol Similarity VARIABLE V1 VARIABLE V2 LINK_CREATE Similarity 2 1 VARIABLE V1 VARIABLE V2 CUSTOM_FIELD truth_value 2 CUSTOM_FIELD mean 2 count 10 avg 0.9 confidence 0.9 10 0 test false"
```

If successful, you should see a message like this:

```
Starting server
SynchronousGRPC listening on localhost:9080
SynchronousGRPC listening on localhost:9001
SynchronousGRPC listening on localhost:9090
```
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export DAS_REDIS_PORT="6379"
export DAS_USE_REDIS_CLUSTER=false
```

Before running the Query Agent, you need to start the Attention Broker. For more information on how to set up and run the Attention Broker, refer to [attention-broker.md](./attention-broker.md).
Before running the Query Agent, you need to start the Attention Broker. For more information on how to set up and run the Attention Broker, refer to [attention-broker.md](../attention_broker/README.md).


## **Usage**
Expand All @@ -50,12 +50,12 @@ You might not be able to execute the binary directly from your machine. To simpl
```bash
make run-query-agent
```

- The default port for the Attention Broker is `35700`.
- If successful, you should see a message like this:
```bash
Connected to (NON-CLUSTER) Redis at localhost:6379
Connected to MongoDB at localhost:27017
Connected to AttentionBroker at localhost:37007
SynchronousGRPC listening on localhost:
SynchronousGRPC listening on localhost:35700
############################# REQUEST QUEUE EMPTY ##################################
```
Loading

0 comments on commit 780df6c

Please sign in to comment.