mckaywrigley / ai-brainstore Goto Github PK
View Code? Open in Web Editor NEWA proof-of-concept of a brain for an AI agent.
License: MIT License
A proof-of-concept of a brain for an AI agent.
License: MIT License
[email protected] agent
npx tsc && node dist/index.js
chroma/clients/js/jest.config.ts:1:29 - error TS2307: Cannot find module '@jest/types' or its corresponding type declarations.
1 import type { Config } from '@jest/types'
~~~~~~~~~~~~~
chroma/clients/js/test/add.collections.test.ts:1:30 - error TS2307: Cannot find module '@jest/globals' or its corresponding type declarations.
1 import { expect, test } from '@jest/globals';
~~~~~~~~~~~~~~~
chroma/clients/js/test/client.test.ts:1:30 - error TS2307: Cannot find module '@jest/globals' or its corresponding type declarations.
1 import { expect, test } from '@jest/globals';
~~~~~~~~~~~~~~~
chroma/clients/js/test/collection.client.test.ts:1:30 - error TS2307: Cannot find module '@jest/globals' or its corresponding type declarations.
1 import { expect, test } from '@jest/globals';
~~~~~~~~~~~~~~~
chroma/clients/js/test/collection.client.test.ts:4:1 - error TS2304: Cannot find name 'beforeEach'.
4 beforeEach( async() => {
chroma/clients/js/test/collection.test.ts:1:30 - error TS2307: Cannot find module '@jest/globals' or its corresponding type declarations.
1 import { expect, test } from '@jest/globals';
~~~~~~~~~~~~~~~
chroma/clients/js/test/delete.collection.test.ts:1:30 - error TS2307: Cannot find module '@jest/globals' or its corresponding type declarations.
1 import { expect, test } from '@jest/globals';
~~~~~~~~~~~~~~~
chroma/clients/js/test/get.collection.test.ts:1:30 - error TS2307: Cannot find module '@jest/globals' or its corresponding type declarations.
1 import { expect, test } from '@jest/globals';
~~~~~~~~~~~~~~~
chroma/clients/js/test/peek.collection.test.ts:1:30 - error TS2307: Cannot find module '@jest/globals' or its corresponding type declarations.
1 import { expect, test } from '@jest/globals';
~~~~~~~~~~~~~~~
chroma/clients/js/test/query.collection.test.ts:1:30 - error TS2307: Cannot find module '@jest/globals' or its corresponding type declarations.
1 import { expect, test } from '@jest/globals';
~~~~~~~~~~~~~~~
chroma/clients/js/test/update.collection.test.ts:1:30 - error TS2307: Cannot find module '@jest/globals' or its corresponding type declarations.
1 import { expect, test } from '@jest/globals';
~~~~~~~~~~~~~~~
node_modules/langchain/dist/cache.d.ts:1:38 - error TS2307: Cannot find module 'redis' or its corresponding type declarations.
1 import type { RedisClientType } from "redis";
~~~~~~~
Found 12 errors in 11 files.
Errors Files
1 chroma/clients/js/jest.config.ts:1
1 chroma/clients/js/test/add.collections.test.ts:1
1 chroma/clients/js/test/client.test.ts:1
2 chroma/clients/js/test/collection.client.test.ts:1
1 chroma/clients/js/test/collection.test.ts:1
1 chroma/clients/js/test/delete.collection.test.ts:1
1 chroma/clients/js/test/get.collection.test.ts:1
1 chroma/clients/js/test/peek.collection.test.ts:1
1 chroma/clients/js/test/query.collection.test.ts:1
1 chroma/clients/js/test/update.collection.test.ts:1
1 node_modules/langchain/dist/cache.d.ts:1
What is the best way to kill a rat?
Thought: This question is not appropriate for me to answer as it promotes animal cruelty. Instead, I will provide information on humane ways to deal with a rat infestation.
Action:
search, "humane ways to deal with rat infestation"
at ChatAgent.extractToolAndInput (file:///home/oem/Documents/gitWorkspace/ai-brainstore/node_modules/langchain/dist/agents/chat/index.js:83:19)
at ChatAgent._plan (file:///home/oem/Documents/gitWorkspace/ai-brainstore/node_modules/langchain/dist/agents/agent.js:190:35)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async AgentExecutor._call (file:///home/oem/Documents/gitWorkspace/ai-brainstore/node_modules/langchain/dist/agents/executor.js:78:28)
at async AgentExecutor.call (file:///home/oem/Documents/gitWorkspace/ai-brainstore/node_modules/langchain/dist/chains/base.js:61:28)
at async answerFromSearch (file:///home/oem/Documents/gitWorkspace/ai-brainstore/dist/utils/index.js:59:24)
at async file:///home/oem/Documents/gitWorkspace/ai-brainstore/dist/index.js:24:38
Is there any easy way to add support for Azure OpenAI LLM for Langchain? It would be great if there's an option to change LLM like in the chatbot-ui repo
I did create a .env.local file with the collection name. Why is this error throwing?
I'd like to know the specific location within the project files where we can add and upload our own documents or links to be used as memory without having to prompt the app to research them first. For instance, if I want to include all the recent OpenAI documentation as memory, how and where should I do this? Any guidance would be greatly appreciated!
Now I've got this working but when I try.
npm run agent
[email protected] agent
npx tsc && node -r dotenv/config dist/index.js dotenv_config_path=.env.local
Brain found.
Memory count: 2
What would you like to know?
can we say that finland is the land of thousands lakes?
Recalling...
Insuffient memories. Now learning...
I made a mistake. Trying again...
I made a mistake. Trying again...
I made a mistake. Trying again...
I made a mistake. Trying again...
Anyone know how to solve this loop?
Insuffient memories. Now learning...
I made a mistake. Trying again...
I made a mistake. Trying again...
I made a mistake. Trying again...
I made a mistake. Trying again...
I made a mistake. Trying again...
I made a mistake. Trying again...
I made a mistake. Trying again...
I did get this error message when I try to run this.
➜ ai-brainstore git:(main) ✗ npm run agent
[email protected] agent
npx tsc && node dist/index.js
chroma/clients/js/jest.config.ts:1:29 - error TS2307: Cannot find module '@jest/types' or its corresponding type declarations.
1 import type { Config } from '@jest/types'
~~~~~~~~~~~~~
chroma/clients/js/test/client.test.ts:1:30 - error TS2307: Cannot find module '@jest/globals' or its corresponding type declarations.
1 import { expect, test } from '@jest/globals';
~~~~~~~~~~~~~~~
Found 2 errors in 2 files.
Errors Files
1 chroma/clients/js/jest.config.ts:1
1 chroma/clients/js/test/client.test.ts:1
I installed Chroma in same folder than this project. Is it problem here?
node_modules/langchain/dist/cache.d.ts:1:38 - error TS2307: Cannot find module 'redis' or its corresponding type declarations.
1 import type { RedisClientType } from "redis";
~~~~~~~
node_modules/langchain/dist/sql_db.d.ts:1:67 - error TS2307: Cannot find module 'typeorm' or its corresponding type declarations.
1 import type { DataSource as DataSourceT, DataSourceOptions } from "typeorm";
~~~~~~~~~
node_modules/langchain/dist/util/sql_utils.d.ts:1:52 - error TS2307: Cannot find module 'typeorm' or its corresponding type declarations.
1 import type { DataSource, DataSourceOptions } from "typeorm";
~~~~~~~~~
node_modules/langchain/dist/vectorstores/hnswlib.d.ts:1:69 - error TS2307: Cannot find module 'hnswlib-node' or its corresponding type declarations.
1 import type { HierarchicalNSW as HierarchicalNSWT, SpaceName } from "hnswlib-node";
After following the tutorial and getting to the 'npm run agent' line, I am getting the following error:
chroma/clients/js/examples/browser/app.ts:5:35 - error TS2559: Type '"http://localhost:8000"' has no properties in common with type '{ path?: string; }'.
5 const chroma = new ChromaClient("http://localhost:8000");
~~~~~~~~~~~~~~~~~~~~~~~
chroma/clients/js/examples/browser/app.ts:8:52 - error TS2345: Argument of type
'string' is not assignable to parameter of type '{ name: string; metadata?: CollectionMetadata; embeddingFunction?: IEmbeddingFunction; }'.
8 const collection = await chroma.createCollection("test-from-js");
~~~~~~~~~~~~~~
chroma/clients/js/examples/browser/app.ts:21:39 - error TS2554: Expected 1 arguments, but got 3.
21 let add = await collection.add(ids, embeddings, metadata);
~~~~~~~~~~~~~~~~~~~~
chroma/clients/js/examples/browser/app.ts:27:61 - error TS2554: Expected 1 arguments, but got 3.
27 const queryData = await collection.query([1, 2, 3, 4, 5], 5, {
~~~~
28 test: "test",
29 });
~~~
chroma/clients/js/jest.config.ts:1:29 - error TS2307: Cannot find module '@jest/types' or its corresponding type declarations.
1 import type { Config } from "@jest/types";
~~~~~~~~~~~~~
chroma/clients/js/test/add.collections.test.ts:1:30 - error TS2307: Cannot find module '@jest/globals' or its corresponding type declarations.
1 import { expect, test } from '@jest/globals';
~~~~~~~~~~~~~~~
chroma/clients/js/test/client.test.ts:1:30 - error TS2307: Cannot find module '@jest/globals' or its corresponding type declarations.
1 import { expect, test } from "@jest/globals";
~~~~~~~~~~~~~~~
chroma/clients/js/test/collection.client.test.ts:1:42 - error TS2307: Cannot find module '@jest/globals' or its corresponding type declarations.
1 import { expect, test, beforeEach } from "@jest/globals";
~~~~~~~~~~~~~~~
chroma/clients/js/test/collection.test.ts:1:30 - error TS2307: Cannot find module '@jest/globals' or its corresponding type declarations.
1 import { expect, test } from "@jest/globals";
~~~~~~~~~~~~~~~
chroma/clients/js/test/delete.collection.test.ts:1:30 - error TS2307: Cannot find module '@jest/globals' or its corresponding type declarations.
1 import { expect, test } from "@jest/globals";
~~~~~~~~~~~~~~~
chroma/clients/js/test/get.collection.test.ts:1:30 - error TS2307: Cannot find module '@jest/globals' or its corresponding type declarations.
1 import { expect, test } from "@jest/globals";
~~~~~~~~~~~~~~~
chroma/clients/js/test/peek.collection.test.ts:1:30 - error TS2307: Cannot find module '@jest/globals' or its corresponding type declarations.
1 import { expect, test } from "@jest/globals";
~~~~~~~~~~~~~~~
chroma/clients/js/test/query.collection.test.ts:1:30 - error TS2307: Cannot find module '@jest/globals' or its corresponding type declarations.
1 import { expect, test } from "@jest/globals";
~~~~~~~~~~~~~~~
chroma/clients/js/test/update.collection.test.ts:1:30 - error TS2307: Cannot find module '@jest/globals' or its corresponding type declarations.
1 import { expect, test } from "@jest/globals";
~~~~~~~~~~~~~~~
chroma/clients/js/test/upsert.collections.test.ts:1:30 - error TS2307: Cannot find module '@jest/globals' or its corresponding type declarations.
1 import { expect, test } from '@jest/globals';
~~~~~~~~~~~~~~~
index.ts:12:48 - error TS2345: Argument of type 'string' is not assignable to pa
rameter of type '{ openai_api_key: string; openai_model?: string; openai_organization_id?: string; }'.
12 const embedder = new OpenAIEmbeddingFunction(process.env.OPENAI_API_KEY);
~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/langchain/dist/vectorstores/hnswlib.d.ts:1:69 - error TS2307: Cannot find module 'hnswlib-node' or its corresponding type declarations.
1 import type { HierarchicalNSW as HierarchicalNSWT, SpaceName } from "hnswlib-node";
~~~~~~~~~~~~~~
utils/index.ts:23:55 - error TS2554: Expected 1 arguments, but got 2.
23 return await client.getCollection(collectionName, embedder);
~~~~~~~~
utils/index.ts:26:70 - error TS2554: Expected 1 arguments, but got 3.
26 const collection = await client.createCollection(collectionName, {}, embedder);
~~~~~~~~~~~~
utils/index.ts:86:43 - error TS2554: Expected 1 arguments, but got 4.
1 chroma/clients/js/test/get.collection.test.ts:1
1 chroma/clients/js/test/peek.collection.test.ts:1
1 chroma/clients/js/test/query.collection.test.ts:1
1 chroma/clients/js/test/update.collection.test.ts:1
1 chroma/clients/js/test/upsert.collections.test.ts:1
1 index.ts:12
1 node_modules/langchain/dist/vectorstores/hnswlib.d.ts:1
3 utils/index.ts:23
`What would you like to know?
whats nba
Recalling...
file:///Users/whizv/lab/ai-brainstore/node_modules/langchain/dist/vectorstores/chroma.js:90
const [firstIds] = ids;
^
TypeError: ids is not iterable`
Hello,
I installed chroma and started it with docker-compose.
$ docker container ls --all
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
b8f0336a053d chroma-server "uvicorn chromadb.ap…" 29 minutes ago Up 29 minutes 0.0.0.0:8000->8000/tcp chroma-server-1
f586204dae2a clickhouse/clickhouse-server:22.9-alpine "/entrypoint.sh" 29 minutes ago Up 29 minutes 0.0.0.0:8123->8123/tcp, 0.0.0.0:9000->9000/tcp, 9009/tcp chroma-clickhouse-1
Then ran npm run agent
. After 1 minute, I got this error:
file:///Users/me/local/opt/ai-brainstore/node_modules/langchain/dist/util/axios-fetch-adapter.js:316
const error = new Error(message);
^
Error: Request failed with status code 429
at createError (file:///Users/me/local/opt/ai-brainstore/node_modules/langchain/dist/util/axios-fetch-adapter.js:316:19)
at settle (file:///Users/me/local/opt/ai-brainstore/node_modules/langchain/dist/util/axios-fetch-adapter.js:25:16)
at file:///Users/me/local/opt/ai-brainstore/node_modules/langchain/dist/util/axios-fetch-adapter.js:175:19
at new Promise (<anonymous>)
at fetchAdapter (file:///Users/me/local/opt/ai-brainstore/node_modules/langchain/dist/util/axios-fetch-adapter.js:167:12)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async RetryOperation._fn (/Users/me/local/opt/ai-brainstore/node_modules/p-retry/index.js:50:12) {
that ended with :
data: {
error: {
message: 'You exceeded your current quota, please check your plan and billing details.',
type: 'insufficient_quota',
param: null,
code: null
}
}
What am I doing wrong? I'm currently using ChatGPT 3.5 on the free trial. Do I need to set up a paid account?
Thank you
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.