MCPcopy Index your code
hub / github.com/cognosisai/platform

github.com/cognosisai/platform @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
156 symbols 403 edges 42 files 1 documented · 1%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Cognosis AI Platform

Summary

The Cognosis AI Platform contains an application server and all of the infrastructure you need to build Large Language Model applications with, batteries included!

Join our Slack!

Quickstart

Requirements:

  • Docker
  • Node 19

Step 1: Get Infrastructure Running

# Clone the repo and cd into it
git clone git@github.com:cognosisai/platform.git
cd platform

# On Apple M1/M2 chips:
make build-apple
# On x86:
make build-x86

# Spin it all up! This runs docker-compose up, and will get you
# Elasticsearch 8.5, cognosis-embeddings service, and temporalite, which
# is a single Docker container version of Temporal meant for development
make run

Step 2: Configure

Edit .env, and populate it with the following information:

TEMPORAL_HOST="localhost:7233"
ELASTIC_CONFIG={"auth":{"username":"elastic","password":"changeme"},"node":"http://localhost:9200"}
OPENAI_TOKEN="<OpenAI Token>"
NLPCLOUD_TOKEN="<NLP Cloud Token>"
EMBEDDINGS_URL="http://localhost:9100"

Step 3: Install NPM modules

npm install

Step 4: Start Temporal Worker

ts-node src/worker.ts

This will take a few seconds. It will be ready when you see this:

2022-11-05T23:51:17.087Z [INFO] webpack 5.74.0 compiled successfully in 717 ms
2022-11-05T23:51:17.093Z [INFO] Workflow bundle created { size: '0.91MB' }
2022-11-05T23:51:17.141Z [INFO] Worker state changed { state: 'RUNNING' }

Step 5: AI!

ts-node src/cli/cognosis.ts "Give me a really terrible idea involving an \
icepick, and bottle of elmer's wood glue"
Starting wfid workflow-fC-ONstofj4T4G9C_JQv5

Use the icepick to make a hole in the bottle of glue, then drink it.

Application Server Components

Elastic Search

Temporal

Embeddings (Tensorflow - Google USE5)

Cognosis AI SDK

Cognosis AI SDK

Cognosis AI Platform includes

Extension points exported contracts — how you extend this code

ChatHistory (Interface)
* Chat history interface
src/workflows/chatbot.ts
CodegruntFrame (Interface)
(no doc)
src/codegrunt.ts
ChatMessage (Interface)
(no doc)
src/clones.ts
Teaching (Interface)
(no doc)
src/cogs/cog.ts
NLPCloudToken (Interface)
(no doc)
src/activities/tokenizer.ts
tableschema (Interface)
(no doc)
src/workflows/mysql.ts
ChatSession (Interface)
(no doc)
src/clones.ts
CodeFragment (Interface)
(no doc)
src/activities/application/codegrunt.ts

Core symbols most depended-on inside this repo

log
called by 123
src/workflows/session.ts
split_text_by_tokens
called by 23
src/activities/tokenizer.ts
promptTemplate
called by 11
src/workflows/prompt.ts
getElasticSearchClient
called by 9
src/activities/elastic.ts
close
called by 9
src/activities/application/ijavascript.ts
write
called by 7
src/activities/application/ijavascript.ts
writeAndRead
called by 6
src/activities/application/ijavascript.ts
addMessage
called by 5
src/workflows/session.ts

Shape

Function 99
Method 29
Interface 17
Class 10
Route 1

Languages

TypeScript99%
Python1%

Modules by API surface

src/workflows/session.ts24 symbols
src/workflows/prompt.ts15 symbols
src/cogs/cog.ts14 symbols
src/activities/application/ijavascript.ts11 symbols
src/activities/util.ts9 symbols
src/workflows/sql2llm.ts8 symbols
src/workflows/chatbot.ts8 symbols
src/activities/tokenizer.ts8 symbols
src/activities/elastic.ts6 symbols
src/activities/application/codegrunt.ts6 symbols
src/activities/llm.ts5 symbols
src/activities/embeddings.ts5 symbols

For agents

$ claude mcp add platform \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact