GithubHelp home page GithubHelp logo

vontainment / v-gpt-qdrant-api Goto Github PK

View Code? Open in Web Editor NEW
12.0 4.0 2.0 4.36 MB

Give AI long term memory using FastAPI and Qdrant. Checkout dev branch for version with built in embedding model that can run on low end hardware.

Home Page: https://vontainment.com

License: GNU General Public License v3.0

Dockerfile 4.36% Python 59.76% HTML 35.88%
ai ai-memory custom-gpt fastapi gpt openai qdrant embeddings openapi

v-gpt-qdrant-api's Introduction

Hi there ๐Ÿ‘‹

v-gpt-qdrant-api's People

Contributors

dependabot[bot] avatar imgbotapp avatar vontainment avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

v-gpt-qdrant-api's Issues

Possibility to add update_memory endpoint?

Would it be possible to add a "update_memory" endpoint? I'd like an agent to be able to update a memory, maybe add tags even. This would make it possible to evolve a memory.

Example: user tells agent about some unresolved matter.. but the next day the matter has been resolved by the user.. now in the current system there are 2 memories, one about the matter being unresolved and another being the resolved matter. This more often than not confuses the AI. It'd be great to add to or simply rewrite the existing matching memory without having to let the agent find, delete existing and create new memory (deleting and re-creating would also mess with the original timestamp of the memory, which we need to preserve in my opinion).

More tags & entities?

I'd welcome the ability to add even more tags and entities.

In my current set-up I would need to add another layer of entities or tags to be able to categorize the memories even more.

An error occurred: delete() missing 1 required positional argument: 'points_selector'

When passing a POST call to forget a certain memory, I get the following error:

An error occurred: delete() missing 1 required positional argument: 'points_selector'
INFO:     10.0.7.4:44426 - "POST /manage_memories HTTP/1.1" 500 Internal Server Error

The required params have been correctly passed in the body: memory_bank, action and the UUID of the point to delete.

After skimming through the responsible code, I was wondering if this part is correct:

elif Params.action == "forget":
            if Params.uuid is None:
                raise HTTPException(
                    status_code=400, detail="UUID must be provided for forget action"
                )

            # Delete specific memory using UUID
            await Qdrant.delete(
                collection_name=Params.memory_bank, point_ids=[Params.uuid]
            )

            return {
                "message": f"Memory with UUID '{Params.uuid}' has been forgotten from Memory Bank '{Params.memory_bank}'."
            }

ability to pass the timestamp via API?

I think it would be a good idea to be able to pass the timestamp via API. This way the memories can be stored with the users actual timezone, instead of the hard-coded UTC timezone.

Getting error 500 after latest update to the dev branch.

I've been playing around in flowise with custom tools and had it working fine before your latest update to the dev branch.

Now when creating new collection for example, I see this output in the log:

