Skip to content

Commit

Permalink
Rename to Sophia (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielcampagnolitg authored Sep 11, 2024
1 parent 5d915dc commit 102d6c1
Show file tree
Hide file tree
Showing 33 changed files with 99 additions and 101 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ node_modules
dist
bin
.venv
.nous/
.sophia/

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ temp/
.ignore
.cache
.venv/
.nous/
.sophia/
src/cli/*-in
src/cli/*-out
tg/
Expand Down
9 changes: 4 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ RUN curl -sL https://deb.nodesource.com/setup_20.x -o nodesource_setup.sh
RUN chmod +x ./nodesource_setup.sh && ./nodesource_setup.sh
RUN apt install -y nodejs

ENV user=nous
ENV homedir=/home/nous/
ENV user=sophia
ENV homedir=/home/sophia/

RUN useradd --create-home -g users nous
RUN useradd --create-home -g users sophia
WORKDIR $homedir

RUN mkdir ".husky"
Expand All @@ -27,12 +27,11 @@ COPY . .

USER $user

RUN mkdir .nous
RUN mkdir .sophia
# Generate the function schemas
RUN npm run functionSchemas

ENV NODE_ENV=production
ENV PORT=8080
EXPOSE 8080
CMD [ "npm", "run", "start" ]

6 changes: 3 additions & 3 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ RUN npm install -g pm2

RUN pip install aider-chat

ENV user=nous
ENV homedir=/home/nous/
RUN useradd --create-home -g users nous
ENV user=sophia
ENV homedir=/home/sophia/
RUN useradd --create-home -g users sophia
WORKDIR $homedir

RUN mkdir ".husky"
Expand Down
33 changes: 15 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<a id="banner"></a>
<p align="center">
<img src="https://public.trafficguard.ai/nous/banner.png" alt="nous logo"/>
<img src="https://public.trafficguard.ai/sophia/banner.png" alt="nous logo"/>
</p>
<p align="center">
<em>The open-source TypeScript platform for autonomous AI agents and LLM based workflows </em>
</p>
<em><b>Nous</b></em> (Greek: νοῦς) is a term from classical philosophy often associated with intellect or intelligence, represents the human mind's capacity to comprehend truth and reality.
The Ancient Greek word <em><b>sophía (σοφία)</b></em> is the abstract noun of σοφός (sophós), which variously translates to "clever, skillful, intelligent, wise"

## Documentation site
[Home](https://nous.trafficguard.ai/) | [Setup](https://nous.trafficguard.ai/setup/) | [Observability](https://nous.trafficguard.ai/observability/) | [Function calling](https://nous.trafficguard.ai/functions/) |
[Autonomous AI Agent](https://nous.trafficguard.ai/xml-agent/) | [AI Software Engineer](https://nous.trafficguard.ai/software-engineer/) | [AI Code reviews](https://nous.trafficguard.ai/code-review/) |
[Tools/Integrations](https://nous.trafficguard.ai/integrations/) | [Roadmap](https://nous.trafficguard.ai/roadmap/)
[Home](https://sophia.dev/) | [Setup](https://sophia.dev/setup/) | [Observability](https://sophia.dev/observability/) | [Function calling](https://sophia.dev/functions/) |
[Autonomous AI Agent](https://sophia.dev/xml-agent/) | [AI Software Engineer](https://sophia.dev/software-engineer/) | [AI Code reviews](https://sophia.dev/code-review/) |
[Tools/Integrations](https://sophia.dev/integrations/) | [Roadmap](https://sophia.dev/roadmap/)

---

[The Nous Story](#the-nous-story) | [Features](#features) | [UI Examples](#ui-examples) | [Code examples](#code-examples) | [Contributing](#contributing)
[The Sophia Story](#the-sophia-story) | [Features](#features) | [UI Examples](#ui-examples) | [Code examples](#code-examples) | [Contributing](#contributing)

## The Nous Story
## The Sophia Story

Nous started from a simple goal: to harness AI's potential to enhance real-world productivity, born in DevOps and Platform Engineering space. We envisioned a tool that could:
Sophia started from a simple goal: to harness AI's potential to enhance real-world productivity, born in DevOps and Platform Engineering space. We envisioned a tool that could:

- Automate various processes and support requests, and triage build failures.
- Review code for compliance with standards and best practices.
Expand All @@ -30,7 +30,7 @@ Our SaaS on GCP comprises projects developed in TypeScript, Python, GoogleSQL, P
With open source projects typically Python/GitHub focused, and the vendor AI tools being focused in their silos,
we saw a need for TypeScript based tooling which can work across our entire tech stack, and understand the overall architecture.

Through its evolution we've designed nous as a flexible platform for the TypeScript community to expand and support the use cases and integrations of your choice.
Through its evolution we've designed sophia as a flexible platform for the TypeScript community to expand and support the use cases and integrations of your choice.

Our design choice of Firestore for the initial database implementation, with Cloud Run, provides a scale-to-zero solution with zero-cost using the free tier.
With the intention to support uses cases such as your own custom personal assistant, always available via mobile.
Expand Down Expand Up @@ -82,7 +82,7 @@ Key features include:

### New Agent

![New Agent UI](https://public.trafficguard.ai/nous/start.png)
![New Agent UI](https://public.trafficguard.ai/sophia/start.png)

### Sample trace

Expand All @@ -106,11 +106,11 @@ Key features include:

## Code Examples

### Nous vs LangChain
### Sophia vs LangChain

Nous doesn't use LangChain, for [many reasons](https://www.octomind.dev/blog/why-we-no-longer-use-langchain-for-building-our-ai-agents) that [you](https://www.google.com/search?q=langchain+site%3Anews.ycombinator.com) can [read online](https://www.google.com/search?q=langchain+sucks+site%3Areddit.com)
Sophia doesn't use LangChain, for [many reasons](https://www.octomind.dev/blog/why-we-no-longer-use-langchain-for-building-our-ai-agents) that [you](https://www.google.com/search?q=langchain+site%3Anews.ycombinator.com) can [read online](https://www.google.com/search?q=langchain+sucks+site%3Areddit.com)

Let's compare the LangChain document example for Multiple Chains to the equivalent Nous implementation.
Let's compare the LangChain document example for Multiple Chains to the equivalent Sophia implementation.

#### LangChain
```typescript
Expand Down Expand Up @@ -148,7 +148,7 @@ const result = await combinedChain.invoke({
console.log(result);
```

#### Nous
#### Sophia
```typescript
import { llms } from '#agent/context'
import { anthropicLLMs } from '#llms/anthropic'
Expand All @@ -164,7 +164,7 @@ runAgentWorkflow({ llms: anthropicLLMs() }, async () => {
});
```

The Nous code also has the advantage of static typing with the prompt arguments, enabling you to refactor with ease.
The Sophia code also has the advantage of static typing with the prompt arguments, enabling you to refactor with ease.
Using simple control flow allows easy debugging with breakpoints/logging.

To run a fully autonomous agent:
Expand All @@ -178,9 +178,6 @@ startAgent({
});
```

The Nous code also has the advantage of static typing with the prompt arguments, enabling you to refactor with ease.
Using simple control flow allows easy debugging with breakpoints/logging.

### Automated LLM function schemas

LLM function calling schemas are automatically generated by having the `@func` decorator on class methods.
Expand Down
10 changes: 5 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# docker compose up --build
services:
node:
container_name: nous-dev
container_name: sophia-dev
restart: always
ports:
- 4200:4200
Expand All @@ -10,11 +10,11 @@ services:
context: ./
dockerfile: Dockerfile.dev
volumes:
- ~/.config/gcloud:/home/nous/.config/gcloud # Comment out if not using Google Cloud
- .:/home/nous
- ~/.config/gcloud:/home/sophia/.config/gcloud # Comment out if not using Google Cloud
- .:/home/sophia
# Install node_modules into the container for cross-platform compatability
- /home/nous/node_modules
- /home/nous/frontend/node_modules
- /home/sophia/node_modules
- /home/sophia/frontend/node_modules
# environment:
# GIT_DISCOVERY_ACROSS_FILESYSTEM: 1
# - var=value
Expand Down
4 changes: 2 additions & 2 deletions docs/CODE_REVIEW.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Code Review

Nous has the ability to review merge requests on GitLab with configured code review guidelines.
Sophia has the ability to review merge requests on GitLab with configured code review guidelines.

Some situations where you may want to use LLMs for reviewing code styles are:
- When a linting rule isn't yet available.
Expand Down Expand Up @@ -75,5 +75,5 @@ Webhooks can be configured at the project or group level, so if you have multipl
that you wanted to be reviewed, then you will need to configure a webhook for each one.

Follow the [GitLab Webhook documentation](https://gitlab.synrgy.mobi/groups/devops/-/hooks) and for the
webhook URL enter `https://<your-nous-domain>/gitlab/v1/webhook`
webhook URL enter `https://<your-sophia-domain>/gitlab/v1/webhook`

2 changes: 2 additions & 0 deletions docs/docs/about.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

# Project
2 changes: 1 addition & 1 deletion docs/docs/agent-concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

### 1. Autonomous agents

Nous comes with two fully autonomous agents (XML and Python/dynamic), which applying reasoning to break down
Sophia comes with two fully autonomous agents (XML and Python/dynamic), which applying reasoning to break down
a user request into a plan to be completed by the available function calls.

### 2. Workflow agents
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Currently, the valid options are `single_user` and `IAP`

## Single user mode

By default, Nous runs in a single user mode which disables any authentication. On startup the database is queried for
By default, Sophia runs in a single user mode which disables any authentication. On startup the database is queried for
a user profile, and if none is found then creates one, using the email from the `SINGLE_USER_EMAIL` environment variable.

Th
2 changes: 1 addition & 1 deletion docs/docs/autonomous-agents.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Autonomous AI Agents

Nous provides two autonomous agents which work to complete the request via a control loop which iteratively (re-)plans and calls the functions available to the agent.
Sophia provides two autonomous agents which work to complete the request via a control loop which iteratively (re-)plans and calls the functions available to the agent.

At a high level they share the same internal state, agent memory, human-in-the loop, functional calling history etc.

Expand Down
2 changes: 2 additions & 0 deletions docs/docs/chatbot.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# ChatBot

2 changes: 1 addition & 1 deletion docs/docs/code-review.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# AI Code reviews

Nous has support for AI code reviews of GitLab merge requests. Adding GitHub support is a good candidate for using the Code Editor agent to assist with!
Sophia has support for AI code reviews of GitLab merge requests. Adding GitHub support is a good candidate for using the Code Editor agent to assist with!

For the current working proof-of-concept, the configuration files are located in the [/resources](https://github.com/TrafficGuard/nous/tree/preview/resources/codeReview) folder. The next step will to store the configuration in a database.

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ This document provides comprehensive details about the environment variables uti
**TRACE_SERVICE_NAME**

- **Description**: The name of the service for tracing purposes.
- **Default Value**: `nous`
- **Default Value**: `sophia`

**TRACE_AUTO_INSTRUMENT**

Expand Down
6 changes: 3 additions & 3 deletions docs/docs/functions.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# LLM Function schemas

Nous provides an automated way to create LLM function schemas, avoiding the duplicate work of creating a function schema separate from the code implementation.
Sophia provides an automated way to create LLM function schemas, avoiding the duplicate work of creating a function schema separate from the code implementation.

The *ts-morph* package is used to parse the source code at build-time/runtime to generate the schemas.

Expand Down Expand Up @@ -37,10 +37,10 @@ The `@funcClass(__filename)` annotation must be on the class so ts-morph can fin
The `@func()` annotation must be on each class method to be exposed as a LLM callable function.

If the schema files don't exist at runtime then they will automatically be generated. To improve startup time
the schema files are cached under the folder `.nous/functions` and only re-built if the source file modified date is newer.
the schema files are cached under the folder `.sophia/functions` and only re-built if the source file modified date is newer.
Also, the schema files can be generated at build time with the `npm run functionSchemas` script.

Function calling agents can transform the object implementing the [FunctionSchema](https://github.com/TrafficGuard/nous/blob/main/src/functionSchema/functions.ts#L13)
Function calling agents can transform the object implementing the [FunctionSchema](https://github.com/TrafficGuard/sophia/blob/main/src/functionSchema/functions.ts#L13)
interface into the format required, e.g. the custom XML format, or native function calling types for OpenAI, Anthropic, Gemini etc.

The `@func` annotation also adds OpenTelemetry tracing to the function call.
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/getting-started-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ npm run agent research the latest news about large language models and write a r

Without arguments the prompt is read from `src/cli/code-in` otherwise it uses the provided arguments for the prompt.

This is a useful for editing the nous codebase. You could run a command like:
This is a useful for editing the sophia codebase. You could run a command like:

```bash
npm run code In the anthropic vertex class update the pricing for claude 3.5 sonnet to be 3 dollars per million input tokens and 15 dollars per million output tokens
Expand Down
24 changes: 11 additions & 13 deletions docs/docs/index.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<a id="banner"></a>
<p align="center">
<img src="https://public.trafficguard.ai/nous/banner.png" alt="nous logo"/>
<img src="https://public.trafficguard.ai/sophia/banner.png" alt="nous logo"/>
</p>
<p align="center">
<em>The open-source TypeScript platform for autonomous AI agents and LLM based workflows</em>
</p>
<em><b>Nous</b></em> (Greek: νοῦς) is a term from classical philosophy often associated with intellect or intelligence, represents the human mind's capacity to comprehend truth and reality.
The Ancient Greek word <em><b>sophía (σοφία)</b></em> is the abstract noun of σοφός (sophós), which variously translates to "clever, skillful, intelligent, wise"

## The Nous Story
## The Sophia Story

Nous started from a simple goal: to harness AI's potential to enhance real-world productivity, born in DevOps and Platform Engineering space. We envisioned a tool that could:
Sophia started from a simple goal: to harness AI's potential to enhance real-world productivity, born in DevOps and Platform Engineering space. We envisioned a tool that could:

- Automate various processes and support requests, and triage build failures.
- Review code for compliance with standards and best practices.
- Assist with large refactorings, and more.

At TrafficGuard we process billions of events a month for our global clients, [increasing their Ad spend ROI](https://www.trafficguard.ai/case-studies?ref=nous) from bots and other invalid traffic.
At TrafficGuard we process billions of events a month for our global clients, [increasing their Ad spend ROI](https://www.trafficguard.ai/case-studies?ref=sophia) from bots and other invalid traffic.
Our platform on Google Cloud comprises projects developed in TypeScript, Python, GoogleSQL, PHP and Terraform, deployed from GitLab.

With open source projects typically Python/GitHub focused, and the vendor AI tools being focused in their silos,
Expand All @@ -42,7 +42,7 @@ Some of the key features include:
- Function callable integrations:
- Filesystem, Jira, Slack, Perplexity, Gitlab and more
- Supports multiple LLMs/Services:
- OpenAI, Anthropic (native & Vertex), Gemini, Groq, Fireworks, Together.ai, DeepSeek, Ollama
- OpenAI, Anthropic (native & Vertex), Gemini, Groq, Fireworks, Together.ai, DeepSeek, Ollama, Cerebras
- CLI and Web interface
- Human-in-the-loop for:
- Budget control
Expand Down Expand Up @@ -96,11 +96,11 @@ Some of the key features include:

## Code Examples

### Nous vs LangChain
### Sophia vs LangChain

Nous doesn't use LangChain, for [many reasons](https://www.octomind.dev/blog/why-we-no-longer-use-langchain-for-building-our-ai-agents) that [you](https://www.google.com/search?q=langchain+site%3Anews.ycombinator.com) can [read online](https://www.google.com/search?q=langchain+sucks+site%3Areddit.com)
Sophia doesn't use LangChain, for [many reasons](https://www.octomind.dev/blog/why-we-no-longer-use-langchain-for-building-our-ai-agents) that [you](https://www.google.com/search?q=langchain+site%3Anews.ycombinator.com) can [read online](https://www.google.com/search?q=langchain+sucks+site%3Areddit.com)

Let's compare the LangChain document example for Multiple Chains to the equivalent Nous implementation.
Let's compare the LangChain document example for Multiple Chains to the equivalent Sophia implementation.

#### LangChain
```typescript
Expand Down Expand Up @@ -138,7 +138,7 @@ const result = await combinedChain.invoke({
console.log(result);
```

#### Nous
#### Sophia
```typescript
import { llms } from '#agent/context'
import { anthropicLLMs } from '#llms/anthropic'
Expand All @@ -154,7 +154,7 @@ runAgentWorkflow({ llms: anthropicLLMs() }, async () => {
});
```

The Nous code also has the advantage of static typing with the prompt arguments, enabling you to refactor with ease.
The Sophia code also has the advantage of static typing with the prompt arguments, enabling you to refactor with ease.
Using simple control flow allows easy debugging with breakpoints/logging.

To run a fully autonomous agent:
Expand Down Expand Up @@ -195,5 +195,3 @@ export class Jira {
## Contributing

We warmly welcome contributions to the project through [issues](https://github.com/TrafficGuard/nous/issues), [pull requests](https://github.com/TrafficGuard/nous/pulls) or [discussions](https://github.com/TrafficGuard/nous/discussions)

Reach out to us as [email protected] if you'd like support to ramp up as a contributor.
2 changes: 1 addition & 1 deletion docs/docs/observability.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Any TypeScript file which is used as an application entry point should being wit
Tracing is implemented with OpenTelemetry. The environment variables which configure tracing are:
```
TRACE_AGENT_ENABLED=true
TRACE_SERVICE_NAME=nous
TRACE_SERVICE_NAME=sophia
TRACE_AUTO_INSTRUMENT=true
TRACE_SAMPLE_RATE=1
```
Expand Down
10 changes: 5 additions & 5 deletions docs/docs/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

## Installation
```bash
git clone https://github.com/TrafficGuard/nous.git
cd nous
git clone https://github.com/TrafficGuard/sophia.git
cd sophia
source ./bin/configure
```
The configure script will:
Expand Down Expand Up @@ -46,12 +46,12 @@ If you want to get running ASAP then in `variables/local.env` update the `DATABA

## Configuration quick start

The `variables/local.env` file contains the configuration when running Nous locally.
The `variables/local.env` file contains the configuration when running Sophia locally.

If you have configured Google Cloud then update `TRACE_AGENT_ENABLED` to `true`.

By default, Nous runs in `single_user` authentication mode. A user profile will be created the first time the application is run.
Update the `SINGLE_USER_EMAIL` variable with your email before running Nous for the first time.
By default, Sophia runs in `single_user` authentication mode. A user profile will be created the first time the application is run.
Update the `SINGLE_USER_EMAIL` variable with your email before running Sophia for the first time.

The LLM service API keys and integration configurations can be set in web UI, or alternatively in the `variables/local.env` file. Values in the user profile take preferences over the environment configuration values.

Expand Down
Loading

0 comments on commit 102d6c1

Please sign in to comment.