Software Documentation

CFAgent (Alpha release)

There are four parts to deal with in CFAgent
  • CFAgent Administrator
  • CFAgent Master
  • CFAgent Customer
  • CFWeb Client

The CFAgent is distributed in four jar files


Install the jar files in your preferred directory and include them in your classpath.
If you download the source code, please compile them first and follow the instructions
given below. All the property files required by different applications are also explained in this
document. You need jdk1.4 to run the applications.

CFAgent Administrator

    Administrator is responsible for starting/stopping the server, registering new masters, creating sessions and other admin related things. A GUI is provided for this purpose. Start the program as follows

   java -classpath <path of cfAgentAdmin.jar> chatforte.system.ChatForteServer  <path of config file>

If you have downloaded the source code, please compile them first and make sure that the following packages are included in your classpath


   The config file is where the system properties are stored. These properties relate to database information such as drivers, which database implementation to be used (file based database, mysql database or your own implementation), username, password and lots of other things such as debugging options, logo pointers and what kind of message are supported by the system etc. This file is the chatforte.props file that can be found under cfagent.system.The menus will take you to different screens that provide different features. Some of the screens are not supported as of now.

CFAgent Master

   Master is responsible for answering to customer queries after they are transferred to the session conducted by the master. Master is also responsible for setting different security permissions to the session on top of what the administrator has already set. This facility is currently not supported. Start the master program as follows

  java -classpath <path of cfAgentMaster.jar> chatforte.master.ChatMaster

If you have downloaded the source code, please compile them first and make sure that the following packages are included in your classpath


The master interface expects two files in the directory where the program is invoked. These files are peer.config (general configuration similar to the one used by the system as mentioned above) and (what messages are supported at the master's end). This interface is very similar to the one used by the client except for the security features and registration (the masters are registered only by the admin and hence can only login using the supplied username and password).

CFAgent Client

   The customer can use the interface to ask questions/queries. When the queries cannot be answered by the corresponding representatives (automatic or manual), the customer will be transparently transferred to different sessions that addresses their topic of interest. To start this program

  java -classpath <path of cfAgentCustomer.jar> chatforte.customer.ChatForte

If have downloaded the source code, compile the source code first.

The customer code is dependent on the following packages

Please make sure that the classes for the above packages appear in your classpath

The client interface expects two files similar to the one expected by the CFAgent Master.


This has been tested using Tomcat 4.0.1. Please carry out the following steps to deploy the same

If you download cfWeb.war, simply copy it under webapps directory which should get you going.

If you download the source code,  then compile the source code
  • Create chatforte directory under webapps
    The tree under chatforte should look like the following
  • Copy web.xml distributed under the source code (chatforte/web/control) into
  • The required classes should be present under chatforte/WEB-INF/classes
    The servlet code is dependent on the following packages
  • Copy the .jsp files under the distributed source code (chatforte/web/view) under
    chatforte/cfagent (or) symbolically link the chatforte/cfagent directory to
    chatforte/web/view directory.
  • This is very critical. You must copy peer.config and under the customer directory into webapps/chatforte directory. Otherwise the CFWeb client will not work

Invoke CFWeb using the following URL


Note that you have to have your tomcat engine running and the ChatForte Admin running before
CFWeb can be utilized.

From this point onwards, you will be automatically taken to other screens if everything is successful.

MySQL Database Backend

In order to deploy MySQL backend, do the following

  • Install MySQL database 
  • Create a database for storing and retrieving information
  • Create atleast one database user for the database created in the above step
  • Load the tables specified in two files namely chatforte chatforte_mysql.sql and cfagent_mysql.sql into your
  • Make the following modifications in chatforte.props file
    • Leave the following line as is if you would like to use the MySQL DB
      NOTE: The other two implementations for the DB (ChatForteDBImpl and ChatForteDBSerialImpl)
      do not implement a lot of the DB methods that are required and my sincere advise for not using them right now.
    • Change the DBNAME=chatforte line to the name of the database that you have created in step 2.
    • Change the DBURL=jdbc:mysql://localhost to wherever your database backend is hosted
    • Change the DBUSER and DBPASSWD lines according to the corresponding username and password
      that you have created
    • Change the DBDRIVER to whatever jdbc driver that you use to access the MySQL database

The above steps should get you started with the MySQL backend.

Refining Customer Queries

This portion explains you how to refine the customer queries in order to utilize the automated response to its fullest potential. The future versions of CFAgent will improvise on this feature further.

There are currently four files that are available to let the user take the full control of this feature.
  • prepositions.txt  (this file consists of all the prepositions that can be removed from the customer query)
  • misc.txt (this file consists of question words, alphabets and other words that are irrelevant)
  • domaindemux.txt (this file lists out different words that can be put as one word)
  • domainmux.txt (this file lists out different synonyms of a single word that can be used to make the query
    address much broader category)

Please take a look at the above files to understand more about this concept.

The following lines in the chatforte.props should change if you wish to store your words in a different file

System Properties File

The system properties file is stored under chatforte/system in chatforte.props file.
The content of this file is explained below

DEBUG=FILE (For logging purposes. If you don't want file logging, please leave it empty or simply enter CONSOLE instead of FILE)

LOGDIR=./logs (You need to create this directory under chatforte/system, if you enable the file logging service. Otherwise you will get  the following error "Unable to set File Logger Service!. Check system properties file")

LOGFILENAME=chatforte (You need to provide this property if you enable file logging service. Right now, the logging will be distributed among 20 files starting from chatforte0 to chatforte19, one per execution)

DBPROVIDER=chatforte.system.ChatForteDBMysqlImpl (This is the default implementation for MySQL database backend. The instructions for setting up MySQL backend is given above. The other implementations do not work at present.)

DBNAME=chatforte (The database name for archiving and retrieving information)

DBURL=jdbc:mysql://localhost (The jdbc url for the database driver chosen)

DBUSER=blah (Username for the database access)

DBPASSWD=foo (Password for the username to access database)

DBDRIVER=com.mysql.jdbc.Driver (The jdbc driver to access the database backend)

MESSAGEINFO=./ (This is very important. Through this, the CFAgent system knows which version of the message to be used for the protocol communication. Please DO NOT EDIT/DELETE  this file)

LOGO=./chatfortelogo.jpg  (The ChatForte logo. If you would like to use someother logo here,  you are welcome to do it)

TIMEOUT=600000 (Currently not used)

PREPOSITION=./prepositions.txt  (Ref to Refining Customer Queries section)

CFMISC=./misc.txt  (Ref to Refining Customer Queries section)

DOMAINDEMUX=./domaindemux.txt  (Ref to Refining Customer Queries section)

DOMAINMUX=./domainmux.txt  (Ref to Refining Customer Queries section)

Client Properties File (Customer and Master)

This file is named peer.config under customer and master directories
The file content is explained below

MESSAGEINFO=./ (This file stores the message versioning for protocol communication. Please DO NOT EDIT/DELETE this file)

LOGO=./chatfortelogo.jpg (The logo that appears on the default screen. You can replace this with whatever logo you wish)

LOGDIR=./logs (This is required if you enable file logging instead of console logging. You must create this directory, if you want to avoid any errors in starting the client/master application)

LOGFILE=cfclient (This is the name of the log file where the logging information is stored)

DEBUG=FILE (If you want to disable file based logging, leave it empty or simply enter CONSOLE)

TIMEOUT=600000 (This is timeout for how long the customer/master connection can remain idle before it is disconnected from the CFAgent server. This is given in milliseconds.)

SOCKET_WAIT=20000 (This is the timeout for the socket connection to the server. If the server does not respond within this time limit, no connection will be made and no more waiting on the socket. This is also given in milliseconds)


There will be a confusion between using CFAgent and ChatForte in the source code and the package at this time. This will be resolved in the future. This occurred because of the code overlap between ChatForte and CFAgent.