Error processing request: `host` param is not expected to contain protocol (http:// or https://). Try to use `url` parameter instead.
INFO:     10.0.7.4:51340 - "POST /collections HTTP/1.1" 500 Internal Server Error
ERROR:    Exception in ASGI application
  + Exception Group Traceback (most recent call last):
  |   File "/usr/local/lib/python3.9/site-packages/starlette/_utils.py", line 87, in collapse_excgroups
  |     yield
  |   File "/usr/local/lib/python3.9/site-packages/starlette/middleware/base.py", line 193, in __call__
  |     response_sent.set()
  |   File "/usr/local/lib/python3.9/site-packages/anyio/_backends/_asyncio.py", line 678, in __aexit__
  |     raise BaseExceptionGroup(
  | exceptiongroup.ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
  +-+---------------- 1 ----------------
    | Traceback (most recent call last):
    |   File "/usr/local/lib/python3.9/site-packages/uvicorn/protocols/http/h11_impl.py", line 407, in run_asgi
    |     result = await app(  # type: ignore[func-returns-value]
    |   File "/usr/local/lib/python3.9/site-packages/uvicorn/middleware/proxy_headers.py", line 69, in __call__
    |     return await self.app(scope, receive, send)
    |   File "/usr/local/lib/python3.9/site-packages/fastapi/applications.py", line 1054, in __call__
    |     await super().__call__(scope, receive, send)
    |   File "/usr/local/lib/python3.9/site-packages/starlette/applications.py", line 123, in __call__
    |     await self.middleware_stack(scope, receive, send)
    |   File "/usr/local/lib/python3.9/site-packages/starlette/middleware/errors.py", line 186, in __call__
    |     raise exc
    |   File "/usr/local/lib/python3.9/site-packages/starlette/middleware/errors.py", line 164, in __call__
    |     await self.app(scope, receive, _send)
    |   File "/usr/local/lib/python3.9/site-packages/starlette/middleware/base.py", line 193, in __call__
    |     response_sent.set()
    |   File "/usr/local/lib/python3.9/contextlib.py", line 137, in __exit__
    |     self.gen.throw(typ, value, traceback)
    |   File "/usr/local/lib/python3.9/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
    |     raise exc
    |   File "/usr/local/lib/python3.9/site-packages/starlette/middleware/base.py", line 191, in __call__
    |     response = await self.dispatch_func(request, call_next)
    |   File "/app/dependencies.py", line 72, in limit_concurrency
    |     raise HTTPException(status_code=500, detail="Internal Server Error")
    | fastapi.exceptions.HTTPException: 500: Internal Server Error
    +------------------------------------

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/uvicorn/protocols/http/h11_impl.py", line 407, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "/usr/local/lib/python3.9/site-packages/uvicorn/middleware/proxy_headers.py", line 69, in __call__
    return await self.app(scope, receive, send)
  File "/usr/local/lib/python3.9/site-packages/fastapi/applications.py", line 1054, in __call__
    await super().__call__(scope, receive, send)
  File "/usr/local/lib/python3.9/site-packages/starlette/applications.py", line 123, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/local/lib/python3.9/site-packages/starlette/middleware/errors.py", line 186, in __call__
    raise exc
  File "/usr/local/lib/python3.9/site-packages/starlette/middleware/errors.py", line 164, in __call__
    await self.app(scope, receive, _send)
  File "/usr/local/lib/python3.9/site-packages/starlette/middleware/base.py", line 193, in __call__
    response_sent.set()
  File "/usr/local/lib/python3.9/contextlib.py", line 137, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/usr/local/lib/python3.9/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
    raise exc
  File "/usr/local/lib/python3.9/site-packages/starlette/middleware/base.py", line 191, in __call__
    response = await self.dispatch_func(request, call_next)
  File "/app/dependencies.py", line 72, in limit_concurrency
    raise HTTPException(status_code=500, detail="Internal Server Error")
fastapi.exceptions.HTTPException: 500: Internal Server Error
Current active tasks: 1
Error processing request: `host` param is not expected to contain protocol (http:// or https://). Try to use `url` parameter instead.
INFO:     10.0.7.4:51350 - "POST /collections HTTP/1.1" 500 Internal Server Error
ERROR:    Exception in ASGI application
  + Exception Group Traceback (most recent call last):
  |   File "/usr/local/lib/python3.9/site-packages/starlette/_utils.py", line 87, in collapse_excgroups
  |     yield
  |   File "/usr/local/lib/python3.9/site-packages/starlette/middleware/base.py", line 193, in __call__
  |     response_sent.set()
  |   File "/usr/local/lib/python3.9/site-packages/anyio/_backends/_asyncio.py", line 678, in __aexit__
  |     raise BaseExceptionGroup(
  | exceptiongroup.ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
  +-+---------------- 1 ----------------
    | Traceback (most recent call last):
    |   File "/usr/local/lib/python3.9/site-packages/uvicorn/protocols/http/h11_impl.py", line 407, in run_asgi
    |     result = await app(  # type: ignore[func-returns-value]
    |   File "/usr/local/lib/python3.9/site-packages/uvicorn/middleware/proxy_headers.py", line 69, in __call__
    |     return await self.app(scope, receive, send)
    |   File "/usr/local/lib/python3.9/site-packages/fastapi/applications.py", line 1054, in __call__
    |     await super().__call__(scope, receive, send)
    |   File "/usr/local/lib/python3.9/site-packages/starlette/applications.py", line 123, in __call__
    |     await self.middleware_stack(scope, receive, send)
    |   File "/usr/local/lib/python3.9/site-packages/starlette/middleware/errors.py", line 186, in __call__
    |     raise exc
    |   File "/usr/local/lib/python3.9/site-packages/starlette/middleware/errors.py", line 164, in __call__
    |     await self.app(scope, receive, _send)
    |   File "/usr/local/lib/python3.9/site-packages/starlette/middleware/base.py", line 193, in __call__
    |     response_sent.set()
    |   File "/usr/local/lib/python3.9/contextlib.py", line 137, in __exit__
    |     self.gen.throw(typ, value, traceback)
    |   File "/usr/local/lib/python3.9/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
    |     raise exc
    |   File "/usr/local/lib/python3.9/site-packages/starlette/middleware/base.py", line 191, in __call__
    |     response = await self.dispatch_func(request, call_next)
    |   File "/app/dependencies.py", line 72, in limit_concurrency
    |     raise HTTPException(status_code=500, detail="Internal Server Error")
    | fastapi.exceptions.HTTPException: 500: Internal Server Error
    +------------------------------------

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/uvicorn/protocols/http/h11_impl.py", line 407, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "/usr/local/lib/python3.9/site-packages/uvicorn/middleware/proxy_headers.py", line 69, in __call__
    return await self.app(scope, receive, send)
  File "/usr/local/lib/python3.9/site-packages/fastapi/applications.py", line 1054, in __call__
    await super().__call__(scope, receive, send)
  File "/usr/local/lib/python3.9/site-packages/starlette/applications.py", line 123, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/local/lib/python3.9/site-packages/starlette/middleware/errors.py", line 186, in __call__
    raise exc
  File "/usr/local/lib/python3.9/site-packages/starlette/middleware/errors.py", line 164, in __call__
    await self.app(scope, receive, _send)
  File "/usr/local/lib/python3.9/site-packages/starlette/middleware/base.py", line 193, in __call__
    response_sent.set()
  File "/usr/local/lib/python3.9/contextlib.py", line 137, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/usr/local/lib/python3.9/site-packages/starlette/_utils.py", line 93, in collapse_excgroups
    raise exc
  File "/usr/local/lib/python3.9/site-packages/starlette/middleware/base.py", line 191, in __call__
    response = await self.dispatch_func(request, call_next)
  File "/app/dependencies.py", line 72, in limit_concurrency
    raise HTTPException(status_code=500, detail="Internal Server Error")
fastapi.exceptions.HTTPException: 500: Internal Server Error

For reference, the following is the "custom tool" javascript function that I created to be able to let an agent create a new collection:

const fetch = require('node-fetch');
const userId = $vars.userId;
const body = {
        "collection_name": `${userId}`
    };
const options = {
      method: 'POST',
      headers: {
            'Content-Type': 'application/json'
      },
      body: JSON.stringify(body)
};

const url = `http://memories-api:8060/collections`;

try {
	const response = await fetch(url, options);
	const text = await response.text();
	return text;
} catch (error) {
	console.error(error);
	return '';
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.