Skip to content

Commit

Permalink
[119] Architecture diagram (#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
kenvontucky authored Nov 6, 2024
1 parent 5ac8941 commit a9dca50
Show file tree
Hide file tree
Showing 9 changed files with 611 additions and 15 deletions.
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.11.7
15 changes: 5 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# labs

<a target="_blank" href="https://cookiecutter-data-science.drivendata.org/">
<img src="https://img.shields.io/badge/CCDS-Project%20template-328F97?logo=cookiecutter" />
</a>
<img src="https://img.shields.io/badge/runtime_revolution-labs-blue" />

Runtime Labs
## Topics

- [Architecture](docs/rag.md)
- [R&D](docs/rd.md)

## Getting Started

Expand Down Expand Up @@ -38,9 +39,3 @@ Here's the steps to setup the project locally:
3. `make up`
4. `make api` or `ENV=local make api`
5. `ENV=test make tests`


## Approaches, Tests Conducted and Results

For details on the approaches and tests conducted on issues encountered during development,
refer to the document [here](./doc/results.md)
8 changes: 8 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
services:
postgres:
container_name: postgres
image: postgres:13
environment:
POSTGRES_USER: ${DATABASE_USER}
POSTGRES_PASSWORD: ${DATABASE_PASS}
POSTGRES_DB: ${POSTGRES_DB}

labs-db:
container_name: labs-db
image: pgvector/pgvector:pg16
Expand Down
File renamed without changes.
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ def extract_classes(file_path):
args.append(f"{arg.arg}: {arg.annotation.id}")
elif isinstance(arg.annotation, ast.Subscript):
if isinstance(arg.annotation.value, ast.Name):
args.append(f"{arg.arg}: {arg.annotation.value.id}[{arg.annotation.slice.value.id}]")
args.append(
f"{arg.arg}: {arg.annotation.value.id}[{arg.annotation.slice.value.id}]"
)
else:
args.append(arg.arg)
method_signature = f"{visibility} {method_name}({', '.join(args)})"
Expand Down
68 changes: 68 additions & 0 deletions docs/rag.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# RAG Architecture

## Challenges

1. Context embeddings creation

* how are embeddings created? which strategy was used?

2. Query + context

* Ensure query + context reflect what's intended
* provides an acceptable answer

3. Include the generated answer in the correct place in the project

## RAG General view

```mermaid
flowchart
subgraph Prompt
A[/Query/] --> B[Embedding model<br> <strong>text-embedding-ada-002</strong>]
B --> C[Embeddings]
end
subgraph Context
E[/Data source/] --> F[Embedding model<br> <strong>text-embedding-ada-002</strong>]
F --> G[Embeddings]
end
subgraph Vector Database
C --> D[(<strong>PostgreSQL PGVector</strong>)]
G --> D
end
subgraph LLM
A --> H[/Query + Context/]
D --> H
H --> I[OpenAPI o1]
I --> J[/Response/]
end
```

## Integrations

```mermaid
flowchart
subgraph CodeMonkey
API
end
subgraph Local
C[Repository]
end
subgraph Github
D[Repository]
Issues
App
end
Github <--> CodeMonkey
Local <--> CodeMonkey
```

## Embeddings and LLM

| Embeddings | LLM |
| --- | --- |
| text-embedding-ada-002 | OpenAPI o1 |
| text-embedding-ada-002 | Llama 3.2 (local) |
4 changes: 2 additions & 2 deletions doc/results.md → docs/rd.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Project tests results
# Research & Development

This document aims to document some of the approaches tested and the discoveries made on various problems,
as well as the results achieved from the tests conducted.


## Embeddins
## Embeddings

During the course of the project, various approaches were taken regarding how embeddings are generated, namely:

Expand Down
Loading

0 comments on commit a9dca50

Please sign in to comment.